Server IP : 162.213.251.212 / Your IP : 18.119.159.212 [ Web Server : LiteSpeed System : Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : allssztx ( 535) PHP Version : 8.1.31 Disable Function : NONE Domains : 1 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/allssztx/www/easybuyer/node_modules/unbox-primitive/ |
Upload File : |
'use strict'; var whichBoxedPrimitive = require('which-boxed-primitive'); var callBound = require('call-bind/callBound'); var hasSymbols = require('has-symbols')(); var hasBigInts = require('has-bigints')(); var stringToString = callBound('String.prototype.toString'); var numberValueOf = callBound('Number.prototype.valueOf'); var booleanValueOf = callBound('Boolean.prototype.valueOf'); var symbolValueOf = hasSymbols && callBound('Symbol.prototype.valueOf'); var bigIntValueOf = hasBigInts && callBound('BigInt.prototype.valueOf'); module.exports = function unboxPrimitive(value) { var which = whichBoxedPrimitive(value); if (typeof which !== 'string') { throw new TypeError(which === null ? 'value is an unboxed primitive' : 'value is a non-boxed-primitive object'); } if (which === 'String') { return stringToString(value); } if (which === 'Number') { return numberValueOf(value); } if (which === 'Boolean') { return booleanValueOf(value); } if (which === 'Symbol') { if (!hasSymbols) { throw new EvalError('somehow this environment does not have Symbols, but you have a boxed Symbol value. Please report this!'); } return symbolValueOf(value); } if (which === 'BigInt') { return bigIntValueOf(value); } throw new RangeError('unknown boxed primitive found: ' + which); };