@swagger-api/apidom-json-pointer-relative 0.76.0 → 0.76.1

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.
@@ -367,6 +367,16 @@ const parse = relativePointer => {
367
367
  };
368
368
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
369
369
 
370
+ /***/ }),
371
+
372
+ /***/ 60042:
373
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
374
+
375
+ var parent = __webpack_require__(35846);
376
+
377
+ module.exports = parent;
378
+
379
+
370
380
  /***/ }),
371
381
 
372
382
  /***/ 28385:
@@ -441,6 +451,21 @@ var parent = __webpack_require__(16042);
441
451
  module.exports = parent;
442
452
 
443
453
 
454
+ /***/ }),
455
+
456
+ /***/ 56791:
457
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
458
+
459
+ __webpack_require__(4339);
460
+ __webpack_require__(4242);
461
+ __webpack_require__(84016);
462
+ __webpack_require__(98939);
463
+ __webpack_require__(5454);
464
+ var path = __webpack_require__(57545);
465
+
466
+ module.exports = path.AggregateError;
467
+
468
+
444
469
  /***/ }),
445
470
 
446
471
  /***/ 92089:
@@ -563,6 +588,27 @@ var WrappedWellKnownSymbolModule = __webpack_require__(89207);
563
588
  module.exports = WrappedWellKnownSymbolModule.f('toPrimitive');
564
589
 
565
590
 
591
+ /***/ }),
592
+
593
+ /***/ 36762:
594
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
595
+
596
+ module.exports = __webpack_require__(73028);
597
+
598
+
599
+ /***/ }),
600
+
601
+ /***/ 73028:
602
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
603
+
604
+ // TODO: remove from `core-js@4`
605
+ __webpack_require__(12752);
606
+
607
+ var parent = __webpack_require__(60042);
608
+
609
+ module.exports = parent;
610
+
611
+
566
612
  /***/ }),
567
613
 
568
614
  /***/ 32747:
@@ -992,6 +1038,29 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
992
1038
  };
993
1039
 
994
1040
 
1041
+ /***/ }),
1042
+
1043
+ /***/ 97987:
1044
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1045
+
1046
+ var hasOwn = __webpack_require__(64500);
1047
+ var ownKeys = __webpack_require__(93011);
1048
+ var getOwnPropertyDescriptorModule = __webpack_require__(5141);
1049
+ var definePropertyModule = __webpack_require__(42760);
1050
+
1051
+ module.exports = function (target, source, exceptions) {
1052
+ var keys = ownKeys(source);
1053
+ var defineProperty = definePropertyModule.f;
1054
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1055
+ for (var i = 0; i < keys.length; i++) {
1056
+ var key = keys[i];
1057
+ if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
1058
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1059
+ }
1060
+ }
1061
+ };
1062
+
1063
+
995
1064
  /***/ }),
996
1065
 
997
1066
  /***/ 4635:
@@ -1289,6 +1358,65 @@ module.exports = [
1289
1358
  ];
1290
1359
 
1291
1360
 
1361
+ /***/ }),
1362
+
1363
+ /***/ 14503:
1364
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1365
+
1366
+ var uncurryThis = __webpack_require__(84120);
1367
+
1368
+ var $Error = Error;
1369
+ var replace = uncurryThis(''.replace);
1370
+
1371
+ var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
1372
+ // eslint-disable-next-line redos/no-vulnerable -- safe
1373
+ var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
1374
+ var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
1375
+
1376
+ module.exports = function (stack, dropEntries) {
1377
+ if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
1378
+ while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
1379
+ } return stack;
1380
+ };
1381
+
1382
+
1383
+ /***/ }),
1384
+
1385
+ /***/ 58266:
1386
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1387
+
1388
+ var createNonEnumerableProperty = __webpack_require__(98711);
1389
+ var clearErrorStack = __webpack_require__(14503);
1390
+ var ERROR_STACK_INSTALLABLE = __webpack_require__(50274);
1391
+
1392
+ // non-standard V8
1393
+ var captureStackTrace = Error.captureStackTrace;
1394
+
1395
+ module.exports = function (error, C, stack, dropEntries) {
1396
+ if (ERROR_STACK_INSTALLABLE) {
1397
+ if (captureStackTrace) captureStackTrace(error, C);
1398
+ else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));
1399
+ }
1400
+ };
1401
+
1402
+
1403
+ /***/ }),
1404
+
1405
+ /***/ 50274:
1406
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1407
+
1408
+ var fails = __webpack_require__(76192);
1409
+ var createPropertyDescriptor = __webpack_require__(90774);
1410
+
1411
+ module.exports = !fails(function () {
1412
+ var error = Error('a');
1413
+ if (!('stack' in error)) return true;
1414
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1415
+ Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
1416
+ return error.stack !== 7;
1417
+ });
1418
+
1419
+
1292
1420
  /***/ }),
1293
1421
 
1294
1422
  /***/ 93085:
@@ -1572,6 +1700,46 @@ module.exports = function (namespace, method) {
1572
1700
  };
1573
1701
 
1574
1702
 
1703
+ /***/ }),
1704
+
1705
+ /***/ 78703:
1706
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1707
+
1708
+ var classof = __webpack_require__(4696);
1709
+ var getMethod = __webpack_require__(75037);
1710
+ var isNullOrUndefined = __webpack_require__(75646);
1711
+ var Iterators = __webpack_require__(82621);
1712
+ var wellKnownSymbol = __webpack_require__(18182);
1713
+
1714
+ var ITERATOR = wellKnownSymbol('iterator');
1715
+
1716
+ module.exports = function (it) {
1717
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
1718
+ || getMethod(it, '@@iterator')
1719
+ || Iterators[classof(it)];
1720
+ };
1721
+
1722
+
1723
+ /***/ }),
1724
+
1725
+ /***/ 61669:
1726
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1727
+
1728
+ var call = __webpack_require__(18922);
1729
+ var aCallable = __webpack_require__(66235);
1730
+ var anObject = __webpack_require__(31138);
1731
+ var tryToString = __webpack_require__(79288);
1732
+ var getIteratorMethod = __webpack_require__(78703);
1733
+
1734
+ var $TypeError = TypeError;
1735
+
1736
+ module.exports = function (argument, usingIterator) {
1737
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1738
+ if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
1739
+ throw $TypeError(tryToString(argument) + ' is not iterable');
1740
+ };
1741
+
1742
+
1575
1743
  /***/ }),
1576
1744
 
1577
1745
  /***/ 19202:
