axe 13.0.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/axe.js +897 -105
- package/dist/axe.min.js +1 -1
- package/lib/index.js +38 -26
- package/package.json +25 -25
- package/src/index.js +29 -8
package/dist/axe.js
CHANGED
|
@@ -52,8 +52,7 @@ const get = (obj, parts, length) => {
|
|
|
52
52
|
}
|
|
53
53
|
return obj;
|
|
54
54
|
};
|
|
55
|
-
module.exports =
|
|
56
|
-
let sep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
55
|
+
module.exports = (obj, path, sep = '.') => {
|
|
57
56
|
if (!isObject(obj) || !path) {
|
|
58
57
|
return obj;
|
|
59
58
|
}
|
|
@@ -92,8 +91,7 @@ const set = (obj, parts, length, val) => {
|
|
|
92
91
|
* @param {String} [sep = '.']
|
|
93
92
|
* @returns {Object}
|
|
94
93
|
*/
|
|
95
|
-
module.exports =
|
|
96
|
-
let sep = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
|
|
94
|
+
module.exports = (obj, path, val, sep = '.') => {
|
|
97
95
|
if (!isObject(obj) || !path || !path.length) {
|
|
98
96
|
return obj;
|
|
99
97
|
}
|
|
@@ -178,6 +176,71 @@ exports.isBooleanable = isBooleanable;
|
|
|
178
176
|
},{}],7:[function(require,module,exports){
|
|
179
177
|
|
|
180
178
|
},{}],8:[function(require,module,exports){
|
|
179
|
+
'use strict';
|
|
180
|
+
|
|
181
|
+
var bind = require('function-bind');
|
|
182
|
+
var $apply = require('./functionApply');
|
|
183
|
+
var $call = require('./functionCall');
|
|
184
|
+
var $reflectApply = require('./reflectApply');
|
|
185
|
+
|
|
186
|
+
/** @type {import('./actualApply')} */
|
|
187
|
+
module.exports = $reflectApply || bind.call($call, $apply);
|
|
188
|
+
|
|
189
|
+
},{"./functionApply":9,"./functionCall":10,"./reflectApply":12,"function-bind":27}],9:[function(require,module,exports){
|
|
190
|
+
'use strict';
|
|
191
|
+
|
|
192
|
+
/** @type {import('./functionApply')} */
|
|
193
|
+
module.exports = Function.prototype.apply;
|
|
194
|
+
|
|
195
|
+
},{}],10:[function(require,module,exports){
|
|
196
|
+
'use strict';
|
|
197
|
+
|
|
198
|
+
/** @type {import('./functionCall')} */
|
|
199
|
+
module.exports = Function.prototype.call;
|
|
200
|
+
|
|
201
|
+
},{}],11:[function(require,module,exports){
|
|
202
|
+
'use strict';
|
|
203
|
+
|
|
204
|
+
var bind = require('function-bind');
|
|
205
|
+
var $TypeError = require('es-errors/type');
|
|
206
|
+
var $call = require('./functionCall');
|
|
207
|
+
var $actualApply = require('./actualApply');
|
|
208
|
+
|
|
209
|
+
/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
|
|
210
|
+
module.exports = function callBindBasic(args) {
|
|
211
|
+
if (args.length < 1 || typeof args[0] !== 'function') {
|
|
212
|
+
throw new $TypeError('a function is required');
|
|
213
|
+
}
|
|
214
|
+
return $actualApply(bind, $call, args);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
},{"./actualApply":8,"./functionCall":10,"es-errors/type":22,"function-bind":27}],12:[function(require,module,exports){
|
|
218
|
+
'use strict';
|
|
219
|
+
|
|
220
|
+
/** @type {import('./reflectApply')} */
|
|
221
|
+
module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
|
|
222
|
+
|
|
223
|
+
},{}],13:[function(require,module,exports){
|
|
224
|
+
'use strict';
|
|
225
|
+
|
|
226
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
227
|
+
var callBindBasic = require('call-bind-apply-helpers');
|
|
228
|
+
|
|
229
|
+
/** @type {(thisArg: string, searchString: string, position?: number) => number} */
|
|
230
|
+
var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
|
|
231
|
+
|
|
232
|
+
/** @type {import('.')} */
|
|
233
|
+
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
|
234
|
+
/* eslint no-extra-parens: 0 */
|
|
235
|
+
|
|
236
|
+
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */GetIntrinsic(name, !!allowMissing);
|
|
237
|
+
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
238
|
+
return callBindBasic(/** @type {const} */[intrinsic]);
|
|
239
|
+
}
|
|
240
|
+
return intrinsic;
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
},{"call-bind-apply-helpers":11,"get-intrinsic":28}],14:[function(require,module,exports){
|
|
181
244
|
// Console-polyfill. MIT license.
|
|
182
245
|
// https://github.com/paulmillr/console-polyfill
|
|
183
246
|
// Make it safe to do console.log() always.
|
|
@@ -197,7 +260,98 @@ exports.isBooleanable = isBooleanable;
|
|
|
197
260
|
// Using `this` for web workers & supports Browserify / Webpack.
|
|
198
261
|
})(typeof window === 'undefined' ? this : window);
|
|
199
262
|
|
|
200
|
-
},{}],
|
|
263
|
+
},{}],15:[function(require,module,exports){
|
|
264
|
+
'use strict';
|
|
265
|
+
|
|
266
|
+
var callBind = require('call-bind-apply-helpers');
|
|
267
|
+
var gOPD = require('gopd');
|
|
268
|
+
var hasProtoAccessor;
|
|
269
|
+
try {
|
|
270
|
+
// eslint-disable-next-line no-extra-parens, no-proto
|
|
271
|
+
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */[].__proto__ === Array.prototype;
|
|
272
|
+
} catch (e) {
|
|
273
|
+
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
274
|
+
throw e;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// eslint-disable-next-line no-extra-parens
|
|
279
|
+
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */'__proto__');
|
|
280
|
+
var $Object = Object;
|
|
281
|
+
var $getPrototypeOf = $Object.getPrototypeOf;
|
|
282
|
+
|
|
283
|
+
/** @type {import('./get')} */
|
|
284
|
+
module.exports = desc && typeof desc.get === 'function' ? callBind([desc.get]) : typeof $getPrototypeOf === 'function' ? /** @type {import('./get')} */function getDunder(value) {
|
|
285
|
+
// eslint-disable-next-line eqeqeq
|
|
286
|
+
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
287
|
+
} : false;
|
|
288
|
+
|
|
289
|
+
},{"call-bind-apply-helpers":11,"gopd":35}],16:[function(require,module,exports){
|
|
290
|
+
'use strict';
|
|
291
|
+
|
|
292
|
+
/** @type {import('.')} */
|
|
293
|
+
var $defineProperty = Object.defineProperty || false;
|
|
294
|
+
if ($defineProperty) {
|
|
295
|
+
try {
|
|
296
|
+
$defineProperty({}, 'a', {
|
|
297
|
+
value: 1
|
|
298
|
+
});
|
|
299
|
+
} catch (e) {
|
|
300
|
+
// IE 8 has a broken defineProperty
|
|
301
|
+
$defineProperty = false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
module.exports = $defineProperty;
|
|
305
|
+
|
|
306
|
+
},{}],17:[function(require,module,exports){
|
|
307
|
+
'use strict';
|
|
308
|
+
|
|
309
|
+
/** @type {import('./eval')} */
|
|
310
|
+
module.exports = EvalError;
|
|
311
|
+
|
|
312
|
+
},{}],18:[function(require,module,exports){
|
|
313
|
+
'use strict';
|
|
314
|
+
|
|
315
|
+
/** @type {import('.')} */
|
|
316
|
+
module.exports = Error;
|
|
317
|
+
|
|
318
|
+
},{}],19:[function(require,module,exports){
|
|
319
|
+
'use strict';
|
|
320
|
+
|
|
321
|
+
/** @type {import('./range')} */
|
|
322
|
+
module.exports = RangeError;
|
|
323
|
+
|
|
324
|
+
},{}],20:[function(require,module,exports){
|
|
325
|
+
'use strict';
|
|
326
|
+
|
|
327
|
+
/** @type {import('./ref')} */
|
|
328
|
+
module.exports = ReferenceError;
|
|
329
|
+
|
|
330
|
+
},{}],21:[function(require,module,exports){
|
|
331
|
+
'use strict';
|
|
332
|
+
|
|
333
|
+
/** @type {import('./syntax')} */
|
|
334
|
+
module.exports = SyntaxError;
|
|
335
|
+
|
|
336
|
+
},{}],22:[function(require,module,exports){
|
|
337
|
+
'use strict';
|
|
338
|
+
|
|
339
|
+
/** @type {import('./type')} */
|
|
340
|
+
module.exports = TypeError;
|
|
341
|
+
|
|
342
|
+
},{}],23:[function(require,module,exports){
|
|
343
|
+
'use strict';
|
|
344
|
+
|
|
345
|
+
/** @type {import('./uri')} */
|
|
346
|
+
module.exports = URIError;
|
|
347
|
+
|
|
348
|
+
},{}],24:[function(require,module,exports){
|
|
349
|
+
'use strict';
|
|
350
|
+
|
|
351
|
+
/** @type {import('.')} */
|
|
352
|
+
module.exports = Object;
|
|
353
|
+
|
|
354
|
+
},{}],25:[function(require,module,exports){
|
|
201
355
|
// these are known as "placeholder tokens", see this link for more info:
|
|
202
356
|
// <https://nodejs.org/api/util.html#util_util_format_format_args>
|
|
203
357
|
//
|
|
@@ -207,7 +361,459 @@ exports.isBooleanable = isBooleanable;
|
|
|
207
361
|
// <https://github.com/nodejs/node/blob/7af1ad0ec15546761233c2e90008316551db2bbd/doc/api/util.md#utilformatformat-args>
|
|
208
362
|
module.exports = ['%s', '%d', '%i', '%f', '%j', '%o', '%O', '%%'];
|
|
209
363
|
|
|
210
|
-
},{}],
|
|
364
|
+
},{}],26:[function(require,module,exports){
|
|
365
|
+
'use strict';
|
|
366
|
+
|
|
367
|
+
/* eslint no-invalid-this: 1 */
|
|
368
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
369
|
+
var toStr = Object.prototype.toString;
|
|
370
|
+
var max = Math.max;
|
|
371
|
+
var funcType = '[object Function]';
|
|
372
|
+
var concatty = function concatty(a, b) {
|
|
373
|
+
var arr = [];
|
|
374
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
375
|
+
arr[i] = a[i];
|
|
376
|
+
}
|
|
377
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
378
|
+
arr[j + a.length] = b[j];
|
|
379
|
+
}
|
|
380
|
+
return arr;
|
|
381
|
+
};
|
|
382
|
+
var slicy = function slicy(arrLike, offset) {
|
|
383
|
+
var arr = [];
|
|
384
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
385
|
+
arr[j] = arrLike[i];
|
|
386
|
+
}
|
|
387
|
+
return arr;
|
|
388
|
+
};
|
|
389
|
+
var joiny = function (arr, joiner) {
|
|
390
|
+
var str = '';
|
|
391
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
392
|
+
str += arr[i];
|
|
393
|
+
if (i + 1 < arr.length) {
|
|
394
|
+
str += joiner;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return str;
|
|
398
|
+
};
|
|
399
|
+
module.exports = function bind(that) {
|
|
400
|
+
var target = this;
|
|
401
|
+
if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
|
|
402
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
403
|
+
}
|
|
404
|
+
var args = slicy(arguments, 1);
|
|
405
|
+
var bound;
|
|
406
|
+
var binder = function () {
|
|
407
|
+
if (this instanceof bound) {
|
|
408
|
+
var result = target.apply(this, concatty(args, arguments));
|
|
409
|
+
if (Object(result) === result) {
|
|
410
|
+
return result;
|
|
411
|
+
}
|
|
412
|
+
return this;
|
|
413
|
+
}
|
|
414
|
+
return target.apply(that, concatty(args, arguments));
|
|
415
|
+
};
|
|
416
|
+
var boundLength = max(0, target.length - args.length);
|
|
417
|
+
var boundArgs = [];
|
|
418
|
+
for (var i = 0; i < boundLength; i++) {
|
|
419
|
+
boundArgs[i] = '$' + i;
|
|
420
|
+
}
|
|
421
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
422
|
+
if (target.prototype) {
|
|
423
|
+
var Empty = function Empty() {};
|
|
424
|
+
Empty.prototype = target.prototype;
|
|
425
|
+
bound.prototype = new Empty();
|
|
426
|
+
Empty.prototype = null;
|
|
427
|
+
}
|
|
428
|
+
return bound;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
},{}],27:[function(require,module,exports){
|
|
432
|
+
'use strict';
|
|
433
|
+
|
|
434
|
+
var implementation = require('./implementation');
|
|
435
|
+
module.exports = Function.prototype.bind || implementation;
|
|
436
|
+
|
|
437
|
+
},{"./implementation":26}],28:[function(require,module,exports){
|
|
438
|
+
'use strict';
|
|
439
|
+
|
|
440
|
+
var undefined;
|
|
441
|
+
var $Object = require('es-object-atoms');
|
|
442
|
+
var $Error = require('es-errors');
|
|
443
|
+
var $EvalError = require('es-errors/eval');
|
|
444
|
+
var $RangeError = require('es-errors/range');
|
|
445
|
+
var $ReferenceError = require('es-errors/ref');
|
|
446
|
+
var $SyntaxError = require('es-errors/syntax');
|
|
447
|
+
var $TypeError = require('es-errors/type');
|
|
448
|
+
var $URIError = require('es-errors/uri');
|
|
449
|
+
var abs = require('math-intrinsics/abs');
|
|
450
|
+
var floor = require('math-intrinsics/floor');
|
|
451
|
+
var max = require('math-intrinsics/max');
|
|
452
|
+
var min = require('math-intrinsics/min');
|
|
453
|
+
var pow = require('math-intrinsics/pow');
|
|
454
|
+
var round = require('math-intrinsics/round');
|
|
455
|
+
var sign = require('math-intrinsics/sign');
|
|
456
|
+
var $Function = Function;
|
|
457
|
+
|
|
458
|
+
// eslint-disable-next-line consistent-return
|
|
459
|
+
var getEvalledConstructor = function (expressionSyntax) {
|
|
460
|
+
try {
|
|
461
|
+
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
462
|
+
} catch (e) {}
|
|
463
|
+
};
|
|
464
|
+
var $gOPD = require('gopd');
|
|
465
|
+
var $defineProperty = require('es-define-property');
|
|
466
|
+
var throwTypeError = function () {
|
|
467
|
+
throw new $TypeError();
|
|
468
|
+
};
|
|
469
|
+
var ThrowTypeError = $gOPD ? function () {
|
|
470
|
+
try {
|
|
471
|
+
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
472
|
+
arguments.callee; // IE 8 does not throw here
|
|
473
|
+
return throwTypeError;
|
|
474
|
+
} catch (calleeThrows) {
|
|
475
|
+
try {
|
|
476
|
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
477
|
+
return $gOPD(arguments, 'callee').get;
|
|
478
|
+
} catch (gOPDthrows) {
|
|
479
|
+
return throwTypeError;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}() : throwTypeError;
|
|
483
|
+
var hasSymbols = require('has-symbols')();
|
|
484
|
+
var getProto = require('get-proto');
|
|
485
|
+
var $ObjectGPO = require('get-proto/Object.getPrototypeOf');
|
|
486
|
+
var $ReflectGPO = require('get-proto/Reflect.getPrototypeOf');
|
|
487
|
+
var $apply = require('call-bind-apply-helpers/functionApply');
|
|
488
|
+
var $call = require('call-bind-apply-helpers/functionCall');
|
|
489
|
+
var needsEval = {};
|
|
490
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
491
|
+
var INTRINSICS = {
|
|
492
|
+
__proto__: null,
|
|
493
|
+
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
494
|
+
'%Array%': Array,
|
|
495
|
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
496
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
|
497
|
+
'%AsyncFromSyncIteratorPrototype%': undefined,
|
|
498
|
+
'%AsyncFunction%': needsEval,
|
|
499
|
+
'%AsyncGenerator%': needsEval,
|
|
500
|
+
'%AsyncGeneratorFunction%': needsEval,
|
|
501
|
+
'%AsyncIteratorPrototype%': needsEval,
|
|
502
|
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
|
503
|
+
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
|
504
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
|
|
505
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
|
|
506
|
+
'%Boolean%': Boolean,
|
|
507
|
+
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
|
508
|
+
'%Date%': Date,
|
|
509
|
+
'%decodeURI%': decodeURI,
|
|
510
|
+
'%decodeURIComponent%': decodeURIComponent,
|
|
511
|
+
'%encodeURI%': encodeURI,
|
|
512
|
+
'%encodeURIComponent%': encodeURIComponent,
|
|
513
|
+
'%Error%': $Error,
|
|
514
|
+
'%eval%': eval,
|
|
515
|
+
// eslint-disable-line no-eval
|
|
516
|
+
'%EvalError%': $EvalError,
|
|
517
|
+
'%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array,
|
|
518
|
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
|
519
|
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
|
520
|
+
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
|
521
|
+
'%Function%': $Function,
|
|
522
|
+
'%GeneratorFunction%': needsEval,
|
|
523
|
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
|
524
|
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
|
525
|
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
|
526
|
+
'%isFinite%': isFinite,
|
|
527
|
+
'%isNaN%': isNaN,
|
|
528
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
529
|
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
|
530
|
+
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
|
531
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
532
|
+
'%Math%': Math,
|
|
533
|
+
'%Number%': Number,
|
|
534
|
+
'%Object%': $Object,
|
|
535
|
+
'%Object.getOwnPropertyDescriptor%': $gOPD,
|
|
536
|
+
'%parseFloat%': parseFloat,
|
|
537
|
+
'%parseInt%': parseInt,
|
|
538
|
+
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
|
539
|
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
|
540
|
+
'%RangeError%': $RangeError,
|
|
541
|
+
'%ReferenceError%': $ReferenceError,
|
|
542
|
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
543
|
+
'%RegExp%': RegExp,
|
|
544
|
+
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
545
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
546
|
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
|
547
|
+
'%String%': String,
|
|
548
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
|
|
549
|
+
'%Symbol%': hasSymbols ? Symbol : undefined,
|
|
550
|
+
'%SyntaxError%': $SyntaxError,
|
|
551
|
+
'%ThrowTypeError%': ThrowTypeError,
|
|
552
|
+
'%TypedArray%': TypedArray,
|
|
553
|
+
'%TypeError%': $TypeError,
|
|
554
|
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
|
555
|
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
|
556
|
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
|
557
|
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
|
558
|
+
'%URIError%': $URIError,
|
|
559
|
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
|
560
|
+
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
|
561
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
|
|
562
|
+
'%Function.prototype.call%': $call,
|
|
563
|
+
'%Function.prototype.apply%': $apply,
|
|
564
|
+
'%Object.defineProperty%': $defineProperty,
|
|
565
|
+
'%Object.getPrototypeOf%': $ObjectGPO,
|
|
566
|
+
'%Math.abs%': abs,
|
|
567
|
+
'%Math.floor%': floor,
|
|
568
|
+
'%Math.max%': max,
|
|
569
|
+
'%Math.min%': min,
|
|
570
|
+
'%Math.pow%': pow,
|
|
571
|
+
'%Math.round%': round,
|
|
572
|
+
'%Math.sign%': sign,
|
|
573
|
+
'%Reflect.getPrototypeOf%': $ReflectGPO
|
|
574
|
+
};
|
|
575
|
+
if (getProto) {
|
|
576
|
+
try {
|
|
577
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
578
|
+
} catch (e) {
|
|
579
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
580
|
+
var errorProto = getProto(getProto(e));
|
|
581
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
var doEval = function doEval(name) {
|
|
585
|
+
var value;
|
|
586
|
+
if (name === '%AsyncFunction%') {
|
|
587
|
+
value = getEvalledConstructor('async function () {}');
|
|
588
|
+
} else if (name === '%GeneratorFunction%') {
|
|
589
|
+
value = getEvalledConstructor('function* () {}');
|
|
590
|
+
} else if (name === '%AsyncGeneratorFunction%') {
|
|
591
|
+
value = getEvalledConstructor('async function* () {}');
|
|
592
|
+
} else if (name === '%AsyncGenerator%') {
|
|
593
|
+
var fn = doEval('%AsyncGeneratorFunction%');
|
|
594
|
+
if (fn) {
|
|
595
|
+
value = fn.prototype;
|
|
596
|
+
}
|
|
597
|
+
} else if (name === '%AsyncIteratorPrototype%') {
|
|
598
|
+
var gen = doEval('%AsyncGenerator%');
|
|
599
|
+
if (gen && getProto) {
|
|
600
|
+
value = getProto(gen.prototype);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
INTRINSICS[name] = value;
|
|
604
|
+
return value;
|
|
605
|
+
};
|
|
606
|
+
var LEGACY_ALIASES = {
|
|
607
|
+
__proto__: null,
|
|
608
|
+
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
609
|
+
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
610
|
+
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
611
|
+
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
612
|
+
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
613
|
+
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
614
|
+
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
615
|
+
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
616
|
+
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
617
|
+
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
618
|
+
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
619
|
+
'%DatePrototype%': ['Date', 'prototype'],
|
|
620
|
+
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
621
|
+
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
622
|
+
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
623
|
+
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
624
|
+
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
625
|
+
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
626
|
+
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
627
|
+
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
628
|
+
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
629
|
+
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
630
|
+
'%JSONParse%': ['JSON', 'parse'],
|
|
631
|
+
'%JSONStringify%': ['JSON', 'stringify'],
|
|
632
|
+
'%MapPrototype%': ['Map', 'prototype'],
|
|
633
|
+
'%NumberPrototype%': ['Number', 'prototype'],
|
|
634
|
+
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
635
|
+
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
636
|
+
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
637
|
+
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
638
|
+
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
639
|
+
'%Promise_all%': ['Promise', 'all'],
|
|
640
|
+
'%Promise_reject%': ['Promise', 'reject'],
|
|
641
|
+
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
642
|
+
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
643
|
+
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
644
|
+
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
645
|
+
'%SetPrototype%': ['Set', 'prototype'],
|
|
646
|
+
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
647
|
+
'%StringPrototype%': ['String', 'prototype'],
|
|
648
|
+
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
649
|
+
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
650
|
+
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
651
|
+
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
652
|
+
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
653
|
+
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
654
|
+
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
655
|
+
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
656
|
+
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
657
|
+
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
658
|
+
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
659
|
+
};
|
|
660
|
+
var bind = require('function-bind');
|
|
661
|
+
var hasOwn = require('hasown');
|
|
662
|
+
var $concat = bind.call($call, Array.prototype.concat);
|
|
663
|
+
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
664
|
+
var $replace = bind.call($call, String.prototype.replace);
|
|
665
|
+
var $strSlice = bind.call($call, String.prototype.slice);
|
|
666
|
+
var $exec = bind.call($call, RegExp.prototype.exec);
|
|
667
|
+
|
|
668
|
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
669
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
670
|
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
671
|
+
var stringToPath = function stringToPath(string) {
|
|
672
|
+
var first = $strSlice(string, 0, 1);
|
|
673
|
+
var last = $strSlice(string, -1);
|
|
674
|
+
if (first === '%' && last !== '%') {
|
|
675
|
+
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
|
676
|
+
} else if (last === '%' && first !== '%') {
|
|
677
|
+
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
|
678
|
+
}
|
|
679
|
+
var result = [];
|
|
680
|
+
$replace(string, rePropName, function (match, number, quote, subString) {
|
|
681
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
|
682
|
+
});
|
|
683
|
+
return result;
|
|
684
|
+
};
|
|
685
|
+
/* end adaptation */
|
|
686
|
+
|
|
687
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
688
|
+
var intrinsicName = name;
|
|
689
|
+
var alias;
|
|
690
|
+
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
|
691
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
692
|
+
intrinsicName = '%' + alias[0] + '%';
|
|
693
|
+
}
|
|
694
|
+
if (hasOwn(INTRINSICS, intrinsicName)) {
|
|
695
|
+
var value = INTRINSICS[intrinsicName];
|
|
696
|
+
if (value === needsEval) {
|
|
697
|
+
value = doEval(intrinsicName);
|
|
698
|
+
}
|
|
699
|
+
if (typeof value === 'undefined' && !allowMissing) {
|
|
700
|
+
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
701
|
+
}
|
|
702
|
+
return {
|
|
703
|
+
alias: alias,
|
|
704
|
+
name: intrinsicName,
|
|
705
|
+
value: value
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
|
709
|
+
};
|
|
710
|
+
module.exports = function GetIntrinsic(name, allowMissing) {
|
|
711
|
+
if (typeof name !== 'string' || name.length === 0) {
|
|
712
|
+
throw new $TypeError('intrinsic name must be a non-empty string');
|
|
713
|
+
}
|
|
714
|
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
715
|
+
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
716
|
+
}
|
|
717
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
718
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
719
|
+
}
|
|
720
|
+
var parts = stringToPath(name);
|
|
721
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
722
|
+
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
723
|
+
var intrinsicRealName = intrinsic.name;
|
|
724
|
+
var value = intrinsic.value;
|
|
725
|
+
var skipFurtherCaching = false;
|
|
726
|
+
var alias = intrinsic.alias;
|
|
727
|
+
if (alias) {
|
|
728
|
+
intrinsicBaseName = alias[0];
|
|
729
|
+
$spliceApply(parts, $concat([0, 1], alias));
|
|
730
|
+
}
|
|
731
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
732
|
+
var part = parts[i];
|
|
733
|
+
var first = $strSlice(part, 0, 1);
|
|
734
|
+
var last = $strSlice(part, -1);
|
|
735
|
+
if ((first === '"' || first === "'" || first === '`' || last === '"' || last === "'" || last === '`') && first !== last) {
|
|
736
|
+
throw new $SyntaxError('property names with quotes must have matching quotes');
|
|
737
|
+
}
|
|
738
|
+
if (part === 'constructor' || !isOwn) {
|
|
739
|
+
skipFurtherCaching = true;
|
|
740
|
+
}
|
|
741
|
+
intrinsicBaseName += '.' + part;
|
|
742
|
+
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
743
|
+
if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
|
744
|
+
value = INTRINSICS[intrinsicRealName];
|
|
745
|
+
} else if (value != null) {
|
|
746
|
+
if (!(part in value)) {
|
|
747
|
+
if (!allowMissing) {
|
|
748
|
+
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
749
|
+
}
|
|
750
|
+
return void undefined;
|
|
751
|
+
}
|
|
752
|
+
if ($gOPD && i + 1 >= parts.length) {
|
|
753
|
+
var desc = $gOPD(value, part);
|
|
754
|
+
isOwn = !!desc;
|
|
755
|
+
|
|
756
|
+
// By convention, when a data property is converted to an accessor
|
|
757
|
+
// property to emulate a data property that does not suffer from
|
|
758
|
+
// the override mistake, that accessor's getter is marked with
|
|
759
|
+
// an `originalValue` property. Here, when we detect this, we
|
|
760
|
+
// uphold the illusion by pretending to see that original data
|
|
761
|
+
// property, i.e., returning the value rather than the getter
|
|
762
|
+
// itself.
|
|
763
|
+
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
764
|
+
value = desc.get;
|
|
765
|
+
} else {
|
|
766
|
+
value = value[part];
|
|
767
|
+
}
|
|
768
|
+
} else {
|
|
769
|
+
isOwn = hasOwn(value, part);
|
|
770
|
+
value = value[part];
|
|
771
|
+
}
|
|
772
|
+
if (isOwn && !skipFurtherCaching) {
|
|
773
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
return value;
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
},{"call-bind-apply-helpers/functionApply":9,"call-bind-apply-helpers/functionCall":10,"es-define-property":16,"es-errors":18,"es-errors/eval":17,"es-errors/range":19,"es-errors/ref":20,"es-errors/syntax":21,"es-errors/type":22,"es-errors/uri":23,"es-object-atoms":24,"function-bind":27,"get-proto":31,"get-proto/Object.getPrototypeOf":29,"get-proto/Reflect.getPrototypeOf":30,"gopd":35,"has-symbols":36,"hasown":41,"math-intrinsics/abs":49,"math-intrinsics/floor":50,"math-intrinsics/max":52,"math-intrinsics/min":53,"math-intrinsics/pow":54,"math-intrinsics/round":55,"math-intrinsics/sign":56}],29:[function(require,module,exports){
|
|
781
|
+
'use strict';
|
|
782
|
+
|
|
783
|
+
var $Object = require('es-object-atoms');
|
|
784
|
+
|
|
785
|
+
/** @type {import('./Object.getPrototypeOf')} */
|
|
786
|
+
module.exports = $Object.getPrototypeOf || null;
|
|
787
|
+
|
|
788
|
+
},{"es-object-atoms":24}],30:[function(require,module,exports){
|
|
789
|
+
'use strict';
|
|
790
|
+
|
|
791
|
+
/** @type {import('./Reflect.getPrototypeOf')} */
|
|
792
|
+
module.exports = typeof Reflect !== 'undefined' && Reflect.getPrototypeOf || null;
|
|
793
|
+
|
|
794
|
+
},{}],31:[function(require,module,exports){
|
|
795
|
+
'use strict';
|
|
796
|
+
|
|
797
|
+
var reflectGetProto = require('./Reflect.getPrototypeOf');
|
|
798
|
+
var originalGetProto = require('./Object.getPrototypeOf');
|
|
799
|
+
var getDunderProto = require('dunder-proto/get');
|
|
800
|
+
|
|
801
|
+
/** @type {import('.')} */
|
|
802
|
+
module.exports = reflectGetProto ? function getProto(O) {
|
|
803
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
804
|
+
return reflectGetProto(O);
|
|
805
|
+
} : originalGetProto ? function getProto(O) {
|
|
806
|
+
if (!O || typeof O !== 'object' && typeof O !== 'function') {
|
|
807
|
+
throw new TypeError('getProto: not an object');
|
|
808
|
+
}
|
|
809
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
810
|
+
return originalGetProto(O);
|
|
811
|
+
} : getDunderProto ? function getProto(O) {
|
|
812
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
813
|
+
return getDunderProto(O);
|
|
814
|
+
} : null;
|
|
815
|
+
|
|
816
|
+
},{"./Object.getPrototypeOf":29,"./Reflect.getPrototypeOf":30,"dunder-proto/get":15}],32:[function(require,module,exports){
|
|
211
817
|
/*!
|
|
212
818
|
* get-value <https://github.com/jonschlinkert/get-value>
|
|
213
819
|
*
|
|
@@ -300,7 +906,7 @@ function isValidObject(val) {
|
|
|
300
906
|
return isObject(val) || Array.isArray(val) || typeof val === 'function';
|
|
301
907
|
}
|
|
302
908
|
|
|
303
|
-
},{"isobject":
|
|
909
|
+
},{"isobject":33}],33:[function(require,module,exports){
|
|
304
910
|
/*!
|
|
305
911
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
306
912
|
*
|
|
@@ -314,11 +920,34 @@ module.exports = function isObject(val) {
|
|
|
314
920
|
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
|
315
921
|
};
|
|
316
922
|
|
|
317
|
-
},{}],
|
|
923
|
+
},{}],34:[function(require,module,exports){
|
|
924
|
+
'use strict';
|
|
925
|
+
|
|
926
|
+
/** @type {import('./gOPD')} */
|
|
927
|
+
module.exports = Object.getOwnPropertyDescriptor;
|
|
928
|
+
|
|
929
|
+
},{}],35:[function(require,module,exports){
|
|
930
|
+
'use strict';
|
|
931
|
+
|
|
932
|
+
/** @type {import('.')} */
|
|
933
|
+
var $gOPD = require('./gOPD');
|
|
934
|
+
if ($gOPD) {
|
|
935
|
+
try {
|
|
936
|
+
$gOPD([], 'length');
|
|
937
|
+
} catch (e) {
|
|
938
|
+
// IE 8 has a broken gOPD
|
|
939
|
+
$gOPD = null;
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
module.exports = $gOPD;
|
|
943
|
+
|
|
944
|
+
},{"./gOPD":34}],36:[function(require,module,exports){
|
|
318
945
|
'use strict';
|
|
319
946
|
|
|
320
947
|
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
321
948
|
var hasSymbolSham = require('./shams');
|
|
949
|
+
|
|
950
|
+
/** @type {import('.')} */
|
|
322
951
|
module.exports = function hasNativeSymbols() {
|
|
323
952
|
if (typeof origSymbol !== 'function') {
|
|
324
953
|
return false;
|
|
@@ -335,9 +964,10 @@ module.exports = function hasNativeSymbols() {
|
|
|
335
964
|
return hasSymbolSham();
|
|
336
965
|
};
|
|
337
966
|
|
|
338
|
-
},{"./shams":
|
|
967
|
+
},{"./shams":37}],37:[function(require,module,exports){
|
|
339
968
|
'use strict';
|
|
340
969
|
|
|
970
|
+
/** @type {import('./shams')} */
|
|
341
971
|
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
342
972
|
module.exports = function hasSymbols() {
|
|
343
973
|
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') {
|
|
@@ -346,6 +976,8 @@ module.exports = function hasSymbols() {
|
|
|
346
976
|
if (typeof Symbol.iterator === 'symbol') {
|
|
347
977
|
return true;
|
|
348
978
|
}
|
|
979
|
+
|
|
980
|
+
/** @type {{ [k in symbol]?: unknown }} */
|
|
349
981
|
var obj = {};
|
|
350
982
|
var sym = Symbol('test');
|
|
351
983
|
var symObj = Object(sym);
|
|
@@ -369,7 +1001,7 @@ module.exports = function hasSymbols() {
|
|
|
369
1001
|
|
|
370
1002
|
var symVal = 42;
|
|
371
1003
|
obj[sym] = symVal;
|
|
372
|
-
for (
|
|
1004
|
+
for (var _ in obj) {
|
|
373
1005
|
return false;
|
|
374
1006
|
} // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
375
1007
|
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) {
|
|
@@ -386,7 +1018,8 @@ module.exports = function hasSymbols() {
|
|
|
386
1018
|
return false;
|
|
387
1019
|
}
|
|
388
1020
|
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
389
|
-
|
|
1021
|
+
// eslint-disable-next-line no-extra-parens
|
|
1022
|
+
var descriptor = /** @type {PropertyDescriptor} */Object.getOwnPropertyDescriptor(obj, sym);
|
|
390
1023
|
if (descriptor.value !== symVal || descriptor.enumerable !== true) {
|
|
391
1024
|
return false;
|
|
392
1025
|
}
|
|
@@ -394,7 +1027,17 @@ module.exports = function hasSymbols() {
|
|
|
394
1027
|
return true;
|
|
395
1028
|
};
|
|
396
1029
|
|
|
397
|
-
},{}],
|
|
1030
|
+
},{}],38:[function(require,module,exports){
|
|
1031
|
+
'use strict';
|
|
1032
|
+
|
|
1033
|
+
var hasSymbols = require('has-symbols/shams');
|
|
1034
|
+
|
|
1035
|
+
/** @type {import('.')} */
|
|
1036
|
+
module.exports = function hasToStringTagShams() {
|
|
1037
|
+
return hasSymbols() && !!Symbol.toStringTag;
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
},{"has-symbols/shams":37}],39:[function(require,module,exports){
|
|
398
1041
|
/*!
|
|
399
1042
|
* has-value <https://github.com/jonschlinkert/has-value>
|
|
400
1043
|
*
|
|
@@ -416,7 +1059,7 @@ function isObject(val) {
|
|
|
416
1059
|
return val != null && (typeof val === 'object' || typeof val === 'function' || Array.isArray(val));
|
|
417
1060
|
}
|
|
418
1061
|
|
|
419
|
-
},{"get-value":
|
|
1062
|
+
},{"get-value":32,"has-values":40}],40:[function(require,module,exports){
|
|
420
1063
|
/*!
|
|
421
1064
|
* has-values <https://github.com/jonschlinkert/has-values>
|
|
422
1065
|
*
|
|
@@ -467,7 +1110,17 @@ module.exports = function has(val) {
|
|
|
467
1110
|
}
|
|
468
1111
|
};
|
|
469
1112
|
|
|
470
|
-
},{"kind-of":
|
|
1113
|
+
},{"kind-of":48}],41:[function(require,module,exports){
|
|
1114
|
+
'use strict';
|
|
1115
|
+
|
|
1116
|
+
var call = Function.prototype.call;
|
|
1117
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
1118
|
+
var bind = require('function-bind');
|
|
1119
|
+
|
|
1120
|
+
/** @type {import('.')} */
|
|
1121
|
+
module.exports = bind.call(call, $hasOwn);
|
|
1122
|
+
|
|
1123
|
+
},{"function-bind":27}],42:[function(require,module,exports){
|
|
471
1124
|
/*!
|
|
472
1125
|
* Determine if an object is a Buffer
|
|
473
1126
|
*
|
|
@@ -479,7 +1132,7 @@ module.exports = function isBuffer(obj) {
|
|
|
479
1132
|
return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
|
|
480
1133
|
};
|
|
481
1134
|
|
|
482
|
-
},{}],
|
|
1135
|
+
},{}],43:[function(require,module,exports){
|
|
483
1136
|
'use strict';
|
|
484
1137
|
|
|
485
1138
|
module.exports = value => {
|
|
@@ -490,25 +1143,96 @@ module.exports = value => {
|
|
|
490
1143
|
return prototype === null || prototype === Object.prototype;
|
|
491
1144
|
};
|
|
492
1145
|
|
|
493
|
-
},{}],
|
|
1146
|
+
},{}],44:[function(require,module,exports){
|
|
494
1147
|
'use strict';
|
|
495
1148
|
|
|
496
|
-
var
|
|
1149
|
+
var callBound = require('call-bound');
|
|
1150
|
+
var hasToStringTag = require('has-tostringtag/shams')();
|
|
1151
|
+
var hasOwn = require('hasown');
|
|
1152
|
+
var gOPD = require('gopd');
|
|
1153
|
+
|
|
1154
|
+
/** @type {import('.')} */
|
|
1155
|
+
var fn;
|
|
1156
|
+
if (hasToStringTag) {
|
|
1157
|
+
/** @type {(receiver: ThisParameterType<typeof RegExp.prototype.exec>, ...args: Parameters<typeof RegExp.prototype.exec>) => ReturnType<typeof RegExp.prototype.exec>} */
|
|
1158
|
+
var $exec = callBound('RegExp.prototype.exec');
|
|
1159
|
+
/** @type {object} */
|
|
1160
|
+
var isRegexMarker = {};
|
|
1161
|
+
var throwRegexMarker = function () {
|
|
1162
|
+
throw isRegexMarker;
|
|
1163
|
+
};
|
|
1164
|
+
/** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */
|
|
1165
|
+
var badStringifier = {
|
|
1166
|
+
toString: throwRegexMarker,
|
|
1167
|
+
valueOf: throwRegexMarker
|
|
1168
|
+
};
|
|
1169
|
+
if (typeof Symbol.toPrimitive === 'symbol') {
|
|
1170
|
+
badStringifier[Symbol.toPrimitive] = throwRegexMarker;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/** @type {import('.')} */
|
|
1174
|
+
// @ts-expect-error TS can't figure out that the $exec call always throws
|
|
1175
|
+
// eslint-disable-next-line consistent-return
|
|
1176
|
+
fn = function isRegex(value) {
|
|
1177
|
+
if (!value || typeof value !== 'object') {
|
|
1178
|
+
return false;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
// eslint-disable-next-line no-extra-parens
|
|
1182
|
+
var descriptor = /** @type {NonNullable<typeof gOPD>} */gOPD(/** @type {{ lastIndex?: unknown }} */value, 'lastIndex');
|
|
1183
|
+
var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value');
|
|
1184
|
+
if (!hasLastIndexDataProperty) {
|
|
1185
|
+
return false;
|
|
1186
|
+
}
|
|
1187
|
+
try {
|
|
1188
|
+
// eslint-disable-next-line no-extra-parens
|
|
1189
|
+
$exec(value, /** @type {string} */ /** @type {unknown} */badStringifier);
|
|
1190
|
+
} catch (e) {
|
|
1191
|
+
return e === isRegexMarker;
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
} else {
|
|
1195
|
+
/** @type {(receiver: ThisParameterType<typeof Object.prototype.toString>, ...args: Parameters<typeof Object.prototype.toString>) => ReturnType<typeof Object.prototype.toString>} */
|
|
1196
|
+
var $toString = callBound('Object.prototype.toString');
|
|
1197
|
+
/** @const @type {'[object RegExp]'} */
|
|
1198
|
+
var regexClass = '[object RegExp]';
|
|
1199
|
+
|
|
1200
|
+
/** @type {import('.')} */
|
|
1201
|
+
fn = function isRegex(value) {
|
|
1202
|
+
// In older browsers, typeof regex incorrectly returns 'function'
|
|
1203
|
+
if (!value || typeof value !== 'object' && typeof value !== 'function') {
|
|
1204
|
+
return false;
|
|
1205
|
+
}
|
|
1206
|
+
return $toString(value) === regexClass;
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
module.exports = fn;
|
|
1210
|
+
|
|
1211
|
+
},{"call-bound":13,"gopd":35,"has-tostringtag/shams":38,"hasown":41}],45:[function(require,module,exports){
|
|
1212
|
+
'use strict';
|
|
1213
|
+
|
|
1214
|
+
var callBound = require('call-bound');
|
|
1215
|
+
var $toString = callBound('Object.prototype.toString');
|
|
497
1216
|
var hasSymbols = require('has-symbols')();
|
|
1217
|
+
var safeRegexTest = require('safe-regex-test');
|
|
498
1218
|
if (hasSymbols) {
|
|
499
|
-
var symToStr = Symbol.prototype.toString;
|
|
500
|
-
var
|
|
1219
|
+
var $symToStr = callBound('Symbol.prototype.toString');
|
|
1220
|
+
var isSymString = safeRegexTest(/^Symbol\(.*\)$/);
|
|
1221
|
+
|
|
1222
|
+
/** @type {(value: object) => value is Symbol} */
|
|
501
1223
|
var isSymbolObject = function isRealSymbolObject(value) {
|
|
502
1224
|
if (typeof value.valueOf() !== 'symbol') {
|
|
503
1225
|
return false;
|
|
504
1226
|
}
|
|
505
|
-
return
|
|
1227
|
+
return isSymString($symToStr(value));
|
|
506
1228
|
};
|
|
1229
|
+
|
|
1230
|
+
/** @type {import('.')} */
|
|
507
1231
|
module.exports = function isSymbol(value) {
|
|
508
1232
|
if (typeof value === 'symbol') {
|
|
509
1233
|
return true;
|
|
510
1234
|
}
|
|
511
|
-
if (
|
|
1235
|
+
if (!value || typeof value !== 'object' || $toString(value) !== '[object Symbol]') {
|
|
512
1236
|
return false;
|
|
513
1237
|
}
|
|
514
1238
|
try {
|
|
@@ -518,13 +1242,14 @@ if (hasSymbols) {
|
|
|
518
1242
|
}
|
|
519
1243
|
};
|
|
520
1244
|
} else {
|
|
1245
|
+
/** @type {import('.')} */
|
|
521
1246
|
module.exports = function isSymbol(value) {
|
|
522
1247
|
// this environment does not support Symbols.
|
|
523
1248
|
return false && value;
|
|
524
1249
|
};
|
|
525
1250
|
}
|
|
526
1251
|
|
|
527
|
-
},{"has-symbols":
|
|
1252
|
+
},{"call-bound":13,"has-symbols":36,"safe-regex-test":62}],46:[function(require,module,exports){
|
|
528
1253
|
/**
|
|
529
1254
|
* Expose `isError`.
|
|
530
1255
|
*/
|
|
@@ -551,7 +1276,7 @@ function isError(value) {
|
|
|
551
1276
|
}
|
|
552
1277
|
}
|
|
553
1278
|
|
|
554
|
-
},{}],
|
|
1279
|
+
},{}],47:[function(require,module,exports){
|
|
555
1280
|
'use strict';
|
|
556
1281
|
|
|
557
1282
|
/*!
|
|
@@ -565,7 +1290,7 @@ function isObject(val) {
|
|
|
565
1290
|
}
|
|
566
1291
|
module.exports = isObject;
|
|
567
1292
|
|
|
568
|
-
},{}],
|
|
1293
|
+
},{}],48:[function(require,module,exports){
|
|
569
1294
|
var toString = Object.prototype.toString;
|
|
570
1295
|
module.exports = function kindOf(val) {
|
|
571
1296
|
if (val === void 0) return 'undefined';
|
|
@@ -696,7 +1421,64 @@ function isBuffer(val) {
|
|
|
696
1421
|
return false;
|
|
697
1422
|
}
|
|
698
1423
|
|
|
699
|
-
},{}],
|
|
1424
|
+
},{}],49:[function(require,module,exports){
|
|
1425
|
+
'use strict';
|
|
1426
|
+
|
|
1427
|
+
/** @type {import('./abs')} */
|
|
1428
|
+
module.exports = Math.abs;
|
|
1429
|
+
|
|
1430
|
+
},{}],50:[function(require,module,exports){
|
|
1431
|
+
'use strict';
|
|
1432
|
+
|
|
1433
|
+
/** @type {import('./floor')} */
|
|
1434
|
+
module.exports = Math.floor;
|
|
1435
|
+
|
|
1436
|
+
},{}],51:[function(require,module,exports){
|
|
1437
|
+
'use strict';
|
|
1438
|
+
|
|
1439
|
+
/** @type {import('./isNaN')} */
|
|
1440
|
+
module.exports = Number.isNaN || function isNaN(a) {
|
|
1441
|
+
return a !== a;
|
|
1442
|
+
};
|
|
1443
|
+
|
|
1444
|
+
},{}],52:[function(require,module,exports){
|
|
1445
|
+
'use strict';
|
|
1446
|
+
|
|
1447
|
+
/** @type {import('./max')} */
|
|
1448
|
+
module.exports = Math.max;
|
|
1449
|
+
|
|
1450
|
+
},{}],53:[function(require,module,exports){
|
|
1451
|
+
'use strict';
|
|
1452
|
+
|
|
1453
|
+
/** @type {import('./min')} */
|
|
1454
|
+
module.exports = Math.min;
|
|
1455
|
+
|
|
1456
|
+
},{}],54:[function(require,module,exports){
|
|
1457
|
+
'use strict';
|
|
1458
|
+
|
|
1459
|
+
/** @type {import('./pow')} */
|
|
1460
|
+
module.exports = Math.pow;
|
|
1461
|
+
|
|
1462
|
+
},{}],55:[function(require,module,exports){
|
|
1463
|
+
'use strict';
|
|
1464
|
+
|
|
1465
|
+
/** @type {import('./round')} */
|
|
1466
|
+
module.exports = Math.round;
|
|
1467
|
+
|
|
1468
|
+
},{}],56:[function(require,module,exports){
|
|
1469
|
+
'use strict';
|
|
1470
|
+
|
|
1471
|
+
var $isNaN = require('./isNaN');
|
|
1472
|
+
|
|
1473
|
+
/** @type {import('./sign')} */
|
|
1474
|
+
module.exports = function sign(number) {
|
|
1475
|
+
if ($isNaN(number) || number === 0) {
|
|
1476
|
+
return number;
|
|
1477
|
+
}
|
|
1478
|
+
return number < 0 ? -1 : +1;
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
},{"./isNaN":51}],57:[function(require,module,exports){
|
|
700
1482
|
'use strict';
|
|
701
1483
|
|
|
702
1484
|
const isOptionObject = require('is-plain-obj');
|
|
@@ -832,14 +1614,11 @@ function merge(merged, source, config) {
|
|
|
832
1614
|
}
|
|
833
1615
|
return mergeKeys(merged, source, getEnumerableOwnPropertyKeys(source), config);
|
|
834
1616
|
}
|
|
835
|
-
module.exports = function () {
|
|
1617
|
+
module.exports = function (...options) {
|
|
836
1618
|
const config = merge(clone(defaultMergeOptions), this !== globalThis && this || {}, defaultMergeOptions);
|
|
837
1619
|
let merged = {
|
|
838
1620
|
_: {}
|
|
839
1621
|
};
|
|
840
|
-
for (var _len = arguments.length, options = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
841
|
-
options[_key] = arguments[_key];
|
|
842
|
-
}
|
|
843
1622
|
for (const option of options) {
|
|
844
1623
|
if (option === undefined) {
|
|
845
1624
|
continue;
|
|
@@ -854,7 +1633,7 @@ module.exports = function () {
|
|
|
854
1633
|
return merged._;
|
|
855
1634
|
};
|
|
856
1635
|
|
|
857
|
-
},{"is-plain-obj":
|
|
1636
|
+
},{"is-plain-obj":43}],58:[function(require,module,exports){
|
|
858
1637
|
exports.endianness = function () {
|
|
859
1638
|
return 'LE';
|
|
860
1639
|
};
|
|
@@ -904,23 +1683,7 @@ exports.homedir = function () {
|
|
|
904
1683
|
return '/';
|
|
905
1684
|
};
|
|
906
1685
|
|
|
907
|
-
},{}],
|
|
908
|
-
'use strict';
|
|
909
|
-
|
|
910
|
-
const pMapSeries = async (iterable, mapper) => {
|
|
911
|
-
const result = [];
|
|
912
|
-
let index = 0;
|
|
913
|
-
for (const value of iterable) {
|
|
914
|
-
// eslint-disable-next-line no-await-in-loop
|
|
915
|
-
result.push(await mapper(await value, index++));
|
|
916
|
-
}
|
|
917
|
-
return result;
|
|
918
|
-
};
|
|
919
|
-
module.exports = pMapSeries;
|
|
920
|
-
// TODO: Remove this for the next major release
|
|
921
|
-
module.exports.default = pMapSeries;
|
|
922
|
-
|
|
923
|
-
},{}],25:[function(require,module,exports){
|
|
1686
|
+
},{}],59:[function(require,module,exports){
|
|
924
1687
|
"use strict";
|
|
925
1688
|
|
|
926
1689
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
@@ -1038,7 +1801,7 @@ const parseErr = function parseErr(err) {
|
|
|
1038
1801
|
};
|
|
1039
1802
|
module.exports = parseErr;
|
|
1040
1803
|
|
|
1041
|
-
},{"iserror":
|
|
1804
|
+
},{"iserror":46}],60:[function(require,module,exports){
|
|
1042
1805
|
'use strict';
|
|
1043
1806
|
|
|
1044
1807
|
const get = require('@strikeentco/get');
|
|
@@ -1056,8 +1819,7 @@ const pick = (obj, paths, length, sep) => {
|
|
|
1056
1819
|
}
|
|
1057
1820
|
return picked;
|
|
1058
1821
|
};
|
|
1059
|
-
module.exports =
|
|
1060
|
-
let sep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
1822
|
+
module.exports = (obj, paths, sep = '.') => {
|
|
1061
1823
|
if (!isObject(obj) || !paths || !(Array.isArray(paths) || typeof paths === 'string')) {
|
|
1062
1824
|
return {};
|
|
1063
1825
|
}
|
|
@@ -1072,7 +1834,7 @@ module.exports = function (obj, paths) {
|
|
|
1072
1834
|
return pick(obj, paths, length, sep);
|
|
1073
1835
|
};
|
|
1074
1836
|
|
|
1075
|
-
},{"@strikeentco/get":2,"@strikeentco/set":3}],
|
|
1837
|
+
},{"@strikeentco/get":2,"@strikeentco/set":3}],61:[function(require,module,exports){
|
|
1076
1838
|
// shim for using process in browser
|
|
1077
1839
|
var process = module.exports = {};
|
|
1078
1840
|
|
|
@@ -1249,7 +2011,25 @@ process.umask = function () {
|
|
|
1249
2011
|
return 0;
|
|
1250
2012
|
};
|
|
1251
2013
|
|
|
1252
|
-
},{}],
|
|
2014
|
+
},{}],62:[function(require,module,exports){
|
|
2015
|
+
'use strict';
|
|
2016
|
+
|
|
2017
|
+
var callBound = require('call-bound');
|
|
2018
|
+
var isRegex = require('is-regex');
|
|
2019
|
+
var $exec = callBound('RegExp.prototype.exec');
|
|
2020
|
+
var $TypeError = require('es-errors/type');
|
|
2021
|
+
|
|
2022
|
+
/** @type {import('.')} */
|
|
2023
|
+
module.exports = function regexTester(regex) {
|
|
2024
|
+
if (!isRegex(regex)) {
|
|
2025
|
+
throw new $TypeError('`regex` must be a RegExp');
|
|
2026
|
+
}
|
|
2027
|
+
return function test(s) {
|
|
2028
|
+
return $exec(regex, s) !== null;
|
|
2029
|
+
};
|
|
2030
|
+
};
|
|
2031
|
+
|
|
2032
|
+
},{"call-bound":13,"es-errors/type":22,"is-regex":44}],63:[function(require,module,exports){
|
|
1253
2033
|
/*!
|
|
1254
2034
|
* unset-value <https://github.com/jonschlinkert/unset-value>
|
|
1255
2035
|
*
|
|
@@ -1294,11 +2074,11 @@ module.exports = function unset(obj, prop) {
|
|
|
1294
2074
|
return true;
|
|
1295
2075
|
};
|
|
1296
2076
|
|
|
1297
|
-
},{"has-value":
|
|
2077
|
+
},{"has-value":39,"isobject":47}],64:[function(require,module,exports){
|
|
1298
2078
|
module.exports={
|
|
1299
2079
|
"name": "axe",
|
|
1300
2080
|
"description": "Axe is a logger-agnostic wrapper that normalizes logs regardless of argument style. Great for large development teams, old and new projects, and works with Pino, Bunyan, Winston, console, and more. It is lightweight, performant, highly-configurable, and automatically adds OS, CPU, and Git information to your logs. It supports hooks (useful for masking sensitive data) and dot-notation remapping, omitting, and picking of log metadata properties. Made for Forward Email, Lad, and Cabin.",
|
|
1301
|
-
"version": "
|
|
2081
|
+
"version": "14.0.0",
|
|
1302
2082
|
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com)",
|
|
1303
2083
|
"browser": {
|
|
1304
2084
|
"parse-app-info": false
|
|
@@ -1320,50 +2100,50 @@ module.exports={
|
|
|
1320
2100
|
"console-polyfill": "0.3.0",
|
|
1321
2101
|
"format-specifiers": "^1.0.0",
|
|
1322
2102
|
"is-buffer": "^2.0.5",
|
|
1323
|
-
"is-symbol": "^1.
|
|
2103
|
+
"is-symbol": "^1.1.1",
|
|
1324
2104
|
"iserror": "0.0.2",
|
|
1325
2105
|
"merge-options": "3.0.4",
|
|
1326
|
-
"p-map-series": "2",
|
|
1327
2106
|
"parse-app-info": "^6.0.0",
|
|
1328
2107
|
"parse-err": "^1.0.0",
|
|
1329
2108
|
"pick-deep": "1.0.0",
|
|
1330
2109
|
"unset-value": "2.0.1"
|
|
1331
2110
|
},
|
|
1332
2111
|
"devDependencies": {
|
|
1333
|
-
"@babel/cli": "^7.
|
|
1334
|
-
"@babel/core": "^7.
|
|
1335
|
-
"@babel/preset-env": "^7.
|
|
1336
|
-
"@commitlint/cli": "^19.
|
|
1337
|
-
"@commitlint/config-conventional": "^19.
|
|
2112
|
+
"@babel/cli": "^7.29.7",
|
|
2113
|
+
"@babel/core": "^7.29.7",
|
|
2114
|
+
"@babel/preset-env": "^7.29.7",
|
|
2115
|
+
"@commitlint/cli": "^19.8.1",
|
|
2116
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
1338
2117
|
"ava": "5.3.1",
|
|
1339
2118
|
"babelify": "^10.0.0",
|
|
1340
|
-
"browserify": "^17.0.
|
|
1341
|
-
"consola": "^3.2
|
|
2119
|
+
"browserify": "^17.0.1",
|
|
2120
|
+
"consola": "^3.4.2",
|
|
1342
2121
|
"cross-env": "^7.0.3",
|
|
1343
|
-
"eslint": "8.
|
|
2122
|
+
"eslint": "8.57.1",
|
|
1344
2123
|
"eslint-config-xo-lass": "^2.0.1",
|
|
1345
|
-
"eslint-plugin-compat": "
|
|
2124
|
+
"eslint-plugin-compat": "6.0.0",
|
|
1346
2125
|
"eslint-plugin-node": "^11.1.0",
|
|
1347
|
-
"express": "^
|
|
2126
|
+
"express": "^5.2.1",
|
|
1348
2127
|
"fixpack": "^4.0.0",
|
|
1349
|
-
"husky": "^9.
|
|
1350
|
-
"jsdom": "
|
|
1351
|
-
"koa": "^2.
|
|
1352
|
-
"lint-staged": "^15.2
|
|
1353
|
-
"lodash": "^4.
|
|
2128
|
+
"husky": "^9.1.7",
|
|
2129
|
+
"jsdom": "26",
|
|
2130
|
+
"koa": "^3.2.1",
|
|
2131
|
+
"lint-staged": "^15.5.2",
|
|
2132
|
+
"lodash": "^4.18.1",
|
|
1354
2133
|
"nyc": "^17.1.0",
|
|
1355
|
-
"pino": "
|
|
2134
|
+
"pino": "10.1.0",
|
|
1356
2135
|
"remark-cli": "11.0.0",
|
|
1357
2136
|
"remark-preset-github": "^4.0.4",
|
|
1358
|
-
"rimraf": "^5.0.
|
|
2137
|
+
"rimraf": "^5.0.10",
|
|
1359
2138
|
"signale": "^1.4.0",
|
|
1360
|
-
"sinon": "^
|
|
2139
|
+
"sinon": "^22.1.0",
|
|
1361
2140
|
"tinyify": "3.0.0",
|
|
1362
|
-
"tsd": "^0.
|
|
1363
|
-
"
|
|
2141
|
+
"tsd": "^0.33.0",
|
|
2142
|
+
"typescript": "5.9.3",
|
|
2143
|
+
"xo": "0.60.0"
|
|
1364
2144
|
},
|
|
1365
2145
|
"engines": {
|
|
1366
|
-
"node": ">=
|
|
2146
|
+
"node": ">=18.18"
|
|
1367
2147
|
},
|
|
1368
2148
|
"files": [
|
|
1369
2149
|
"lib",
|
|
@@ -1425,7 +2205,7 @@ module.exports={
|
|
|
1425
2205
|
"lint-build": "npm run lint-lib && npm run lint-dist",
|
|
1426
2206
|
"lint-dist": "eslint --no-inline-config -c .dist.eslintrc.json dist",
|
|
1427
2207
|
"lint-lib": "eslint --no-inline-config -c .lib.eslintrc.json lib",
|
|
1428
|
-
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/axe.min.js -s Axe -g [ babelify --configFile ./.dist.babelrc.json ] -p tinyify",
|
|
2208
|
+
"minify": "cross-env NODE_ENV=production browserify src/index.js -o dist/axe.min.js -s Axe -g [ babelify --configFile ./.dist.babelrc.json ] -p [ tinyify --no-flat ]",
|
|
1429
2209
|
"nyc": "cross-env NODE_ENV=test nyc ava",
|
|
1430
2210
|
"prepare": "husky install",
|
|
1431
2211
|
"pretest": "npm run lint",
|
|
@@ -1435,7 +2215,7 @@ module.exports={
|
|
|
1435
2215
|
"unpkg": "dist/axe.min.js"
|
|
1436
2216
|
}
|
|
1437
2217
|
|
|
1438
|
-
},{}],
|
|
2218
|
+
},{}],65:[function(require,module,exports){
|
|
1439
2219
|
(function (process){(function (){
|
|
1440
2220
|
// eslint-disable-next-line import/no-unassigned-import
|
|
1441
2221
|
require('console-polyfill');
|
|
@@ -1449,7 +2229,6 @@ const isError = require('iserror');
|
|
|
1449
2229
|
const isSymbol = require('is-symbol');
|
|
1450
2230
|
const isBuffer = require('is-buffer');
|
|
1451
2231
|
const mergeOptions = require('merge-options');
|
|
1452
|
-
const pMapSeries = require('p-map-series');
|
|
1453
2232
|
const parseAppInfo = require('parse-app-info');
|
|
1454
2233
|
const parseErr = require('parse-err');
|
|
1455
2234
|
const pickDeep = require('pick-deep');
|
|
@@ -1468,6 +2247,30 @@ const aliases = {
|
|
|
1468
2247
|
};
|
|
1469
2248
|
const levelError = `\`level\` invalid, must be: ${levels.join(', ')}`;
|
|
1470
2249
|
const name = process.env.NODE_ENV === 'development' ? false : process.env.HOSTNAME || os.hostname();
|
|
2250
|
+
async function mapSeries(iterable, mapper) {
|
|
2251
|
+
const values = [...iterable];
|
|
2252
|
+
const results = [];
|
|
2253
|
+
async function map(index) {
|
|
2254
|
+
if (index === values.length) return results;
|
|
2255
|
+
results.push(await mapper(values[index]));
|
|
2256
|
+
return map(index + 1);
|
|
2257
|
+
}
|
|
2258
|
+
return map(0);
|
|
2259
|
+
}
|
|
2260
|
+
async function runPostHooks({
|
|
2261
|
+
hooks,
|
|
2262
|
+
method,
|
|
2263
|
+
err,
|
|
2264
|
+
message,
|
|
2265
|
+
meta,
|
|
2266
|
+
logger
|
|
2267
|
+
}) {
|
|
2268
|
+
try {
|
|
2269
|
+
return await mapSeries(hooks, hook => hook(method, err, message, meta));
|
|
2270
|
+
} catch (err_) {
|
|
2271
|
+
logger.error(err_);
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
1471
2274
|
|
|
1472
2275
|
// <https://github.com/sindresorhus/is-plain-obj/blob/main/index.js>
|
|
1473
2276
|
function isPlainObject(value) {
|
|
@@ -1525,9 +2328,7 @@ function getFunction(value) {
|
|
|
1525
2328
|
}
|
|
1526
2329
|
class Axe {
|
|
1527
2330
|
// eslint-disable-next-line complexity
|
|
1528
|
-
constructor() {
|
|
1529
|
-
var _this = this;
|
|
1530
|
-
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2331
|
+
constructor(config = {}) {
|
|
1531
2332
|
const remappedFields = {};
|
|
1532
2333
|
if (process.env.AXE_REMAPPED_META_FIELDS) {
|
|
1533
2334
|
const fields = process.env.AXE_REMAPPED_META_FIELDS;
|
|
@@ -1591,12 +2392,7 @@ class Axe {
|
|
|
1591
2392
|
}
|
|
1592
2393
|
|
|
1593
2394
|
// Bind log handler which normalizes args and populates meta
|
|
1594
|
-
this[element] =
|
|
1595
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1596
|
-
args[_key] = arguments[_key];
|
|
1597
|
-
}
|
|
1598
|
-
return _this.log(element, ...Array.prototype.slice.call(args));
|
|
1599
|
-
};
|
|
2395
|
+
this[element] = (...args) => this.log(element, ...Array.prototype.slice.call(args));
|
|
1600
2396
|
}
|
|
1601
2397
|
this.setLevel = this.setLevel.bind(this);
|
|
1602
2398
|
this.getNormalizedLevel = this.getNormalizedLevel.bind(this);
|
|
@@ -1614,19 +2410,13 @@ class Axe {
|
|
|
1614
2410
|
|
|
1615
2411
|
// Pre and Post Hooks
|
|
1616
2412
|
this.pre = function (level, fn) {
|
|
1617
|
-
this.config.hooks.pre.push(function (_level) {
|
|
1618
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1619
|
-
args[_key2 - 1] = arguments[_key2];
|
|
1620
|
-
}
|
|
2413
|
+
this.config.hooks.pre.push(function (_level, ...args) {
|
|
1621
2414
|
if (level !== _level) return [...args];
|
|
1622
2415
|
return fn(...args);
|
|
1623
2416
|
});
|
|
1624
2417
|
};
|
|
1625
2418
|
this.post = function (level, fn) {
|
|
1626
|
-
this.config.hooks.post.push(function (_level) {
|
|
1627
|
-
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
1628
|
-
args[_key3 - 1] = arguments[_key3];
|
|
1629
|
-
}
|
|
2419
|
+
this.config.hooks.post.push(function (_level, ...args) {
|
|
1630
2420
|
if (level !== _level) return [...args];
|
|
1631
2421
|
return fn(...args);
|
|
1632
2422
|
});
|
|
@@ -1653,7 +2443,7 @@ class Axe {
|
|
|
1653
2443
|
}
|
|
1654
2444
|
|
|
1655
2445
|
// eslint-disable-next-line complexity
|
|
1656
|
-
log(level, message, meta) {
|
|
2446
|
+
log(level, message, meta, ...args) {
|
|
1657
2447
|
const originalArgs = [];
|
|
1658
2448
|
const errors = [];
|
|
1659
2449
|
let hasMessage = false;
|
|
@@ -1661,9 +2451,6 @@ class Axe {
|
|
|
1661
2451
|
if (!isUndefined(level)) originalArgs.push(level);
|
|
1662
2452
|
if (!isUndefined(message)) originalArgs.push(message);
|
|
1663
2453
|
if (!isUndefined(meta)) originalArgs.push(meta);
|
|
1664
|
-
for (var _len4 = arguments.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) {
|
|
1665
|
-
args[_key4 - 3] = arguments[_key4];
|
|
1666
|
-
}
|
|
1667
2454
|
for (const arg of Array.prototype.slice.call(args)) {
|
|
1668
2455
|
originalArgs.push(arg);
|
|
1669
2456
|
}
|
|
@@ -1719,7 +2506,7 @@ class Axe {
|
|
|
1719
2506
|
hasMessage = true;
|
|
1720
2507
|
}
|
|
1721
2508
|
if (errors.length > 0 && level === 'log') level = 'error';
|
|
1722
|
-
} else if (!isBunyan && originalArgs.length === 3 + modifier && isString(message) && formatSpecifiers.some(t => message.indexOf(t) !== -1)) {
|
|
2509
|
+
} else if (!isBunyan && originalArgs.length === 3 + modifier && isString(message) && !(meta && meta.is_http) && formatSpecifiers.some(t => message.indexOf(t) !== -1)) {
|
|
1723
2510
|
// Otherwise if there are three args and if the `message` contains
|
|
1724
2511
|
// a placeholder token (e.g. '%s' or '%d' - see above `formatSpecifiers` variable)
|
|
1725
2512
|
// then we can infer that the `meta` arg passed is used for formatting
|
|
@@ -1967,13 +2754,18 @@ class Axe {
|
|
|
1967
2754
|
message,
|
|
1968
2755
|
meta
|
|
1969
2756
|
};
|
|
1970
|
-
return
|
|
1971
|
-
this.config.
|
|
2757
|
+
return runPostHooks({
|
|
2758
|
+
hooks: this.config.hooks.post,
|
|
2759
|
+
method,
|
|
2760
|
+
err,
|
|
2761
|
+
message,
|
|
2762
|
+
meta,
|
|
2763
|
+
logger: this.config.logger
|
|
1972
2764
|
});
|
|
1973
2765
|
}
|
|
1974
2766
|
}
|
|
1975
2767
|
module.exports = Axe;
|
|
1976
2768
|
|
|
1977
2769
|
}).call(this)}).call(this,require('_process'))
|
|
1978
|
-
},{"../package.json":
|
|
2770
|
+
},{"../package.json":64,"@ladjs/format-util":1,"@strikeentco/get":2,"@strikeentco/set":3,"_process":61,"boolean":5,"console-polyfill":14,"format-specifiers":25,"is-buffer":42,"is-symbol":45,"iserror":46,"merge-options":57,"os":58,"parse-app-info":7,"parse-err":59,"pick-deep":60,"unset-value":63}]},{},[65])(65)
|
|
1979
2771
|
});
|