nl_tokens: Test whether a string is a valid Chartbuilder model
pl_tokens: function validate_chart_model ( modelStr ) { var parsed ; <mask> { parsed = JSON . parse ( modelStr ) ; } catch ( e ) { throw new TypeError ( "Chart model is not valid JSON" ) ; } var isValidChartModel = ( parsed . hasOwnProperty ( "chartProps" ) && parsed . hasOwnProperty ( "metadata" ) ) ; if ( isValidChartModel ) { return parsed ; } else { throw new TypeError ( "Not a valid Chartbuilder model" ) ; } }