@@ -1721,6 +1889,31 @@ module.exports = fails(function () {
1721
1889
  } : $Object;
1722
1890
 
1723
1891
 
1892
+ /***/ }),
1893
+
1894
+ /***/ 62643:
1895
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1896
+
1897
+ var isCallable = __webpack_require__(16447);
1898
+ var isObject = __webpack_require__(35744);
1899
+ var setPrototypeOf = __webpack_require__(24469);
1900
+
1901
+ // makes subclassing work correct for wrapped built-ins
1902
+ module.exports = function ($this, dummy, Wrapper) {
1903
+ var NewTarget, NewTargetPrototype;
1904
+ if (
1905
+ // it can work only with native `setPrototypeOf`
1906
+ setPrototypeOf &&
1907
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1908
+ isCallable(NewTarget = dummy.constructor) &&
1909
+ NewTarget !== Wrapper &&
1910
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
1911
+ NewTargetPrototype !== Wrapper.prototype
1912
+ ) setPrototypeOf($this, NewTargetPrototype);
1913
+ return $this;
1914
+ };
1915
+
1916
+
1724
1917
  /***/ }),
1725
1918
 
1726
1919
  /***/ 19516:
@@ -1742,6 +1935,23 @@ if (!isCallable(store.inspectSource)) {
1742
1935
  module.exports = store.inspectSource;
1743
1936
 
1744
1937
 
1938
+ /***/ }),
1939
+
1940
+ /***/ 10273:
1941
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1942
+
1943
+ var isObject = __webpack_require__(35744);
1944
+ var createNonEnumerableProperty = __webpack_require__(98711);
1945
+
1946
+ // `InstallErrorCause` abstract operation
1947
+ // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
1948
+ module.exports = function (O, options) {
1949
+ if (isObject(options) && 'cause' in options) {
1950
+ createNonEnumerableProperty(O, 'cause', options.cause);
1951
+ }
1952
+ };
1953
+
1954
+
1745
1955
  /***/ }),
1746
1956
 
1747
1957
  /***/ 73326:
@@ -1819,6 +2029,23 @@ module.exports = {
1819
2029
  };
1820
2030
 
1821
2031
 
2032
+ /***/ }),
2033
+
2034
+ /***/ 96109:
2035
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2036
+
2037
+ var wellKnownSymbol = __webpack_require__(18182);
2038
+ var Iterators = __webpack_require__(82621);
2039
+
2040
+ var ITERATOR = wellKnownSymbol('iterator');
2041
+ var ArrayPrototype = Array.prototype;
2042
+
2043
+ // check on default Array iterator
2044
+ module.exports = function (it) {
2045
+ return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
2046
+ };
2047
+
2048
+
1822
2049
  /***/ }),
1823
2050
 
1824
2051
  /***/ 34770:
@@ -1997,6 +2224,111 @@ module.exports = USE_SYMBOL_AS_UID ? function (it) {
1997
2224
  };
1998
2225
 
1999
2226
 
2227
+ /***/ }),
2228
+
2229
+ /***/ 33442:
2230
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2231
+
2232
+ var bind = __webpack_require__(8043);
2233
+ var call = __webpack_require__(18922);
2234
+ var anObject = __webpack_require__(31138);
2235
+ var tryToString = __webpack_require__(79288);
2236
+ var isArrayIteratorMethod = __webpack_require__(96109);
2237
+ var lengthOfArrayLike = __webpack_require__(84104);
2238
+ var isPrototypeOf = __webpack_require__(8902);
2239
+ var getIterator = __webpack_require__(61669);
2240
+ var getIteratorMethod = __webpack_require__(78703);
2241
+ var iteratorClose = __webpack_require__(66639);
2242
+
2243
+ var $TypeError = TypeError;
2244
+
2245
+ var Result = function (stopped, result) {
2246
+ this.stopped = stopped;
2247
+ this.result = result;
2248
+ };
2249
+
2250
+ var ResultPrototype = Result.prototype;
2251
+
2252
+ module.exports = function (iterable, unboundFunction, options) {
2253
+ var that = options && options.that;
2254
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2255
+ var IS_RECORD = !!(options && options.IS_RECORD);
2256
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2257
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2258
+ var fn = bind(unboundFunction, that);
2259
+ var iterator, iterFn, index, length, result, next, step;
2260
+
2261
+ var stop = function (condition) {
2262
+ if (iterator) iteratorClose(iterator, 'normal', condition);
2263
+ return new Result(true, condition);
2264
+ };
2265
+
2266
+ var callFn = function (value) {
2267
+ if (AS_ENTRIES) {
2268
+ anObject(value);
2269
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2270
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2271
+ };
2272
+
2273
+ if (IS_RECORD) {
2274
+ iterator = iterable.iterator;
2275
+ } else if (IS_ITERATOR) {
2276
+ iterator = iterable;
2277
+ } else {
2278
+ iterFn = getIteratorMethod(iterable);
2279
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2280
+ // optimisation for array iterators
2281
+ if (isArrayIteratorMethod(iterFn)) {
2282
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2283
+ result = callFn(iterable[index]);
2284
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2285
+ } return new Result(false);
2286
+ }
2287
+ iterator = getIterator(iterable, iterFn);
2288
+ }
2289
+
2290
+ next = IS_RECORD ? iterable.next : iterator.next;
2291
+ while (!(step = call(next, iterator)).done) {
2292
+ try {
2293
+ result = callFn(step.value);
2294
+ } catch (error) {
2295
+ iteratorClose(iterator, 'throw', error);
2296
+ }
2297
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2298
+ } return new Result(false);
2299
+ };
2300
+
2301
+
2302
+ /***/ }),
2303
+
2304
+ /***/ 66639:
2305
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2306
+
2307
+ var call = __webpack_require__(18922);
2308
+ var anObject = __webpack_require__(31138);
2309
+ var getMethod = __webpack_require__(75037);
2310
+
2311
+ module.exports = function (iterator, kind, value) {
2312
+ var innerResult, innerError;
2313
+ anObject(iterator);
2314
+ try {
2315
+ innerResult = getMethod(iterator, 'return');
2316
+ if (!innerResult) {
2317
+ if (kind === 'throw') throw value;
2318
+ return value;
2319
+ }
2320
+ innerResult = call(innerResult, iterator);
2321
+ } catch (error) {
2322
+ innerError = true;
2323
+ innerResult = error;
2324
+ }
2325
+ if (kind === 'throw') throw value;
2326
+ if (innerError) throw innerResult;
2327
+ anObject(innerResult);
2328
+ return value;
2329
+ };
2330
+
2331
+
2000
2332
  /***/ }),
2001
2333
 
2002
2334
  /***/ 25695:
@@ -2224,6 +2556,18 @@ module.exports = Math.trunc || function trunc(x) {
2224
2556
  };
