lib/index.js
/**
* FUNCTION: serialize( value )
*	Serializes a value as a string for dynamic code evaluation.
*
* @param {Number|String|Array|Object|Null|Undefined|Boolean} value - value to serialize
* @returns {String} serialized value
*/
serialize( value )
Serializes a value as a string for dynamic code evaluation.
serialize ( value ) Serializes a value as a string for dynamic code evaluation .
function serialize( value ) {
	if ( !arguments.length ) {
		throw new Error( 'insufficient input arguments. Must provide a value to serialize.' );
	}
	if ( value === PINF ) {
		return pinf2str();
	}
	if ( value === NINF ) {
		return ninf2str();
	}
	if ( isDate( value ) ) {
		return date2str( value );
	}
	if ( isRegExp( value ) ) {
		return value.toString();
	}
	if ( isBuffer( value ) ) {
		return buffer2str( value );
	}
	if ( isTypedArray( value ) ) {
		return typedarray2str( value );
	}
	if (
		isString( value ) ||
		isArray( value ) ||
		isObject( value )
	) {
		return JSON.stringify( value );
	}
	if (
		value === void 0 ||
		value === null
	) {
		return '' + value;
	}
	if ( isNativeFcn( value ) ) {
		throw new TypeError( 'invalid input argument. Native functions are not supported. Value: `' + value + '`.' );
	}
	return value.toString();
} 
function serialize ( value ) { if ( ! arguments . length ) { throw new Error ( 'insufficient input arguments. Must provide a value to serialize.' ) ; } if ( value === PINF ) { return pinf2str ( ) ; } if ( value === NINF ) { return ninf2str ( ) ; } if ( isDate ( value ) ) { return date2str ( value ) ; } if ( isRegExp ( value ) ) { return value . toString ( ) ; } if ( isBuffer ( value ) ) { return buffer2str ( value ) ; } if ( isTypedArray ( value ) ) { return typedarray2str ( value ) ; } if ( isString ( value ) || isArray ( value ) || isObject ( value ) ) { return JSON . stringify ( value ) ; } if ( value === void 0 || value === null ) { return '' + value ; } if ( isNativeFcn ( value ) ) { throw new TypeError ( 'invalid input argument. Native functions are not supported. Value: `' + value + '`.' ) ; } return value . toString ( ) ; }
FUNCTION: serialize( value )
Serializes a value as a string for dynamic code evaluation.
FUNCTION : serialize ( value ) Serializes a value as a string for dynamic code evaluation .
// end FUNCTION serialize()