src/Viz.js
/**
     * This function checks the input parameter `definition` returning always an object.
     * If the `definition` is an object it returns the same object.
     * If the `definition` is a string it returns the parsed string as an object.
     * Otherwise it throws an error.
     *
     * @param  {string|object} definition
     * @return {VizSpec}
     */
This function checks the input parameter `definition` returning always an object.
If the `definition` is an object it returns the same object.
If the `definition` is a string it returns the parsed string as an object.
Otherwise it throws an error.

@param  {string|object} definition
@return {VizSpec}
This function checks the input parameter ` definition ` returning always an object . If the ` definition ` is an object it returns the same object . If the ` definition ` is a string it returns the parsed string as an object . Otherwise it throws an error . @param { string|object } definition @return { VizSpec }
_getVizDefinition (definition) {
        if (util.isUndefined(definition)) {
            return this._setDefaults({});
        }
        if (util.isObject(definition)) {
            return this._setDefaults(definition);
        }
        if (util.isString(definition)) {
            return this._setDefaults(parseVizDefinition(definition));
        }
        throw new CartoValidationError('viz', 'nonValidDefinition');
    }
_getVizDefinition ( definition ) { if ( util . isUndefined ( definition ) ) { return this . _setDefaults ( { } ) ; } if ( util . isObject ( definition ) ) { return this . _setDefaults ( definition ) ; } if ( util . isString ( definition ) ) { return this . _setDefaults ( parseVizDefinition ( definition ) ) ; } throw new CartoValidationError ( 'viz' , 'nonValidDefinition' ) ; }
This function checks the input parameter `definition` returning always an object.
This function checks the input parameter ` definition ` returning always an object .