2225
2557
 
2226
2558
 
2559
+ /***/ }),
2560
+
2561
+ /***/ 36016:
2562
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2563
+
2564
+ var toString = __webpack_require__(44845);
2565
+
2566
+ module.exports = function (argument, $default) {
2567
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
2568
+ };
2569
+
2570
+
2227
2571
  /***/ }),
2228
2572
 
2229
2573
  /***/ 52853:
@@ -2652,6 +2996,27 @@ module.exports = function (input, pref) {
2652
2996
  };
2653
2997
 
2654
2998
 
2999
+ /***/ }),
3000
+
3001
+ /***/ 93011:
3002
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3003
+
3004
+ var getBuiltIn = __webpack_require__(10150);
3005
+ var uncurryThis = __webpack_require__(84120);
3006
+ var getOwnPropertyNamesModule = __webpack_require__(92092);
3007
+ var getOwnPropertySymbolsModule = __webpack_require__(84750);
3008
+ var anObject = __webpack_require__(31138);
3009
+
3010
+ var concat = uncurryThis([].concat);
3011
+
3012
+ // all object keys, includes non-enumerable and symbols
3013
+ module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
3014
+ var keys = getOwnPropertyNamesModule.f(anObject(it));
3015
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
3016
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
3017
+ };
3018
+
3019
+
2655
3020
  /***/ }),
2656
3021
 
2657
3022
  /***/ 57545:
@@ -2660,6 +3025,22 @@ module.exports = function (input, pref) {
2660
3025
  module.exports = {};
2661
3026
 
2662
3027
 
3028
+ /***/ }),
3029
+
3030
+ /***/ 67656:
3031
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3032
+
3033
+ var defineProperty = (__webpack_require__(42760).f);
3034
+
3035
+ module.exports = function (Target, Source, key) {
3036
+ key in Target || defineProperty(Target, key, {
3037
+ configurable: true,
3038
+ get: function () { return Source[key]; },
3039
+ set: function (it) { Source[key] = it; }
3040
+ });
3041
+ };
3042
+
3043
+
2663
3044
  /***/ }),
2664
3045
 
2665
3046
  /***/ 13209:
@@ -3210,6 +3591,176 @@ module.exports = function (name) {
3210
3591
  };
3211
3592
 
3212
3593
 
3594
+ /***/ }),
3595
+
3596
+ /***/ 20426:
3597
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3598
+
3599
+ "use strict";
3600
+
3601
+ var getBuiltIn = __webpack_require__(10150);
3602
+ var hasOwn = __webpack_require__(64500);
3603
+ var createNonEnumerableProperty = __webpack_require__(98711);
3604
+ var isPrototypeOf = __webpack_require__(8902);
3605
+ var setPrototypeOf = __webpack_require__(24469);
3606
+ var copyConstructorProperties = __webpack_require__(97987);
3607
+ var proxyAccessor = __webpack_require__(67656);
3608
+ var inheritIfRequired = __webpack_require__(62643);
3609
+ var normalizeStringArgument = __webpack_require__(36016);
3610
+ var installErrorCause = __webpack_require__(10273);
3611
+ var installErrorStack = __webpack_require__(58266);
3612
+ var DESCRIPTORS = __webpack_require__(50069);
3613
+ var IS_PURE = __webpack_require__(85546);
3614
+
3615
+ module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
3616
+ var STACK_TRACE_LIMIT = 'stackTraceLimit';
3617
+ var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
3618
+ var path = FULL_NAME.split('.');
3619
+ var ERROR_NAME = path[path.length - 1];
3620
+ var OriginalError = getBuiltIn.apply(null, path);
3621
+
3622
+ if (!OriginalError) return;
3623
+
3624
+ var OriginalErrorPrototype = OriginalError.prototype;
3625
+
3626
+ // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
3627
+ if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
3628
+
3629
+ if (!FORCED) return OriginalError;
3630
+
3631
+ var BaseError = getBuiltIn('Error');
3632
+
3633
+ var WrappedError = wrapper(function (a, b) {
3634
+ var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
3635
+ var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
3636
+ if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
3637
+ installErrorStack(result, WrappedError, result.stack, 2);
3638
+ if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
3639
+ if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
3640
+ return result;
3641
+ });
3642
+
3643
+ WrappedError.prototype = OriginalErrorPrototype;
3644
+
3645
+ if (ERROR_NAME !== 'Error') {
3646
+ if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
3647
+ else copyConstructorProperties(WrappedError, BaseError, { name: true });
3648
+ } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
3649
+ proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
3650
+ proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
3651
+ }
3652
+
3653
+ copyConstructorProperties(WrappedError, OriginalError);
3654
+
3655
+ if (!IS_PURE) try {
3656
+ // Safari 13- bug: WebAssembly errors does not have a proper `.name`
3657
+ if (OriginalErrorPrototype.name !== ERROR_NAME) {
3658
+ createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
3659
+ }
3660
+ OriginalErrorPrototype.constructor = WrappedError;
3661
+ } catch (error) { /* empty */ }
3662
+
3663
+ return WrappedError;
3664
+ };
3665
+
3666
+
3667
+ /***/ }),
3668
+
3669
+ /***/ 84016:
3670
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3671
+
3672
+ var $ = __webpack_require__(93085);
3673
+ var getBuiltIn = __webpack_require__(10150);
3674
+ var apply = __webpack_require__(86298);
3675
+ var fails = __webpack_require__(76192);
3676
+ var wrapErrorConstructorWithCause = __webpack_require__(20426);
3677
+
3678
+ var AGGREGATE_ERROR = 'AggregateError';
3679
+ var $AggregateError = getBuiltIn(AGGREGATE_ERROR);
3680
+
3681
+ var FORCED = !fails(function () {
3682
+ return $AggregateError([1]).errors[0] !== 1;
3683
+ }) && fails(function () {
3684
+ return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7;
3685
+ });
3686
+
3687
+ // https://tc39.es/ecma262/#sec-aggregate-error
3688
+ $({ global: true, constructor: true, arity: 2, forced: FORCED }, {
3689
+ AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
3690
+ // eslint-disable-next-line no-unused-vars -- required for functions `.length`
3691
+ return function AggregateError(errors, message) { return apply(init, this, arguments); };
3692
+ }, FORCED, true)
3693
+ });
3694
+
3695
+
3696
+ /***/ }),
3697
+
3698
+ /***/ 93820:
3699
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3700
+
3701
+ "use strict";
3702
+
3703
+ var $ = __webpack_require__(93085);
3704
+ var isPrototypeOf = __webpack_require__(8902);
3705
+ var getPrototypeOf = __webpack_require__(89341);
3706
+ var setPrototypeOf = __webpack_require__(24469);
3707
+ var copyConstructorProperties = __webpack_require__(97987);
3708
+ var create = __webpack_require__(52853);
3709
+ var createNonEnumerableProperty = __webpack_require__(98711);
3710
+ var createPropertyDescriptor = __webpack_require__(90774);
3711
+ var installErrorCause = __webpack_require__(10273);
3712
+ var installErrorStack = __webpack_require__(58266);
3713
+ var iterate = __webpack_require__(33442);
3714
+ var normalizeStringArgument = __webpack_require__(36016);
3715
+ var wellKnownSymbol = __webpack_require__(18182);
3716
+
3717
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
3718
+ var $Error = Error;
3719
+ var push = [].push;
3720
+
3721
+ var $AggregateError = function AggregateError(errors, message /* , options */) {
3722
+ var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
3723
+ var that;
3724
+ if (setPrototypeOf) {
3725
+ that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
3726
+ } else {
3727
+ that = isInstance ? this : create(AggregateErrorPrototype);
3728
+ createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
3729
+ }
3730
+ if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
3731
+ installErrorStack(that, $AggregateError, that.stack, 1);
3732
+ if (arguments.length > 2) installErrorCause(that, arguments[2]);
3733
+ var errorsArray = [];
3734
+ iterate(errors, push, { that: errorsArray });
3735
+ createNonEnumerableProperty(that, 'errors', errorsArray);
3736
+ return that;
3737
+ };
3738
+
3739
+ if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
3740
+ else copyConstructorProperties($AggregateError, $Error, { name: true });
3741
+
3742
+ var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
3743
+ constructor: createPropertyDescriptor(1, $AggregateError),
3744
+ message: createPropertyDescriptor(1, ''),
3745
+ name: createPropertyDescriptor(1, 'AggregateError')
3746
+ });
3747
+
3748
+ // `AggregateError` constructor
3749
+ // https://tc39.es/ecma262/#sec-aggregate-error-constructor
3750
+ $({ global: true, constructor: true, arity: 2 }, {
3751
+ AggregateError: $AggregateError
3752
+ });
3753
+
3754
+
3755
+ /***/ }),
3756
+
3757
+ /***/ 4242:
3758
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3759
+
3760
+ // TODO: Remove this module from `core-js@4` since it's replaced to module below
3761
+ __webpack_require__(93820);
3762
+
3763
+
3213
3764
  /***/ }),
