mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
Update npm and add the jquery mask
This commit is contained in:
parent
d5fab8dacf
commit
bd97e8aa6c
2799 changed files with 332053 additions and 2864 deletions
44
node_modules/set-function-length/index.js
generated
vendored
Normal file
44
node_modules/set-function-length/index.js
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
'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%');
|
||||
|
||||
/** @typedef {(...args: unknown[]) => unknown} Func */
|
||||
|
||||
/** @type {<T extends Func = Func>(fn: T, length: number, loose?: boolean) => T} */
|
||||
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<define>[0]} */ (fn), 'length', length, true, true);
|
||||
} else {
|
||||
define(/** @type {Parameters<define>[0]} */ (fn), 'length', length);
|
||||
}
|
||||
}
|
||||
return fn;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue