niosh-string-parse
Version:
parser for string returning data type managed
31 lines (21 loc) • 1.86 kB
JavaScript
const parser = require('./niosh.js');
String.prototype.parseBool = function() { parser.boolExcept(this); }
Object.defineProperty(String.prototype, 'parseBool', {enumerable:false,writable:false,configurable:false});
String.prototype.parseNumber = function() { parser.numberExcept(this); }
Object.defineProperty(String.prototype, 'parseNumber', {enumerable:false,writable:false,configurable:false});
String.prototype.parseFloat = function() { parser.floatExcept(this); }
Object.defineProperty(String.prototype, 'parseFloat', {enumerable:false,writable:false,configurable:false});
String.prototype.parseInt = function() { parser.intExcept(this); }
Object.defineProperty(String.prototype, 'parseInt', {enumerable:false,writable:false,configurable:false});
String.prototype.parseNatural = function() { parser.naturalExcept(this); }
Object.defineProperty(String.prototype, 'parseNatural', {enumerable:false,writable:false,configurable:false});
String.prototype.parseDate = function() { parser.dateExcept(this); }
Object.defineProperty(String.prototype, 'parseDate', {enumerable:false,writable:false,configurable:false});
String.prototype.parseSymbol = function() { parser.symbolExcept(this); }
Object.defineProperty(String.prototype, 'parseSymbol', {enumerable:false,writable:false,configurable:false});
String.prototype.parseBigint = function() { parser.bigintExcept(this); }
Object.defineProperty(String.prototype, 'parseBigint', {enumerable:false,writable:false,configurable:false});
String.prototype.parseRegExp = function() { parser.regexpExcept(this); }
Object.defineProperty(String.prototype, 'parseRegExp', {enumerable:false,writable:false,configurable:false});
String.prototype.parseObject = function() { parser.objectExcept(this); }
Object.defineProperty(String.prototype, 'parseObject', {enumerable:false,writable:false,configurable:false});