function parseJSON( str, reviver ) {
	if ( !isString( str ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', str ) );
	}
	if ( arguments.length > 1 ) {
		if ( !isFunction( reviver ) ) {
			throw new TypeError( format( 'invalid argument. Reviver argument must be a function. Value: `%s`.', reviver ) );
		}
	}
	try {
		return JSON.parse( str, reviver );
	} catch ( error ) {
		return error;
	}
}
Attempts to parse a string as JSON.

@param {string} str - string to parse
@param {Function} [reviver] - transformation function
@throws {TypeError} first argument must be a string
@throws {TypeError} reviver must be a function
@returns {(*|Error)} parsed value or parse error

@example
var obj = parseJSON( '{"beep":"boop"}' );
// returns {'beep':'boop'}