nl_tokens: VALIDATE // FUNCTION : validate ( opts options ) Validates function options .
pl_tokens: function validate ( opts , options ) { if ( ! isObject ( options ) ) { return new TypeError ( 'invalid input argument. Options argument must be an object. Value: `' + options + '`.' ) ; } if ( options . hasOwnProperty ( 'mu' ) ) { opts . mu = options . mu ; if ( ! isNumber ( opts . mu ) ) { return new TypeError ( 'invalid option. `mu` parameter must be a number primitive. Option: `' + opts . mu + '`.' ) ; } } if ( options . hasOwnProperty ( 'sigma' ) ) { opts . sigma = options . sigma ; if ( ! isNonNegative ( opts . sigma ) ) { return new TypeError ( 'invalid option. `sigma` parameter must be a non-negative number. Option: `' + opts . sigma + '`.' ) ; } } if ( options . hasOwnProperty ( 'dtype' ) ) { opts . dtype = options . dtype ; if ( ! isString ( opts . dtype ) ) { return new TypeError ( 'invalid option. Data type option must be a string primitive. Option: `' + opts . dtype + '`.' ) ; } } if ( <mask> . hasOwnProperty ( 'seed' ) ) { opts . seed = options . seed ; if ( ! isPositiveInteger ( opts . seed ) ) { return new TypeError ( 'invalid option. Seed option must be a positive integer. Option: `' + opts . seed + '`.' ) ; } } return null ; }