nl_tokens: autoParse auto - parse any value you happen to send in ( String Number Boolean Array Object Function undefined and null ) . You send it we will try to find a way to parse it . We now support sending in a string of what type ( e . g . boolean ) or constructor ( e . g . Boolean )
pl_tokens: function autoParse ( value , type ) { if ( type ) { return parseType ( value , type ) } var orignalValue = value /**
     *  PRE RULE - check for null be cause null can be typeof object which can  through off parsing
     */ if ( <mask> === null ) { return null } /**
     * TYPEOF SECTION - Use to check and do specific things based off of know the type
     * Check against undefined
     */ if ( value === void 0 ) { return undefined } if ( value instanceof Date || value instanceof RegExp ) { return value } if ( typeof value === 'number' || typeof value === 'boolean' ) { return value } if ( typeof value === 'function' ) { return parseFunction ( value ) } if ( typeof value === 'object' ) { return parseObject ( value ) } /**
     * STRING SECTION - If we made it this far that means it is a string that we must do something with to parse
     */ if ( value === 'NaN' ) { return NaN } var jsonParsed = null try { jsonParsed = JSON . parse ( value ) } catch ( e ) { try { jsonParsed = JSON . parse ( value . trim ( ) . replace ( / (\\\\")|(\\") / gi , '"' ) . replace ( / (\\n|\\\\n) / gi , '' ) . replace ( / (^"|"$)|(^'|'$) / gi , '' ) ) } catch ( e ) { } } if ( jsonParsed && typeof jsonParsed === 'object' ) { return autoParse ( jsonParsed ) } value = stripTrimLower ( value ) if ( value === 'undefined' || value === '' ) { return undefined } if ( value === 'null' ) { return null } /**
     * Order Matter because if it is a one or zero boolean will come back with a awnser too. if you want it to be a boolean you must specify
     */ var num = Number ( value ) if ( typpy ( num , Number ) ) { return num } var boo = checkBoolean ( value ) if ( typpy ( boo , Boolean ) ) { return boo } /**
     * DEFAULT SECTION - bascially if we catch nothing we assume that you just have a string
     */ return String ( orignalValue ) }