/home/techb158/balavpn.abdallabala.com/node_modules/set-function-length
NameSizeModeActions
.github/-0777rm
.eslintrc4040666editdlrm
.nycrc2160666editdlrm
CHANGELOG.md48760666editdlrm
env.d.ts2220666editdlrm
env.js8670666editdlrm
index.d.ts2560666editdlrm
index.js12730666editdlrm
LICENSE10830666editdlrm
package.json27040666editdlrm
README.md21670666editdlrm
tsconfig.json1160666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/node_modules/set-function-length/index.js (1273B)
'use strict'; var GetIntrinsic = require('get-intrinsic'); var define = require('define-data-property'); var hasDescriptors = require('has-property-descriptors')(); var gOPD = require('gopd'); var $TypeError = require('es-errors/type'); var $floor = GetIntrinsic('%Math.floor%'); /** @type {import('.')} */ module.exports = function setFunctionLength(fn, length) { if (typeof fn !== 'function') { throw new $TypeError('`fn` is not a function'); } if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { throw new $TypeError('`length` must be a positive 32-bit integer'); } var loose = arguments.length > 2 && !!arguments[2]; var functionLengthIsConfigurable = true; var functionLengthIsWritable = true; if ('length' in fn && gOPD) { var desc = gOPD(fn, 'length'); if (desc && !desc.configurable) { functionLengthIsConfigurable = false; } if (desc && !desc.writable) { functionLengthIsWritable = false; } } if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { if (hasDescriptors) { define(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); } else { define(/** @type {Parameters[0]} */ (fn), 'length', length); } } return fn; };