3214
3765
 
3215
3766
  /***/ 59106:
@@ -3385,6 +3936,69 @@ if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
3385
3936
  // empty
3386
3937
 
3387
3938
 
3939
+ /***/ }),
3940
+
3941
+ /***/ 4339:
3942
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3943
+
3944
+ /* eslint-disable no-unused-vars -- required for functions `.length` */
3945
+ var $ = __webpack_require__(93085);
3946
+ var global = __webpack_require__(98576);
3947
+ var apply = __webpack_require__(86298);
3948
+ var wrapErrorConstructorWithCause = __webpack_require__(20426);
3949
+
3950
+ var WEB_ASSEMBLY = 'WebAssembly';
3951
+ var WebAssembly = global[WEB_ASSEMBLY];
3952
+
3953
+ var FORCED = Error('e', { cause: 7 }).cause !== 7;
3954
+
3955
+ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
3956
+ var O = {};
3957
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
3958
+ $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
3959
+ };
3960
+
3961
+ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
3962
+ if (WebAssembly && WebAssembly[ERROR_NAME]) {
3963
+ var O = {};
3964
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
3965
+ $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
3966
+ }
3967
+ };
3968
+
3969
+ // https://tc39.es/ecma262/#sec-nativeerror
3970
+ exportGlobalErrorCauseWrapper('Error', function (init) {
3971
+ return function Error(message) { return apply(init, this, arguments); };
3972
+ });
3973
+ exportGlobalErrorCauseWrapper('EvalError', function (init) {
3974
+ return function EvalError(message) { return apply(init, this, arguments); };
3975
+ });
3976
+ exportGlobalErrorCauseWrapper('RangeError', function (init) {
3977
+ return function RangeError(message) { return apply(init, this, arguments); };
3978
+ });
3979
+ exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
3980
+ return function ReferenceError(message) { return apply(init, this, arguments); };
3981
+ });
3982
+ exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
3983
+ return function SyntaxError(message) { return apply(init, this, arguments); };
3984
+ });
3985
+ exportGlobalErrorCauseWrapper('TypeError', function (init) {
3986
+ return function TypeError(message) { return apply(init, this, arguments); };
3987
+ });
3988
+ exportGlobalErrorCauseWrapper('URIError', function (init) {
3989
+ return function URIError(message) { return apply(init, this, arguments); };
3990
+ });
3991
+ exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
3992
+ return function CompileError(message) { return apply(init, this, arguments); };
3993
+ });
3994
+ exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
3995
+ return function LinkError(message) { return apply(init, this, arguments); };
3996
+ });
3997
+ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
3998
+ return function RuntimeError(message) { return apply(init, this, arguments); };
3999
+ });
4000
+
4001
+
3388
4002
  /***/ }),
3389
4003
 
3390
4004
  /***/ 59704:
@@ -4105,6 +4719,15 @@ var defineWellKnownSymbol = __webpack_require__(48332);
4105
4719
  defineWellKnownSymbol('unscopables');
4106
4720
 
4107
4721
 
4722
+ /***/ }),
4723
+
4724
+ /***/ 12752:
4725
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
4726
+
4727
+ // TODO: Remove from `core-js@4`
4728
+ __webpack_require__(4242);
4729
+
4730
+
4108
4731
  /***/ }),
4109
4732
 
4110
4733
  /***/ 17148:
@@ -4309,6 +4932,20 @@ for (var COLLECTION_NAME in DOMIterables) {
4309
4932
  }
4310
4933
 
4311
4934
 
4935
+ /***/ }),
4936
+
4937
+ /***/ 35846:
4938
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4939
+
4940
+ // TODO: remove from `core-js@4`
4941
+ __webpack_require__(12752);
4942
+
4943
+ var parent = __webpack_require__(56791);
4944
+ __webpack_require__(80162);
4945
+
4946
+ module.exports = parent;
4947
+
4948
+
4312
4949
  /***/ }),
4313
4950
 
4314
4951
  /***/ 26174:
@@ -10994,8 +11631,12 @@ var trimCharsStart = (0,ramda__WEBPACK_IMPORTED_MODULE_0__.curry)(function (char
10994
11631
  /***/ 68322:
10995
11632
  /***/ ((module) => {
10996
11633
 
11634
+ "use strict";
11635
+
10997
11636
  var ShortUniqueId = (() => {
10998
11637
  var __defProp = Object.defineProperty;
11638
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11639
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10999
11640
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11000
11641
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11001
11642
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -11011,22 +11652,34 @@ var ShortUniqueId = (() => {
11011
11652
  }
11012
11653
  return a;
11013
11654
  };
11014
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
11015
11655
  var __export = (target, all) => {
11016
- __markAsModule(target);
11017
11656
  for (var name in all)
11018
11657
  __defProp(target, name, { get: all[name], enumerable: true });
11019
11658
  };
11659
+ var __copyProps = (to, from, except, desc) => {
11660
+ if (from && typeof from === "object" || typeof from === "function") {
11661
+ for (let key of __getOwnPropNames(from))
11662
+ if (!__hasOwnProp.call(to, key) && key !== except)
11663
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11664
+ }
11665
+ return to;
11666
+ };
11667
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
11668
+ var __publicField = (obj, key, value) => {
11669
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11670
+ return value;
11671
+ };
11020
11672
 
11021
11673
  // src/index.ts
11022
11674
  var src_exports = {};
11023
11675
  __export(src_exports, {
11676
+ DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
11024
11677
  DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
11025
11678
  default: () => ShortUniqueId
11026
11679
  });
11027
11680
 
11028
11681
  // package.json
11029
- var version = "4.4.4";
11682
+ var version = "5.0.2";
11030
11683
 
11031
11684
  // src/index.ts
11032
11685
  var DEFAULT_UUID_LENGTH = 6;
@@ -11034,54 +11687,70 @@ var ShortUniqueId = (() => {
11034
11687
  dictionary: "alphanum",
11035
11688
  shuffle: true,
11036
11689
  debug: false,
11037
- length: DEFAULT_UUID_LENGTH
11690
+ length: DEFAULT_UUID_LENGTH,
11691
+ counter: 0
11038
11692
  };
11039
- var _ShortUniqueId = class extends Function {
11693
+ var _ShortUniqueId = class _ShortUniqueId {
11040
11694
  constructor(argOptions = {}) {
11041
- super();
11042
- this.dictIndex = 0;
11043
- this.dictRange = [];
11044
- this.lowerBound = 0;
11045
- this.upperBound = 0;
11046
- this.dictLength = 0;
11047
- this._digit_first_ascii = 48;
11048
- this._digit_last_ascii = 58;
11049
- this._alpha_lower_first_ascii = 97;
11050
- this._alpha_lower_last_ascii = 123;
11051
- this._hex_last_ascii = 103;
11052
- this._alpha_upper_first_ascii = 65;
11053
- this._alpha_upper_last_ascii = 91;
11054
- this._number_dict_ranges = {
11695
+ __publicField(this, "counter");
11696
+ __publicField(this, "debug");
11697
+ __publicField(this, "dict");
11698
+ __publicField(this, "version");
11699
+ __publicField(this, "dictIndex", 0);
11700
+ __publicField(this, "dictRange", []);
11701
+ __publicField(this, "lowerBound", 0);
11702
+ __publicField(this, "upperBound", 0);
11703
+ __publicField(this, "dictLength", 0);
11704
+ __publicField(this, "uuidLength");
11705
+ __publicField(this, "_digit_first_ascii", 48);
11706
+ __publicField(this, "_digit_last_ascii", 58);
11707
+ __publicField(this, "_alpha_lower_first_ascii", 97);
11708
+ __publicField(this, "_alpha_lower_last_ascii", 123);
11709
+ __publicField(this, "_hex_last_ascii", 103);
11710
+ __publicField(this, "_alpha_upper_first_ascii", 65);
11711
+ __publicField(this, "_alpha_upper_last_ascii", 91);
11712
+ __publicField(this, "_number_dict_ranges", {
11055
11713
  digits: [this._digit_first_ascii, this._digit_last_ascii]
11056
- };
11057
- this._alpha_dict_ranges = {
11714
+ });
11715
+ __publicField(this, "_alpha_dict_ranges", {
11058
11716
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
11059
11717
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11060
- };
11061
- this._alpha_lower_dict_ranges = {
11718
+ });
11719
+ __publicField(this, "_alpha_lower_dict_ranges", {
11062
11720
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
11063
- };
11064
- this._alpha_upper_dict_ranges = {
11721
+ });
11722
+ __publicField(this, "_alpha_upper_dict_ranges", {
11065
11723
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11066
- };
11067
- this._alphanum_dict_ranges = {
11724
+ });
11725
+ __publicField(this, "_alphanum_dict_ranges", {
11068
11726
  digits: [this._digit_first_ascii, this._digit_last_ascii],
11069
11727
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
11070
11728
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11071
- };
11072
- this._alphanum_lower_dict_ranges = {
11729
+ });
11730
+ __publicField(this, "_alphanum_lower_dict_ranges", {
11073
11731
  digits: [this._digit_first_ascii, this._digit_last_ascii],
11074
11732
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
11075
- };
11076
- this._alphanum_upper_dict_ranges = {
11733
+ });
11734
+ __publicField(this, "_alphanum_upper_dict_ranges", {
11077
11735
  digits: [this._digit_first_ascii, this._digit_last_ascii],
11078
11736
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11079
- };
11080
- this._hex_dict_ranges = {
11737
+ });
11738
+ __publicField(this, "_hex_dict_ranges", {
11081
11739
  decDigits: [this._digit_first_ascii, this._digit_last_ascii],
11082
11740
  alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
11083
- };
11084
- this.log = (...args) => {
11741
+ });
11742
+ __publicField(this, "_dict_ranges", {
11743
+ _number_dict_ranges: this._number_dict_ranges,
11744
+ _alpha_dict_ranges: this._alpha_dict_ranges,
11745
+ _alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
11746
+ _alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
11747
+ _alphanum_dict_ranges: this._alphanum_dict_ranges,
11748
+ _alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
11749
+ _alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
11750
+ _hex_dict_ranges: this._hex_dict_ranges
11751
+ });
11752
+ /* tslint:disable consistent-return */
11753
+ __publicField(this, "log", (...args) => {
11085
11754
  const finalArgs = [...args];
11086
11755
  finalArgs[0] = `[short-unique-id] ${args[0]}`;
11087
11756
  if (this.debug === true) {
@@ -11089,8 +11758,10 @@ var ShortUniqueId = (() => {
11089
11758
  return console.log(...finalArgs);
11090
11759
  }
11091
11760
  }
11092
- };
11093
- this.setDictionary = (dictionary, shuffle) => {
11761
+ });
11762
+ /* tslint:enable consistent-return */
11763
+ /** Change the dictionary after initialization. */
11764
+ __publicField(this, "setDictionary", (dictionary, shuffle) => {
11094
11765
  let finalDict;
11095
11766
  if (dictionary && Array.isArray(dictionary) && dictionary.length > 1) {
11096
11767
  finalDict = dictionary;
@@ -11099,7 +11770,7 @@ var ShortUniqueId = (() => {
11099
11770
  let i;
11100
11771
  this.dictIndex = i = 0;
11101
11772
  const rangesName = `_${dictionary}_dict_ranges`;
11102
- const ranges = this[rangesName];
11773
+ const ranges = this._dict_ranges[rangesName];
11103
11774
  Object.keys(ranges).forEach((rangeType) => {
11104
11775
  const rangeTypeKey = rangeType;
11105
11776
  this.dictRange = ranges[rangeTypeKey];
@@ -11116,12 +11787,16 @@ var ShortUniqueId = (() => {
11116
11787
  }
11117
11788
  this.dict = finalDict;
11118
11789
  this.dictLength = this.dict.length;
11119
- this.counter = 0;
11120
- };
11121
- this.seq = () => {
11790
+ this.setCounter(0);
11791
+ });
11792
+ __publicField(this, "seq", () => {
11122
11793
  return this.sequentialUUID();
11123
- };
11124
- this.sequentialUUID = () => {
11794
+ });
11795
+ /**
11796
+ * Generates UUID based on internal counter that's incremented after each ID generation.
11797
+ * @alias `const uid = new ShortUniqueId(); uid.seq();`
11798
+ */
11799
+ __publicField(this, "sequentialUUID", () => {
11125
11800
  let counterDiv;
11126
11801
  let counterRem;
11127
11802
  let id = "";
@@ -11133,8 +11808,15 @@ var ShortUniqueId = (() => {
11133
11808
  } while (counterDiv !== 0);
11134
11809
  this.counter += 1;
11135
11810
  return id;
11136
- };
11137
- this.randomUUID = (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
11811
+ });
11812
+ __publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
11813
+ return this.randomUUID(uuidLength);
11814
+ });
11815
+ /**
11816
+ * Generates UUID by creating each part randomly.
11817
+ * @alias `const uid = new ShortUniqueId(); uid.rnd(uuidLength: number);`
11818
+ */
11819
+ __publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
11138
11820
  let id;
11139
11821
  let randomPartIdx;
11140
11822
  let j;
@@ -11144,44 +11826,234 @@ var ShortUniqueId = (() => {
11144
11826
  const isPositive = uuidLength >= 0;
11145
11827
  id = "";
11146
11828
  for (j = 0; j < uuidLength; j += 1) {
11147
- randomPartIdx = parseInt((Math.random() * this.dictLength).toFixed(0), 10) % this.dictLength;
11829
+ randomPartIdx = parseInt(
11830
+ (Math.random() * this.dictLength).toFixed(0),
11831
+ 10
11832
+ ) % this.dictLength;
11148
11833
  id += this.dict[randomPartIdx];
11149
11834
  }
11150
11835
  return id;
11151
- };
11152
- this.availableUUIDs = (uuidLength = this.uuidLength) => {
11153
- return parseFloat(Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0));
11154
- };
11155
- this.approxMaxBeforeCollision = (rounds = this.availableUUIDs(this.uuidLength)) => {
11156
- return parseFloat(Math.sqrt(Math.PI / 2 * rounds).toFixed(20));
11157
- };
11158
- this.collisionProbability = (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
11159
- return parseFloat((this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20));
11160
- };
11161
- this.uniqueness = (rounds = this.availableUUIDs(this.uuidLength)) => {
11162
- const score = parseFloat((1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20));
11836
+ });
11837
+ __publicField(this, "fmt", (format, date) => {
11838
+ return this.formattedUUID(format, date);
11839
+ });
11840
+ /**
11841
+ * Generates custom UUID with the provided format string.
11842
+ * @alias `const uid = new ShortUniqueId(); uid.fmt(format: string);`
11843
+ */
11844
+ __publicField(this, "formattedUUID", (format, date) => {
11845
+ const fnMap = {
11846
+ "$r": this.randomUUID,
11847
+ "$s": this.sequentialUUID,
11848
+ "$t": this.stamp
11849
+ };
11850
+ const result = format.replace(
11851
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
11852
+ (m) => {
11853
+ const fn = m.slice(0, 2);
11854
+ const len = parseInt(m.slice(2), 10);
11855
+ if (fn === "$s") {
11856
+ return fnMap[fn]().padStart(len, "0");
11857
+ }
11858
+ if (fn === "$t" && date) {
11859
+ return fnMap[fn](len, date);
11860
+ }
11861
+ return fnMap[fn](len);
11862
+ }
11863
+ );
11864
+ return result;
11865
+ });
11866
+ /**
11867
+ * Calculates total number of possible UUIDs.
11868
+ *
11869
+ * Given that:
11870
+ *
11871
+ * - `H` is the total number of possible UUIDs
11872
+ * - `n` is the number of unique characters in the dictionary
11873
+ * - `l` is the UUID length
11874
+ *
11875
+ * Then `H` is defined as `n` to the power of `l`:
11876
+ *
11877
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11878
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%20H=n%5El"/>
11879
+ * </div>
11880
+ *
11881
+ * This function returns `H`.
11882
+ */
11883
+ __publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
11884
+ return parseFloat(
11885
+ Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
11886
+ );
11887
+ });
11888
+ /**
11889
+ * Calculates approximate number of hashes before first collision.
11890
+ *
11891
+ * Given that:
11892
+ *
11893
+ * - `H` is the total number of possible UUIDs, or in terms of this library,
11894
+ * the result of running `availableUUIDs()`
11895
+ * - the expected number of values we have to choose before finding the
11896
+ * first collision can be expressed as the quantity `Q(H)`
11897
+ *
11898
+ * Then `Q(H)` can be approximated as the square root of the product of half
11899
+ * of pi times `H`:
11900
+ *
11901
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11902
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%20Q(H)%5Capprox%5Csqrt%7B%5Cfrac%7B%5Cpi%7D%7B2%7DH%7D"/>
11903
+ * </div>
11904
+ *
11905
+ * This function returns `Q(H)`.
11906
+ *
11907
+ * (see [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution))
11908
+ */
11909
+ __publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
11910
+ return parseFloat(
11911
+ Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
11912
+ );
11913
+ });
11914
+ /**
11915
+ * Calculates probability of generating duplicate UUIDs (a collision) in a
11916
+ * given number of UUID generation rounds.
11917
+ *
11918
+ * Given that:
11919
+ *
11920
+ * - `r` is the maximum number of times that `randomUUID()` will be called,
11921
+ * or better said the number of _rounds_
11922
+ * - `H` is the total number of possible UUIDs, or in terms of this library,
11923
+ * the result of running `availableUUIDs()`
11924
+ *
11925
+ * Then the probability of collision `p(r; H)` can be approximated as the result
11926
+ * of dividing the square root of the product of half of pi times `r` by `H`:
11927
+ *
11928
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11929
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%20p(r%3B%20H)%5Capprox%5Cfrac%7B%5Csqrt%7B%5Cfrac%7B%5Cpi%7D%7B2%7Dr%7D%7D%7BH%7D"/>
11930
+ * </div>
11931
+ *
11932
+ * This function returns `p(r; H)`.
11933
+ *
11934
+ * (see [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution))
11935
+ *
11936
+ * (Useful if you are wondering _"If I use this lib and expect to perform at most
11937
+ * `r` rounds of UUID generations, what is the probability that I will hit a duplicate UUID?"_.)
11938
+ */
11939
+ __publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
11940
+ return parseFloat(
11941
+ (this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
11942
+ );
11943
+ });
11944
+ /**
11945
+ * Calculate a "uniqueness" score (from 0 to 1) of UUIDs based on size of
11946
+ * dictionary and chosen UUID length.
11947
+ *
11948
+ * Given that:
11949
+ *
11950
+ * - `H` is the total number of possible UUIDs, or in terms of this library,
11951
+ * the result of running `availableUUIDs()`
11952
+ * - `Q(H)` is the approximate number of hashes before first collision,
11953
+ * or in terms of this library, the result of running `approxMaxBeforeCollision()`
11954
+ *
11955
+ * Then `uniqueness` can be expressed as the additive inverse of the probability of
11956
+ * generating a "word" I had previously generated (a duplicate) at any given iteration
11957
+ * up to the the total number of possible UUIDs expressed as the quotiend of `Q(H)` and `H`:
11958
+ *
11959
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11960
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%201-%5Cfrac%7BQ(H)%7D%7BH%7D"/>
11961
+ * </div>
11962
+ *
11963
+ * (Useful if you need a value to rate the "quality" of the combination of given dictionary
11964
+ * and UUID length. The closer to 1, higher the uniqueness and thus better the quality.)
11965
+ */
11966
+ __publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
11967
+ const score = parseFloat(
11968
+ (1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
11969
+ );
11163
11970
  return score > 1 ? 1 : score < 0 ? 0 : score;
11164
- };
11165
- this.getVersion = () => {
11971
+ });
11972
+ /**
11973
+ * Return the version of this module.
11974
+ */
11975
+ __publicField(this, "getVersion", () => {
11166
11976
  return this.version;
11167
- };
11168
- this.stamp = (finalLength) => {
11977
+ });
11978
+ /**
11979
+ * Generates a UUID with a timestamp that can be extracted using `uid.parseStamp(stampString);`.
11980
+ *
11981
+ * ```js
11982
+ * const uidWithTimestamp = uid.stamp(32);
11983
+ * console.log(uidWithTimestamp);
11984
+ * // GDa608f973aRCHLXQYPTbKDbjDeVsSb3
11985
+ *
11986
+ * console.log(uid.parseStamp(uidWithTimestamp));
11987
+ * // 2021-05-03T06:24:58.000Z
11988
+ * ```
11989
+ */
11990
+ __publicField(this, "stamp", (finalLength, date) => {
11991
+ const hexStamp = Math.floor(+(date || /* @__PURE__ */ new Date()) / 1e3).toString(16);
11992
+ if (typeof finalLength === "number" && finalLength === 0) {
11993
+ return hexStamp;
11994
+ }
11169
11995
  if (typeof finalLength !== "number" || finalLength < 10) {
11170
- throw new Error("Param finalLength must be number greater than 10");
11996
+ throw new Error(
11997
+ [
11998
+ "Param finalLength must be a number greater than or equal to 10,",
11999
+ "or 0 if you want the raw hexadecimal timestamp"
12000
+ ].join("\n")
12001
+ );
11171
12002
  }
11172
- const hexStamp = Math.floor(+new Date() / 1e3).toString(16);
11173
12003
  const idLength = finalLength - 9;
11174
12004
  const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
11175
12005
  const id = this.randomUUID(idLength);
11176
- return `${id.substr(0, rndIdx)}${hexStamp}${id.substr(rndIdx)}${rndIdx.toString(16)}`;
11177
- };
11178
- this.parseStamp = (stamp) => {
12006
+ return `${id.substring(0, rndIdx)}${hexStamp}${id.substring(rndIdx)}${rndIdx.toString(16)}`;
12007
+ });
12008
+ /**
12009
+ * Extracts the date embeded in a UUID generated using the `uid.stamp(finalLength);` method.
12010
+ *
12011
+ * ```js
12012
+ * const uidWithTimestamp = uid.stamp(32);
12013
+ * console.log(uidWithTimestamp);
12014
+ * // GDa608f973aRCHLXQYPTbKDbjDeVsSb3
12015
+ *
12016
+ * console.log(uid.parseStamp(uidWithTimestamp));
12017
+ * // 2021-05-03T06:24:58.000Z
12018
+ * ```
12019
+ */
12020
+ __publicField(this, "parseStamp", (suid, format) => {
12021
+ if (format && !/t0|t[1-9]\d{1,}/.test(format)) {
12022
+ throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
12023
+ }
12024
+ const stamp = format ? format.replace(
12025
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
12026
+ (m) => {
12027
+ const fnMap = {
12028
+ "$r": (len2) => [...Array(len2)].map(() => "r").join(""),
12029
+ "$s": (len2) => [...Array(len2)].map(() => "s").join(""),
12030
+ "$t": (len2) => [...Array(len2)].map(() => "t").join("")
12031
+ };
12032
+ const fn = m.slice(0, 2);
12033
+ const len = parseInt(m.slice(2), 10);
12034
+ return fnMap[fn](len);
12035
+ }
12036
+ ).replace(
12037
+ /^(.*?)(t{8,})(.*)$/g,
12038
+ (_m, p1, p2) => {
12039
+ return suid.substring(p1.length, p1.length + p2.length);
12040
+ }
12041
+ ) : suid;
12042
+ if (stamp.length === 8) {
12043
+ return new Date(parseInt(stamp, 16) * 1e3);
12044
+ }
11179
12045
  if (stamp.length < 10) {
11180
12046
  throw new Error("Stamp length invalid");
11181
12047
  }
11182
- const rndIdx = parseInt(stamp.substr(stamp.length - 1, 1), 16);
11183
- return new Date(parseInt(stamp.substr(rndIdx, 8), 16) * 1e3);
11184
- };
12048
+ const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
12049
+ return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
12050
+ });
12051
+ /**
12052
+ * Set the counter to a specific value.
12053
+ */
12054
+ __publicField(this, "setCounter", (counter) => {
12055
+ this.counter = counter;
12056
+ });
11185
12057
  const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
11186
12058
  this.counter = 0;
11187
12059
  this.debug = false;
@@ -11190,21 +12062,40 @@ var ShortUniqueId = (() => {
11190
12062
  const {
11191
12063
  dictionary,
11192
12064
  shuffle,
11193
- length
12065
+ length,
12066
+ counter
11194
12067
  } = options;
11195
12068
  this.uuidLength = length;
11196
12069
  this.setDictionary(dictionary, shuffle);
12070
+ this.setCounter(counter);
11197
12071
  this.debug = options.debug;
11198
12072
  this.log(this.dict);
11199
- this.log(`Generator instantiated with Dictionary Size ${this.dictLength}`);
11200
- return new Proxy(this, {
11201
- apply: (target, that, args) => this.randomUUID(...args)
11202
- });
12073
+ this.log(
12074
+ `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
12075
+ );
12076
+ this.log = this.log.bind(this);
12077
+ this.setDictionary = this.setDictionary.bind(this);
12078
+ this.setCounter = this.setCounter.bind(this);
12079
+ this.seq = this.seq.bind(this);
12080
+ this.sequentialUUID = this.sequentialUUID.bind(this);
12081
+ this.rnd = this.rnd.bind(this);
12082
+ this.randomUUID = this.randomUUID.bind(this);
12083
+ this.fmt = this.fmt.bind(this);
12084
+ this.formattedUUID = this.formattedUUID.bind(this);
12085
+ this.availableUUIDs = this.availableUUIDs.bind(this);
12086
+ this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
12087
+ this.collisionProbability = this.collisionProbability.bind(this);
12088
+ this.uniqueness = this.uniqueness.bind(this);
12089
+ this.getVersion = this.getVersion.bind(this);
12090
+ this.stamp = this.stamp.bind(this);
12091
+ this.parseStamp = this.parseStamp.bind(this);
12092
+ return this;
11203
12093
  }
11204
12094
  };
12095
+ /** @hidden */
12096
+ __publicField(_ShortUniqueId, "default", _ShortUniqueId);
11205
12097
  var ShortUniqueId = _ShortUniqueId;
11206
- ShortUniqueId.default = _ShortUniqueId;
11207
- return src_exports;
12098
+ return __toCommonJS(src_exports);
11208
12099
  })();
11209
12100
  //# sourceMappingURL=short-unique-id.js.map
11210
12101
  true&&(module.exports=ShortUniqueId.default),'undefined'!=typeof window&&(ShortUniqueId=ShortUniqueId.default);
@@ -11218,6 +12109,13 @@ var ShortUniqueId = (() => {
11218
12109
 
11219
12110
  /***/ }),
11220
12111
 
12112
+ /***/ 21427:
12113
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12114
+
12115
+ module.exports = __webpack_require__(36762);
12116
+
12117
+ /***/ }),
12118
+
11221
12119
  /***/ 28936:
11222
12120
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11223
12121
 
@@ -12662,7 +13560,6 @@ __webpack_require__.r(__webpack_exports__);
12662
13560
  /* harmony export */ });
12663
13561
  /* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68322);
12664
13562
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67952);
12665
- // @ts-ignore
12666
13563
 
12667
13564
 
12668
13565
 
@@ -12683,7 +13580,7 @@ const plugin = ({
12683
13580
  visitor: {
12684
13581
  enter(element) {
12685
13582
  // eslint-disable-next-line no-param-reassign
12686
- element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid());
13583
+ element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid.randomUUID());
12687
13584
  }
12688
13585
  },
12689
13586
  post() {
@@ -12705,7 +13602,6 @@ __webpack_require__.r(__webpack_exports__);
12705
13602
  /* harmony export */ });
12706
13603
  /* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68322);
12707
13604
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67952);
12708
- // @ts-ignore
12709
13605
 
12710
13606
 
12711
13607
 
@@ -12729,7 +13625,7 @@ const plugin = ({
12729
13625
  enter(element) {
12730
13626
  if (!predicates.isPrimitiveElement(element)) {
12731
13627
  // eslint-disable-next-line no-param-reassign
12732
- element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid());
13628
+ element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid.randomUUID());
12733
13629
  }
12734
13630
  }
12735
13631
  },
@@ -13874,12 +14770,20 @@ __webpack_require__.r(__webpack_exports__);
13874
14770
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13875
14771
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13876
14772
  /* harmony export */ });
13877
- /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39723);
14773
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39723);
13878
14774
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13776);
14775
+ /* harmony import */ var _babel_runtime_corejs3_core_js_aggregate_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21427);
14776
+ var _globalThis$Aggregate;
14777
+
13879
14778
 
14779
+ // @ts-ignore
13880
14780
 
14781
+ const AggregateError = (_globalThis$Aggregate = globalThis.AggregateError) !== null && _globalThis$Aggregate !== void 0 ? _globalThis$Aggregate : _babel_runtime_corejs3_core_js_aggregate_error__WEBPACK_IMPORTED_MODULE_1__;
14782
+ /**
14783
+ * ApiDOMAggregateError is using polyfill of AggregateError from core-js-pure
14784
+ * in environments which don't support global AggregateError symbol.
14785
+ */
13881
14786
  class ApiDOMAggregateError extends AggregateError {
13882
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13883
14787
  constructor(errors, message, options) {
13884
14788
  super(errors, message, options);
13885
14789
  this.name = this.constructor.name;
@@ -13896,7 +14800,7 @@ class ApiDOMAggregateError extends AggregateError {
13896
14800
  * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
13897
14801
  * Node.js is >= 16.9.0 supports error causes natively.
13898
14802
  */
13899
- if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__["default"])(options) && (0,ramda__WEBPACK_IMPORTED_MODULE_0__.hasIn)('cause', options) && !(0,ramda__WEBPACK_IMPORTED_MODULE_0__.hasIn)('cause', this)) {
14803
+ if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__["default"])(options) && (0,ramda__WEBPACK_IMPORTED_MODULE_0__.hasIn)('cause', options) && !(0,ramda__WEBPACK_IMPORTED_MODULE_0__.hasIn)('cause', this)) {
13900
14804
  const {
13901
14805
  cause
13902
14806
  } = options;