@swagger-api/apidom-json-pointer 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.
@@ -326,6 +326,16 @@ const safeDecodeURIComponent = encodedURIComponent => {
326
326
  const unescape = (0,ramda__WEBPACK_IMPORTED_MODULE_0__.pipe)((0,ramda__WEBPACK_IMPORTED_MODULE_0__.replace)(/~1/g, '/'), (0,ramda__WEBPACK_IMPORTED_MODULE_0__.replace)(/~0/g, '~'), safeDecodeURIComponent);
327
327
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (unescape);
328
328
 
329
+ /***/ }),
330
+
331
+ /***/ 60042:
332
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
333
+
334
+ var parent = __webpack_require__(35846);
335
+
336
+ module.exports = parent;
337
+
338
+
329
339
  /***/ }),
330
340
 
331
341
  /***/ 28385:
@@ -400,6 +410,21 @@ var parent = __webpack_require__(16042);
400
410
  module.exports = parent;
401
411
 
402
412
 
413
+ /***/ }),
414
+
415
+ /***/ 56791:
416
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
417
+
418
+ __webpack_require__(4339);
419
+ __webpack_require__(4242);
420
+ __webpack_require__(84016);
421
+ __webpack_require__(98939);
422
+ __webpack_require__(5454);
423
+ var path = __webpack_require__(57545);
424
+
425
+ module.exports = path.AggregateError;
426
+
427
+
403
428
  /***/ }),
404
429
 
405
430
  /***/ 92089:
@@ -522,6 +547,27 @@ var WrappedWellKnownSymbolModule = __webpack_require__(89207);
522
547
  module.exports = WrappedWellKnownSymbolModule.f('toPrimitive');
523
548
 
524
549
 
550
+ /***/ }),
551
+
552
+ /***/ 36762:
553
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
554
+
555
+ module.exports = __webpack_require__(73028);
556
+
557
+
558
+ /***/ }),
559
+
560
+ /***/ 73028:
561
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
562
+
563
+ // TODO: remove from `core-js@4`
564
+ __webpack_require__(12752);
565
+
566
+ var parent = __webpack_require__(60042);
567
+
568
+ module.exports = parent;
569
+
570
+
525
571
  /***/ }),
526
572
 
527
573
  /***/ 32747:
@@ -951,6 +997,29 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
951
997
  };
952
998
 
953
999
 
1000
+ /***/ }),
1001
+
1002
+ /***/ 97987:
1003
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1004
+
1005
+ var hasOwn = __webpack_require__(64500);
1006
+ var ownKeys = __webpack_require__(93011);
1007
+ var getOwnPropertyDescriptorModule = __webpack_require__(5141);
1008
+ var definePropertyModule = __webpack_require__(42760);
1009
+
1010
+ module.exports = function (target, source, exceptions) {
1011
+ var keys = ownKeys(source);
1012
+ var defineProperty = definePropertyModule.f;
1013
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1014
+ for (var i = 0; i < keys.length; i++) {
1015
+ var key = keys[i];
1016
+ if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
1017
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1018
+ }
1019
+ }
1020
+ };
1021
+
1022
+
954
1023
  /***/ }),
955
1024
 
956
1025
  /***/ 4635:
@@ -1248,6 +1317,65 @@ module.exports = [
1248
1317
  ];
1249
1318
 
1250
1319
 
1320
+ /***/ }),
1321
+
1322
+ /***/ 14503:
1323
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1324
+
1325
+ var uncurryThis = __webpack_require__(84120);
1326
+
1327
+ var $Error = Error;
1328
+ var replace = uncurryThis(''.replace);
1329
+
1330
+ var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
1331
+ // eslint-disable-next-line redos/no-vulnerable -- safe
1332
+ var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
1333
+ var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
1334
+
1335
+ module.exports = function (stack, dropEntries) {
1336
+ if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
1337
+ while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
1338
+ } return stack;
1339
+ };
1340
+
1341
+
1342
+ /***/ }),
1343
+
1344
+ /***/ 58266:
1345
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1346
+
1347
+ var createNonEnumerableProperty = __webpack_require__(98711);
1348
+ var clearErrorStack = __webpack_require__(14503);
1349
+ var ERROR_STACK_INSTALLABLE = __webpack_require__(50274);
1350
+
1351
+ // non-standard V8
1352
+ var captureStackTrace = Error.captureStackTrace;
1353
+
1354
+ module.exports = function (error, C, stack, dropEntries) {
1355
+ if (ERROR_STACK_INSTALLABLE) {
1356
+ if (captureStackTrace) captureStackTrace(error, C);
1357
+ else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));
1358
+ }
1359
+ };
1360
+
1361
+
1362
+ /***/ }),
1363
+
1364
+ /***/ 50274:
1365
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1366
+
1367
+ var fails = __webpack_require__(76192);
1368
+ var createPropertyDescriptor = __webpack_require__(90774);
1369
+
1370
+ module.exports = !fails(function () {
1371
+ var error = Error('a');
1372
+ if (!('stack' in error)) return true;
1373
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1374
+ Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
1375
+ return error.stack !== 7;
1376
+ });
1377
+
1378
+
1251
1379
  /***/ }),
1252
1380
 
1253
1381
  /***/ 93085:
@@ -1531,6 +1659,46 @@ module.exports = function (namespace, method) {
1531
1659
  };
1532
1660
 
1533
1661
 
1662
+ /***/ }),
1663
+
1664
+ /***/ 78703:
1665
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1666
+
1667
+ var classof = __webpack_require__(4696);
1668
+ var getMethod = __webpack_require__(75037);
1669
+ var isNullOrUndefined = __webpack_require__(75646);
1670
+ var Iterators = __webpack_require__(82621);
1671
+ var wellKnownSymbol = __webpack_require__(18182);
1672
+
1673
+ var ITERATOR = wellKnownSymbol('iterator');
1674
+
1675
+ module.exports = function (it) {
1676
+ if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
1677
+ || getMethod(it, '@@iterator')
1678
+ || Iterators[classof(it)];
1679
+ };
1680
+
1681
+
1682
+ /***/ }),
1683
+
1684
+ /***/ 61669:
1685
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1686
+
1687
+ var call = __webpack_require__(18922);
1688
+ var aCallable = __webpack_require__(66235);
1689
+ var anObject = __webpack_require__(31138);
1690
+ var tryToString = __webpack_require__(79288);
1691
+ var getIteratorMethod = __webpack_require__(78703);
1692
+
1693
+ var $TypeError = TypeError;
1694
+
1695
+ module.exports = function (argument, usingIterator) {
1696
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
1697
+ if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
1698
+ throw $TypeError(tryToString(argument) + ' is not iterable');
1699
+ };
1700
+
1701
+
1534
1702
  /***/ }),
1535
1703
 
1536
1704
  /***/ 19202:
@@ -1680,6 +1848,31 @@ module.exports = fails(function () {
1680
1848
  } : $Object;
1681
1849
 
1682
1850
 
1851
+ /***/ }),
1852
+
1853
+ /***/ 62643:
1854
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1855
+
1856
+ var isCallable = __webpack_require__(16447);
1857
+ var isObject = __webpack_require__(35744);
1858
+ var setPrototypeOf = __webpack_require__(24469);
1859
+
1860
+ // makes subclassing work correct for wrapped built-ins
1861
+ module.exports = function ($this, dummy, Wrapper) {
1862
+ var NewTarget, NewTargetPrototype;
1863
+ if (
1864
+ // it can work only with native `setPrototypeOf`
1865
+ setPrototypeOf &&
1866
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
1867
+ isCallable(NewTarget = dummy.constructor) &&
1868
+ NewTarget !== Wrapper &&
1869
+ isObject(NewTargetPrototype = NewTarget.prototype) &&
1870
+ NewTargetPrototype !== Wrapper.prototype
1871
+ ) setPrototypeOf($this, NewTargetPrototype);
1872
+ return $this;
1873
+ };
1874
+
1875
+
1683
1876
  /***/ }),
1684
1877
 
1685
1878
  /***/ 19516:
@@ -1701,6 +1894,23 @@ if (!isCallable(store.inspectSource)) {
1701
1894
  module.exports = store.inspectSource;
1702
1895
 
1703
1896
 
1897
+ /***/ }),
1898
+
1899
+ /***/ 10273:
1900
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1901
+
1902
+ var isObject = __webpack_require__(35744);
1903
+ var createNonEnumerableProperty = __webpack_require__(98711);
1904
+
1905
+ // `InstallErrorCause` abstract operation
1906
+ // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
1907
+ module.exports = function (O, options) {
1908
+ if (isObject(options) && 'cause' in options) {
1909
+ createNonEnumerableProperty(O, 'cause', options.cause);
1910
+ }
1911
+ };
1912
+
1913
+
1704
1914
  /***/ }),
1705
1915
 
1706
1916
  /***/ 73326:
@@ -1778,6 +1988,23 @@ module.exports = {
1778
1988
  };
1779
1989
 
1780
1990
 
1991
+ /***/ }),
1992
+
1993
+ /***/ 96109:
1994
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1995
+
1996
+ var wellKnownSymbol = __webpack_require__(18182);
1997
+ var Iterators = __webpack_require__(82621);
1998
+
1999
+ var ITERATOR = wellKnownSymbol('iterator');
2000
+ var ArrayPrototype = Array.prototype;
2001
+
2002
+ // check on default Array iterator
2003
+ module.exports = function (it) {
2004
+ return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
2005
+ };
2006
+
2007
+
1781
2008
  /***/ }),
1782
2009
 
1783
2010
  /***/ 34770:
@@ -1956,6 +2183,111 @@ module.exports = USE_SYMBOL_AS_UID ? function (it) {
1956
2183
  };
1957
2184
 
1958
2185
 
2186
+ /***/ }),
2187
+
2188
+ /***/ 33442:
2189
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2190
+
2191
+ var bind = __webpack_require__(8043);
2192
+ var call = __webpack_require__(18922);
2193
+ var anObject = __webpack_require__(31138);
2194
+ var tryToString = __webpack_require__(79288);
2195
+ var isArrayIteratorMethod = __webpack_require__(96109);
2196
+ var lengthOfArrayLike = __webpack_require__(84104);
2197
+ var isPrototypeOf = __webpack_require__(8902);
2198
+ var getIterator = __webpack_require__(61669);
2199
+ var getIteratorMethod = __webpack_require__(78703);
2200
+ var iteratorClose = __webpack_require__(66639);
2201
+
2202
+ var $TypeError = TypeError;
2203
+
2204
+ var Result = function (stopped, result) {
2205
+ this.stopped = stopped;
2206
+ this.result = result;
2207
+ };
2208
+
2209
+ var ResultPrototype = Result.prototype;
2210
+
2211
+ module.exports = function (iterable, unboundFunction, options) {
2212
+ var that = options && options.that;
2213
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2214
+ var IS_RECORD = !!(options && options.IS_RECORD);
2215
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2216
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2217
+ var fn = bind(unboundFunction, that);
2218
+ var iterator, iterFn, index, length, result, next, step;
2219
+
2220
+ var stop = function (condition) {
2221
+ if (iterator) iteratorClose(iterator, 'normal', condition);
2222
+ return new Result(true, condition);
2223
+ };
2224
+
2225
+ var callFn = function (value) {
2226
+ if (AS_ENTRIES) {
2227
+ anObject(value);
2228
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2229
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2230
+ };
2231
+
2232
+ if (IS_RECORD) {
2233
+ iterator = iterable.iterator;
2234
+ } else if (IS_ITERATOR) {
2235
+ iterator = iterable;
2236
+ } else {
2237
+ iterFn = getIteratorMethod(iterable);
2238
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
2239
+ // optimisation for array iterators
2240
+ if (isArrayIteratorMethod(iterFn)) {
2241
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2242
+ result = callFn(iterable[index]);
2243
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
2244
+ } return new Result(false);
2245
+ }
2246
+ iterator = getIterator(iterable, iterFn);
2247
+ }
2248
+
2249
+ next = IS_RECORD ? iterable.next : iterator.next;
2250
+ while (!(step = call(next, iterator)).done) {
2251
+ try {
2252
+ result = callFn(step.value);
2253
+ } catch (error) {
2254
+ iteratorClose(iterator, 'throw', error);
2255
+ }
2256
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
2257
+ } return new Result(false);
2258
+ };
2259
+
2260
+
2261
+ /***/ }),
2262
+
2263
+ /***/ 66639:
2264
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2265
+
2266
+ var call = __webpack_require__(18922);
2267
+ var anObject = __webpack_require__(31138);
2268
+ var getMethod = __webpack_require__(75037);
2269
+
2270
+ module.exports = function (iterator, kind, value) {
2271
+ var innerResult, innerError;
2272
+ anObject(iterator);
2273
+ try {
2274
+ innerResult = getMethod(iterator, 'return');
2275
+ if (!innerResult) {
2276
+ if (kind === 'throw') throw value;
2277
+ return value;
2278
+ }
2279
+ innerResult = call(innerResult, iterator);
2280
+ } catch (error) {
2281
+ innerError = true;
2282
+ innerResult = error;
2283
+ }
2284
+ if (kind === 'throw') throw value;
2285
+ if (innerError) throw innerResult;
2286
+ anObject(innerResult);
2287
+ return value;
2288
+ };
2289
+
2290
+
1959
2291
  /***/ }),
1960
2292
 
1961
2293
  /***/ 25695:
@@ -2183,6 +2515,18 @@ module.exports = Math.trunc || function trunc(x) {
2183
2515
  };
2184
2516
 
2185
2517
 
2518
+ /***/ }),
2519
+
2520
+ /***/ 36016:
2521
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2522
+
2523
+ var toString = __webpack_require__(44845);
2524
+
2525
+ module.exports = function (argument, $default) {
2526
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
2527
+ };
2528
+
2529
+
2186
2530
  /***/ }),
2187
2531
 
2188
2532
  /***/ 52853:
@@ -2611,6 +2955,27 @@ module.exports = function (input, pref) {
2611
2955
  };
2612
2956
 
2613
2957
 
2958
+ /***/ }),
2959
+
2960
+ /***/ 93011:
2961
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2962
+
2963
+ var getBuiltIn = __webpack_require__(10150);
2964
+ var uncurryThis = __webpack_require__(84120);
2965
+ var getOwnPropertyNamesModule = __webpack_require__(92092);
2966
+ var getOwnPropertySymbolsModule = __webpack_require__(84750);
2967
+ var anObject = __webpack_require__(31138);
2968
+
2969
+ var concat = uncurryThis([].concat);
2970
+
2971
+ // all object keys, includes non-enumerable and symbols
2972
+ module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
2973
+ var keys = getOwnPropertyNamesModule.f(anObject(it));
2974
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
2975
+ return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
2976
+ };
2977
+
2978
+
2614
2979
  /***/ }),
2615
2980
 
2616
2981
  /***/ 57545:
@@ -2619,6 +2984,22 @@ module.exports = function (input, pref) {
2619
2984
  module.exports = {};
2620
2985
 
2621
2986
 
2987
+ /***/ }),
2988
+
2989
+ /***/ 67656:
2990
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2991
+
2992
+ var defineProperty = (__webpack_require__(42760).f);
2993
+
2994
+ module.exports = function (Target, Source, key) {
2995
+ key in Target || defineProperty(Target, key, {
2996
+ configurable: true,
2997
+ get: function () { return Source[key]; },
2998
+ set: function (it) { Source[key] = it; }
2999
+ });
3000
+ };
3001
+
3002
+
2622
3003
  /***/ }),
2623
3004
 
2624
3005
  /***/ 13209:
@@ -3169,6 +3550,176 @@ module.exports = function (name) {
3169
3550
  };
3170
3551
 
3171
3552
 
3553
+ /***/ }),
3554
+
3555
+ /***/ 20426:
3556
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
3557
+
3558
+ "use strict";
3559
+
3560
+ var getBuiltIn = __webpack_require__(10150);
3561
+ var hasOwn = __webpack_require__(64500);
3562
+ var createNonEnumerableProperty = __webpack_require__(98711);
3563
+ var isPrototypeOf = __webpack_require__(8902);
3564
+ var setPrototypeOf = __webpack_require__(24469);
3565
+ var copyConstructorProperties = __webpack_require__(97987);
3566
+ var proxyAccessor = __webpack_require__(67656);
3567
+ var inheritIfRequired = __webpack_require__(62643);
3568
+ var normalizeStringArgument = __webpack_require__(36016);
3569
+ var installErrorCause = __webpack_require__(10273);
3570
+ var installErrorStack = __webpack_require__(58266);
3571
+ var DESCRIPTORS = __webpack_require__(50069);
3572
+ var IS_PURE = __webpack_require__(85546);
3573
+
3574
+ module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
3575
+ var STACK_TRACE_LIMIT = 'stackTraceLimit';
3576
+ var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
3577
+ var path = FULL_NAME.split('.');
3578
+ var ERROR_NAME = path[path.length - 1];
3579
+ var OriginalError = getBuiltIn.apply(null, path);
3580
+
3581
+ if (!OriginalError) return;
3582
+
3583
+ var OriginalErrorPrototype = OriginalError.prototype;
3584
+
3585
+ // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
3586
+ if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
3587
+
3588
+ if (!FORCED) return OriginalError;
3589
+
3590
+ var BaseError = getBuiltIn('Error');
3591
+
3592
+ var WrappedError = wrapper(function (a, b) {
3593
+ var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
3594
+ var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
3595
+ if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
3596
+ installErrorStack(result, WrappedError, result.stack, 2);
3597
+ if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
3598
+ if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
3599
+ return result;
3600
+ });
3601
+
3602
+ WrappedError.prototype = OriginalErrorPrototype;
3603
+
3604
+ if (ERROR_NAME !== 'Error') {
3605
+ if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
3606
+ else copyConstructorProperties(WrappedError, BaseError, { name: true });
3607
+ } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
3608
+ proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
3609
+ proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
3610
+ }
3611
+
3612
+ copyConstructorProperties(WrappedError, OriginalError);
3613
+
3614
+ if (!IS_PURE) try {
3615
+ // Safari 13- bug: WebAssembly errors does not have a proper `.name`
3616
+ if (OriginalErrorPrototype.name !== ERROR_NAME) {
3617
+ createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
3618
+ }
3619
+ OriginalErrorPrototype.constructor = WrappedError;
3620
+ } catch (error) { /* empty */ }
3621
+
3622
+ return WrappedError;
3623
+ };
3624
+
3625
+
3626
+ /***/ }),
3627
+
3628
+ /***/ 84016:
3629
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3630
+
3631
+ var $ = __webpack_require__(93085);
3632
+ var getBuiltIn = __webpack_require__(10150);
3633
+ var apply = __webpack_require__(86298);
3634
+ var fails = __webpack_require__(76192);
3635
+ var wrapErrorConstructorWithCause = __webpack_require__(20426);
3636
+
3637
+ var AGGREGATE_ERROR = 'AggregateError';
3638
+ var $AggregateError = getBuiltIn(AGGREGATE_ERROR);
3639
+
3640
+ var FORCED = !fails(function () {
3641
+ return $AggregateError([1]).errors[0] !== 1;
3642
+ }) && fails(function () {
3643
+ return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7;
3644
+ });
3645
+
3646
+ // https://tc39.es/ecma262/#sec-aggregate-error
3647
+ $({ global: true, constructor: true, arity: 2, forced: FORCED }, {
3648
+ AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function (init) {
3649
+ // eslint-disable-next-line no-unused-vars -- required for functions `.length`
3650
+ return function AggregateError(errors, message) { return apply(init, this, arguments); };
3651
+ }, FORCED, true)
3652
+ });
3653
+
3654
+
3655
+ /***/ }),
3656
+
3657
+ /***/ 93820:
3658
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3659
+
3660
+ "use strict";
3661
+
3662
+ var $ = __webpack_require__(93085);
3663
+ var isPrototypeOf = __webpack_require__(8902);
3664
+ var getPrototypeOf = __webpack_require__(89341);
3665
+ var setPrototypeOf = __webpack_require__(24469);
3666
+ var copyConstructorProperties = __webpack_require__(97987);
3667
+ var create = __webpack_require__(52853);
3668
+ var createNonEnumerableProperty = __webpack_require__(98711);
3669
+ var createPropertyDescriptor = __webpack_require__(90774);
3670
+ var installErrorCause = __webpack_require__(10273);
3671
+ var installErrorStack = __webpack_require__(58266);
3672
+ var iterate = __webpack_require__(33442);
3673
+ var normalizeStringArgument = __webpack_require__(36016);
3674
+ var wellKnownSymbol = __webpack_require__(18182);
3675
+
3676
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
3677
+ var $Error = Error;
3678
+ var push = [].push;
3679
+
3680
+ var $AggregateError = function AggregateError(errors, message /* , options */) {
3681
+ var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
3682
+ var that;
3683
+ if (setPrototypeOf) {
3684
+ that = setPrototypeOf($Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
3685
+ } else {
3686
+ that = isInstance ? this : create(AggregateErrorPrototype);
3687
+ createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
3688
+ }
3689
+ if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
3690
+ installErrorStack(that, $AggregateError, that.stack, 1);
3691
+ if (arguments.length > 2) installErrorCause(that, arguments[2]);
3692
+ var errorsArray = [];
3693
+ iterate(errors, push, { that: errorsArray });
3694
+ createNonEnumerableProperty(that, 'errors', errorsArray);
3695
+ return that;
3696
+ };
3697
+
3698
+ if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
3699
+ else copyConstructorProperties($AggregateError, $Error, { name: true });
3700
+
3701
+ var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
3702
+ constructor: createPropertyDescriptor(1, $AggregateError),
3703
+ message: createPropertyDescriptor(1, ''),
3704
+ name: createPropertyDescriptor(1, 'AggregateError')
3705
+ });
3706
+
3707
+ // `AggregateError` constructor
3708
+ // https://tc39.es/ecma262/#sec-aggregate-error-constructor
3709
+ $({ global: true, constructor: true, arity: 2 }, {
3710
+ AggregateError: $AggregateError
3711
+ });
3712
+
3713
+
3714
+ /***/ }),
3715
+
3716
+ /***/ 4242:
3717
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3718
+
3719
+ // TODO: Remove this module from `core-js@4` since it's replaced to module below
3720
+ __webpack_require__(93820);
3721
+
3722
+
3172
3723
  /***/ }),
3173
3724
 
3174
3725
  /***/ 59106:
@@ -3344,6 +3895,69 @@ if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
3344
3895
  // empty
3345
3896
 
3346
3897
 
3898
+ /***/ }),
3899
+
3900
+ /***/ 4339:
3901
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3902
+
3903
+ /* eslint-disable no-unused-vars -- required for functions `.length` */
3904
+ var $ = __webpack_require__(93085);
3905
+ var global = __webpack_require__(98576);
3906
+ var apply = __webpack_require__(86298);
3907
+ var wrapErrorConstructorWithCause = __webpack_require__(20426);
3908
+
3909
+ var WEB_ASSEMBLY = 'WebAssembly';
3910
+ var WebAssembly = global[WEB_ASSEMBLY];
3911
+
3912
+ var FORCED = Error('e', { cause: 7 }).cause !== 7;
3913
+
3914
+ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
3915
+ var O = {};
3916
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
3917
+ $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
3918
+ };
3919
+
3920
+ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
3921
+ if (WebAssembly && WebAssembly[ERROR_NAME]) {
3922
+ var O = {};
3923
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
3924
+ $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
3925
+ }
3926
+ };
3927
+
3928
+ // https://tc39.es/ecma262/#sec-nativeerror
3929
+ exportGlobalErrorCauseWrapper('Error', function (init) {
3930
+ return function Error(message) { return apply(init, this, arguments); };
3931
+ });
3932
+ exportGlobalErrorCauseWrapper('EvalError', function (init) {
3933
+ return function EvalError(message) { return apply(init, this, arguments); };
3934
+ });
3935
+ exportGlobalErrorCauseWrapper('RangeError', function (init) {
3936
+ return function RangeError(message) { return apply(init, this, arguments); };
3937
+ });
3938
+ exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
3939
+ return function ReferenceError(message) { return apply(init, this, arguments); };
3940
+ });
3941
+ exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
3942
+ return function SyntaxError(message) { return apply(init, this, arguments); };
3943
+ });
3944
+ exportGlobalErrorCauseWrapper('TypeError', function (init) {
3945
+ return function TypeError(message) { return apply(init, this, arguments); };
3946
+ });
3947
+ exportGlobalErrorCauseWrapper('URIError', function (init) {
3948
+ return function URIError(message) { return apply(init, this, arguments); };
3949
+ });
3950
+ exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
3951
+ return function CompileError(message) { return apply(init, this, arguments); };
3952
+ });
3953
+ exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
3954
+ return function LinkError(message) { return apply(init, this, arguments); };
3955
+ });
3956
+ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
3957
+ return function RuntimeError(message) { return apply(init, this, arguments); };
3958
+ });
3959
+
3960
+
3347
3961
  /***/ }),
3348
3962
 
3349
3963
  /***/ 59704:
@@ -4064,6 +4678,15 @@ var defineWellKnownSymbol = __webpack_require__(48332);
4064
4678
  defineWellKnownSymbol('unscopables');
4065
4679
 
4066
4680
 
4681
+ /***/ }),
4682
+
4683
+ /***/ 12752:
4684
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
4685
+
4686
+ // TODO: Remove from `core-js@4`
4687
+ __webpack_require__(4242);
4688
+
4689
+
4067
4690
  /***/ }),
4068
4691
 
4069
4692
  /***/ 17148:
@@ -4268,6 +4891,20 @@ for (var COLLECTION_NAME in DOMIterables) {
4268
4891
  }
4269
4892
 
4270
4893
 
4894
+ /***/ }),
4895
+
4896
+ /***/ 35846:
4897
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
4898
+
4899
+ // TODO: remove from `core-js@4`
4900
+ __webpack_require__(12752);
4901
+
4902
+ var parent = __webpack_require__(56791);
4903
+ __webpack_require__(80162);
4904
+
4905
+ module.exports = parent;
4906
+
4907
+
4271
4908
  /***/ }),
4272
4909
 
4273
4910
  /***/ 26174:
@@ -10953,8 +11590,12 @@ var trimCharsStart = (0,ramda__WEBPACK_IMPORTED_MODULE_0__.curry)(function (char
10953
11590
  /***/ 68322:
10954
11591
  /***/ ((module) => {
10955
11592
 
11593
+ "use strict";
11594
+
10956
11595
  var ShortUniqueId = (() => {
10957
11596
  var __defProp = Object.defineProperty;
11597
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11598
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10958
11599
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10959
11600
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10960
11601
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
@@ -10970,22 +11611,34 @@ var ShortUniqueId = (() => {
10970
11611
  }
10971
11612
  return a;
10972
11613
  };
10973
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
10974
11614
  var __export = (target, all) => {
10975
- __markAsModule(target);
10976
11615
  for (var name in all)
10977
11616
  __defProp(target, name, { get: all[name], enumerable: true });
10978
11617
  };
11618
+ var __copyProps = (to, from, except, desc) => {
11619
+ if (from && typeof from === "object" || typeof from === "function") {
11620
+ for (let key of __getOwnPropNames(from))
11621
+ if (!__hasOwnProp.call(to, key) && key !== except)
11622
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11623
+ }
11624
+ return to;
11625
+ };
11626
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
11627
+ var __publicField = (obj, key, value) => {
11628
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11629
+ return value;
11630
+ };
10979
11631
 
10980
11632
  // src/index.ts
10981
11633
  var src_exports = {};
10982
11634
  __export(src_exports, {
11635
+ DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
10983
11636
  DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
10984
11637
  default: () => ShortUniqueId
10985
11638
  });
10986
11639
 
10987
11640
  // package.json
10988
- var version = "4.4.4";
11641
+ var version = "5.0.2";
10989
11642
 
10990
11643
  // src/index.ts
10991
11644
  var DEFAULT_UUID_LENGTH = 6;
@@ -10993,54 +11646,70 @@ var ShortUniqueId = (() => {
10993
11646
  dictionary: "alphanum",
10994
11647
  shuffle: true,
10995
11648
  debug: false,
10996
- length: DEFAULT_UUID_LENGTH
11649
+ length: DEFAULT_UUID_LENGTH,
11650
+ counter: 0
10997
11651
  };
10998
- var _ShortUniqueId = class extends Function {
11652
+ var _ShortUniqueId = class _ShortUniqueId {
10999
11653
  constructor(argOptions = {}) {
11000
- super();
11001
- this.dictIndex = 0;
11002
- this.dictRange = [];
11003
- this.lowerBound = 0;
11004
- this.upperBound = 0;
11005
- this.dictLength = 0;
11006
- this._digit_first_ascii = 48;
11007
- this._digit_last_ascii = 58;
11008
- this._alpha_lower_first_ascii = 97;
11009
- this._alpha_lower_last_ascii = 123;
11010
- this._hex_last_ascii = 103;
11011
- this._alpha_upper_first_ascii = 65;
11012
- this._alpha_upper_last_ascii = 91;
11013
- this._number_dict_ranges = {
11654
+ __publicField(this, "counter");
11655
+ __publicField(this, "debug");
11656
+ __publicField(this, "dict");
11657
+ __publicField(this, "version");
11658
+ __publicField(this, "dictIndex", 0);
11659
+ __publicField(this, "dictRange", []);
11660
+ __publicField(this, "lowerBound", 0);
11661
+ __publicField(this, "upperBound", 0);
11662
+ __publicField(this, "dictLength", 0);
11663
+ __publicField(this, "uuidLength");
11664
+ __publicField(this, "_digit_first_ascii", 48);
11665
+ __publicField(this, "_digit_last_ascii", 58);
11666
+ __publicField(this, "_alpha_lower_first_ascii", 97);
11667
+ __publicField(this, "_alpha_lower_last_ascii", 123);
11668
+ __publicField(this, "_hex_last_ascii", 103);
11669
+ __publicField(this, "_alpha_upper_first_ascii", 65);
11670
+ __publicField(this, "_alpha_upper_last_ascii", 91);
11671
+ __publicField(this, "_number_dict_ranges", {
11014
11672
  digits: [this._digit_first_ascii, this._digit_last_ascii]
11015
- };
11016
- this._alpha_dict_ranges = {
11673
+ });
11674
+ __publicField(this, "_alpha_dict_ranges", {
11017
11675
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
11018
11676
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11019
- };
11020
- this._alpha_lower_dict_ranges = {
11677
+ });
11678
+ __publicField(this, "_alpha_lower_dict_ranges", {
11021
11679
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
11022
- };
11023
- this._alpha_upper_dict_ranges = {
11680
+ });
11681
+ __publicField(this, "_alpha_upper_dict_ranges", {
11024
11682
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11025
- };
11026
- this._alphanum_dict_ranges = {
11683
+ });
11684
+ __publicField(this, "_alphanum_dict_ranges", {
11027
11685
  digits: [this._digit_first_ascii, this._digit_last_ascii],
11028
11686
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
11029
11687
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11030
- };
11031
- this._alphanum_lower_dict_ranges = {
11688
+ });
11689
+ __publicField(this, "_alphanum_lower_dict_ranges", {
11032
11690
  digits: [this._digit_first_ascii, this._digit_last_ascii],
11033
11691
  lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
11034
- };
11035
- this._alphanum_upper_dict_ranges = {
11692
+ });
11693
+ __publicField(this, "_alphanum_upper_dict_ranges", {
11036
11694
  digits: [this._digit_first_ascii, this._digit_last_ascii],
11037
11695
  upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
11038
- };
11039
- this._hex_dict_ranges = {
11696
+ });
11697
+ __publicField(this, "_hex_dict_ranges", {
11040
11698
  decDigits: [this._digit_first_ascii, this._digit_last_ascii],
11041
11699
  alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
11042
- };
11043
- this.log = (...args) => {
11700
+ });
11701
+ __publicField(this, "_dict_ranges", {
11702
+ _number_dict_ranges: this._number_dict_ranges,
11703
+ _alpha_dict_ranges: this._alpha_dict_ranges,
11704
+ _alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
11705
+ _alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
11706
+ _alphanum_dict_ranges: this._alphanum_dict_ranges,
11707
+ _alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
11708
+ _alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
11709
+ _hex_dict_ranges: this._hex_dict_ranges
11710
+ });
11711
+ /* tslint:disable consistent-return */
11712
+ __publicField(this, "log", (...args) => {
11044
11713
  const finalArgs = [...args];
11045
11714
  finalArgs[0] = `[short-unique-id] ${args[0]}`;
11046
11715
  if (this.debug === true) {
@@ -11048,8 +11717,10 @@ var ShortUniqueId = (() => {
11048
11717
  return console.log(...finalArgs);
11049
11718
  }
11050
11719
  }
11051
- };
11052
- this.setDictionary = (dictionary, shuffle) => {
11720
+ });
11721
+ /* tslint:enable consistent-return */
11722
+ /** Change the dictionary after initialization. */
11723
+ __publicField(this, "setDictionary", (dictionary, shuffle) => {
11053
11724
  let finalDict;
11054
11725
  if (dictionary && Array.isArray(dictionary) && dictionary.length > 1) {
11055
11726
  finalDict = dictionary;
@@ -11058,7 +11729,7 @@ var ShortUniqueId = (() => {
11058
11729
  let i;
11059
11730
  this.dictIndex = i = 0;
11060
11731
  const rangesName = `_${dictionary}_dict_ranges`;
11061
- const ranges = this[rangesName];
11732
+ const ranges = this._dict_ranges[rangesName];
11062
11733
  Object.keys(ranges).forEach((rangeType) => {
11063
11734
  const rangeTypeKey = rangeType;
11064
11735
  this.dictRange = ranges[rangeTypeKey];
@@ -11075,12 +11746,16 @@ var ShortUniqueId = (() => {
11075
11746
  }
11076
11747
  this.dict = finalDict;
11077
11748
  this.dictLength = this.dict.length;
11078
- this.counter = 0;
11079
- };
11080
- this.seq = () => {
11749
+ this.setCounter(0);
11750
+ });
11751
+ __publicField(this, "seq", () => {
11081
11752
  return this.sequentialUUID();
11082
- };
11083
- this.sequentialUUID = () => {
11753
+ });
11754
+ /**
11755
+ * Generates UUID based on internal counter that's incremented after each ID generation.
11756
+ * @alias `const uid = new ShortUniqueId(); uid.seq();`
11757
+ */
11758
+ __publicField(this, "sequentialUUID", () => {
11084
11759
  let counterDiv;
11085
11760
  let counterRem;
11086
11761
  let id = "";
@@ -11092,8 +11767,15 @@ var ShortUniqueId = (() => {
11092
11767
  } while (counterDiv !== 0);
11093
11768
  this.counter += 1;
11094
11769
  return id;
11095
- };
11096
- this.randomUUID = (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
11770
+ });
11771
+ __publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
11772
+ return this.randomUUID(uuidLength);
11773
+ });
11774
+ /**
11775
+ * Generates UUID by creating each part randomly.
11776
+ * @alias `const uid = new ShortUniqueId(); uid.rnd(uuidLength: number);`
11777
+ */
11778
+ __publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
11097
11779
  let id;
11098
11780
  let randomPartIdx;
11099
11781
  let j;
@@ -11103,44 +11785,234 @@ var ShortUniqueId = (() => {
11103
11785
  const isPositive = uuidLength >= 0;
11104
11786
  id = "";
11105
11787
  for (j = 0; j < uuidLength; j += 1) {
11106
- randomPartIdx = parseInt((Math.random() * this.dictLength).toFixed(0), 10) % this.dictLength;
11788
+ randomPartIdx = parseInt(
11789
+ (Math.random() * this.dictLength).toFixed(0),
11790
+ 10
11791
+ ) % this.dictLength;
11107
11792
  id += this.dict[randomPartIdx];
11108
11793
  }
11109
11794
  return id;
11110
- };
11111
- this.availableUUIDs = (uuidLength = this.uuidLength) => {
11112
- return parseFloat(Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0));
11113
- };
11114
- this.approxMaxBeforeCollision = (rounds = this.availableUUIDs(this.uuidLength)) => {
11115
- return parseFloat(Math.sqrt(Math.PI / 2 * rounds).toFixed(20));
11116
- };
11117
- this.collisionProbability = (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
11118
- return parseFloat((this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20));
11119
- };
11120
- this.uniqueness = (rounds = this.availableUUIDs(this.uuidLength)) => {
11121
- const score = parseFloat((1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20));
11795
+ });
11796
+ __publicField(this, "fmt", (format, date) => {
11797
+ return this.formattedUUID(format, date);
11798
+ });
11799
+ /**
11800
+ * Generates custom UUID with the provided format string.
11801
+ * @alias `const uid = new ShortUniqueId(); uid.fmt(format: string);`
11802
+ */
11803
+ __publicField(this, "formattedUUID", (format, date) => {
11804
+ const fnMap = {
11805
+ "$r": this.randomUUID,
11806
+ "$s": this.sequentialUUID,
11807
+ "$t": this.stamp
11808
+ };
11809
+ const result = format.replace(
11810
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
11811
+ (m) => {
11812
+ const fn = m.slice(0, 2);
11813
+ const len = parseInt(m.slice(2), 10);
11814
+ if (fn === "$s") {
11815
+ return fnMap[fn]().padStart(len, "0");
11816
+ }
11817
+ if (fn === "$t" && date) {
11818
+ return fnMap[fn](len, date);
11819
+ }
11820
+ return fnMap[fn](len);
11821
+ }
11822
+ );
11823
+ return result;
11824
+ });
11825
+ /**
11826
+ * Calculates total number of possible UUIDs.
11827
+ *
11828
+ * Given that:
11829
+ *
11830
+ * - `H` is the total number of possible UUIDs
11831
+ * - `n` is the number of unique characters in the dictionary
11832
+ * - `l` is the UUID length
11833
+ *
11834
+ * Then `H` is defined as `n` to the power of `l`:
11835
+ *
11836
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11837
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%20H=n%5El"/>
11838
+ * </div>
11839
+ *
11840
+ * This function returns `H`.
11841
+ */
11842
+ __publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
11843
+ return parseFloat(
11844
+ Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
11845
+ );
11846
+ });
11847
+ /**
11848
+ * Calculates approximate number of hashes before first collision.
11849
+ *
11850
+ * Given that:
11851
+ *
11852
+ * - `H` is the total number of possible UUIDs, or in terms of this library,
11853
+ * the result of running `availableUUIDs()`
11854
+ * - the expected number of values we have to choose before finding the
11855
+ * first collision can be expressed as the quantity `Q(H)`
11856
+ *
11857
+ * Then `Q(H)` can be approximated as the square root of the product of half
11858
+ * of pi times `H`:
11859
+ *
11860
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11861
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%20Q(H)%5Capprox%5Csqrt%7B%5Cfrac%7B%5Cpi%7D%7B2%7DH%7D"/>
11862
+ * </div>
11863
+ *
11864
+ * This function returns `Q(H)`.
11865
+ *
11866
+ * (see [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution))
11867
+ */
11868
+ __publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
11869
+ return parseFloat(
11870
+ Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
11871
+ );
11872
+ });
11873
+ /**
11874
+ * Calculates probability of generating duplicate UUIDs (a collision) in a
11875
+ * given number of UUID generation rounds.
11876
+ *
11877
+ * Given that:
11878
+ *
11879
+ * - `r` is the maximum number of times that `randomUUID()` will be called,
11880
+ * or better said the number of _rounds_
11881
+ * - `H` is the total number of possible UUIDs, or in terms of this library,
11882
+ * the result of running `availableUUIDs()`
11883
+ *
11884
+ * Then the probability of collision `p(r; H)` can be approximated as the result
11885
+ * of dividing the square root of the product of half of pi times `r` by `H`:
11886
+ *
11887
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11888
+ * <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"/>
11889
+ * </div>
11890
+ *
11891
+ * This function returns `p(r; H)`.
11892
+ *
11893
+ * (see [Poisson distribution](https://en.wikipedia.org/wiki/Poisson_distribution))
11894
+ *
11895
+ * (Useful if you are wondering _"If I use this lib and expect to perform at most
11896
+ * `r` rounds of UUID generations, what is the probability that I will hit a duplicate UUID?"_.)
11897
+ */
11898
+ __publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
11899
+ return parseFloat(
11900
+ (this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
11901
+ );
11902
+ });
11903
+ /**
11904
+ * Calculate a "uniqueness" score (from 0 to 1) of UUIDs based on size of
11905
+ * dictionary and chosen UUID length.
11906
+ *
11907
+ * Given that:
11908
+ *
11909
+ * - `H` is the total number of possible UUIDs, or in terms of this library,
11910
+ * the result of running `availableUUIDs()`
11911
+ * - `Q(H)` is the approximate number of hashes before first collision,
11912
+ * or in terms of this library, the result of running `approxMaxBeforeCollision()`
11913
+ *
11914
+ * Then `uniqueness` can be expressed as the additive inverse of the probability of
11915
+ * generating a "word" I had previously generated (a duplicate) at any given iteration
11916
+ * up to the the total number of possible UUIDs expressed as the quotiend of `Q(H)` and `H`:
11917
+ *
11918
+ * <div style="background: white; padding: 5px; border-radius: 5px; overflow: hidden;">
11919
+ * <img src="https://render.githubusercontent.com/render/math?math=%5CHuge%201-%5Cfrac%7BQ(H)%7D%7BH%7D"/>
11920
+ * </div>
11921
+ *
11922
+ * (Useful if you need a value to rate the "quality" of the combination of given dictionary
11923
+ * and UUID length. The closer to 1, higher the uniqueness and thus better the quality.)
11924
+ */
11925
+ __publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
11926
+ const score = parseFloat(
11927
+ (1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
11928
+ );
11122
11929
  return score > 1 ? 1 : score < 0 ? 0 : score;
11123
- };
11124
- this.getVersion = () => {
11930
+ });
11931
+ /**
11932
+ * Return the version of this module.
11933
+ */
11934
+ __publicField(this, "getVersion", () => {
11125
11935
  return this.version;
11126
- };
11127
- this.stamp = (finalLength) => {
11936
+ });
11937
+ /**
11938
+ * Generates a UUID with a timestamp that can be extracted using `uid.parseStamp(stampString);`.
11939
+ *
11940
+ * ```js
11941
+ * const uidWithTimestamp = uid.stamp(32);
11942
+ * console.log(uidWithTimestamp);
11943
+ * // GDa608f973aRCHLXQYPTbKDbjDeVsSb3
11944
+ *
11945
+ * console.log(uid.parseStamp(uidWithTimestamp));
11946
+ * // 2021-05-03T06:24:58.000Z
11947
+ * ```
11948
+ */
11949
+ __publicField(this, "stamp", (finalLength, date) => {
11950
+ const hexStamp = Math.floor(+(date || /* @__PURE__ */ new Date()) / 1e3).toString(16);
11951
+ if (typeof finalLength === "number" && finalLength === 0) {
11952
+ return hexStamp;
11953
+ }
11128
11954
  if (typeof finalLength !== "number" || finalLength < 10) {
11129
- throw new Error("Param finalLength must be number greater than 10");
11955
+ throw new Error(
11956
+ [
11957
+ "Param finalLength must be a number greater than or equal to 10,",
11958
+ "or 0 if you want the raw hexadecimal timestamp"
11959
+ ].join("\n")
11960
+ );
11130
11961
  }
11131
- const hexStamp = Math.floor(+new Date() / 1e3).toString(16);
11132
11962
  const idLength = finalLength - 9;
11133
11963
  const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
11134
11964
  const id = this.randomUUID(idLength);
11135
- return `${id.substr(0, rndIdx)}${hexStamp}${id.substr(rndIdx)}${rndIdx.toString(16)}`;
11136
- };
11137
- this.parseStamp = (stamp) => {
11965
+ return `${id.substring(0, rndIdx)}${hexStamp}${id.substring(rndIdx)}${rndIdx.toString(16)}`;
11966
+ });
11967
+ /**
11968
+ * Extracts the date embeded in a UUID generated using the `uid.stamp(finalLength);` method.
11969
+ *
11970
+ * ```js
11971
+ * const uidWithTimestamp = uid.stamp(32);
11972
+ * console.log(uidWithTimestamp);
11973
+ * // GDa608f973aRCHLXQYPTbKDbjDeVsSb3
11974
+ *
11975
+ * console.log(uid.parseStamp(uidWithTimestamp));
11976
+ * // 2021-05-03T06:24:58.000Z
11977
+ * ```
11978
+ */
11979
+ __publicField(this, "parseStamp", (suid, format) => {
11980
+ if (format && !/t0|t[1-9]\d{1,}/.test(format)) {
11981
+ throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
11982
+ }
11983
+ const stamp = format ? format.replace(
11984
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
11985
+ (m) => {
11986
+ const fnMap = {
11987
+ "$r": (len2) => [...Array(len2)].map(() => "r").join(""),
11988
+ "$s": (len2) => [...Array(len2)].map(() => "s").join(""),
11989
+ "$t": (len2) => [...Array(len2)].map(() => "t").join("")
11990
+ };
11991
+ const fn = m.slice(0, 2);
11992
+ const len = parseInt(m.slice(2), 10);
11993
+ return fnMap[fn](len);
11994
+ }
11995
+ ).replace(
11996
+ /^(.*?)(t{8,})(.*)$/g,
11997
+ (_m, p1, p2) => {
11998
+ return suid.substring(p1.length, p1.length + p2.length);
11999
+ }
12000
+ ) : suid;
12001
+ if (stamp.length === 8) {
12002
+ return new Date(parseInt(stamp, 16) * 1e3);
12003
+ }
11138
12004
  if (stamp.length < 10) {
11139
12005
  throw new Error("Stamp length invalid");
11140
12006
  }
11141
- const rndIdx = parseInt(stamp.substr(stamp.length - 1, 1), 16);
11142
- return new Date(parseInt(stamp.substr(rndIdx, 8), 16) * 1e3);
11143
- };
12007
+ const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
12008
+ return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
12009
+ });
12010
+ /**
12011
+ * Set the counter to a specific value.
12012
+ */
12013
+ __publicField(this, "setCounter", (counter) => {
12014
+ this.counter = counter;
12015
+ });
11144
12016
  const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
11145
12017
  this.counter = 0;
11146
12018
  this.debug = false;
@@ -11149,21 +12021,40 @@ var ShortUniqueId = (() => {
11149
12021
  const {
11150
12022
  dictionary,
11151
12023
  shuffle,
11152
- length
12024
+ length,
12025
+ counter
11153
12026
  } = options;
11154
12027
  this.uuidLength = length;
11155
12028
  this.setDictionary(dictionary, shuffle);
12029
+ this.setCounter(counter);
11156
12030
  this.debug = options.debug;
11157
12031
  this.log(this.dict);
11158
- this.log(`Generator instantiated with Dictionary Size ${this.dictLength}`);
11159
- return new Proxy(this, {
11160
- apply: (target, that, args) => this.randomUUID(...args)
11161
- });
12032
+ this.log(
12033
+ `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
12034
+ );
12035
+ this.log = this.log.bind(this);
12036
+ this.setDictionary = this.setDictionary.bind(this);
12037
+ this.setCounter = this.setCounter.bind(this);
12038
+ this.seq = this.seq.bind(this);
12039
+ this.sequentialUUID = this.sequentialUUID.bind(this);
12040
+ this.rnd = this.rnd.bind(this);
12041
+ this.randomUUID = this.randomUUID.bind(this);
12042
+ this.fmt = this.fmt.bind(this);
12043
+ this.formattedUUID = this.formattedUUID.bind(this);
12044
+ this.availableUUIDs = this.availableUUIDs.bind(this);
12045
+ this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
12046
+ this.collisionProbability = this.collisionProbability.bind(this);
12047
+ this.uniqueness = this.uniqueness.bind(this);
12048
+ this.getVersion = this.getVersion.bind(this);
12049
+ this.stamp = this.stamp.bind(this);
12050
+ this.parseStamp = this.parseStamp.bind(this);
12051
+ return this;
11162
12052
  }
11163
12053
  };
12054
+ /** @hidden */
12055
+ __publicField(_ShortUniqueId, "default", _ShortUniqueId);
11164
12056
  var ShortUniqueId = _ShortUniqueId;
11165
- ShortUniqueId.default = _ShortUniqueId;
11166
- return src_exports;
12057
+ return __toCommonJS(src_exports);
11167
12058
  })();
11168
12059
  //# sourceMappingURL=short-unique-id.js.map
11169
12060
  true&&(module.exports=ShortUniqueId.default),'undefined'!=typeof window&&(ShortUniqueId=ShortUniqueId.default);
@@ -11177,6 +12068,13 @@ var ShortUniqueId = (() => {
11177
12068
 
11178
12069
  /***/ }),
11179
12070
 
12071
+ /***/ 21427:
12072
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12073
+
12074
+ module.exports = __webpack_require__(36762);
12075
+
12076
+ /***/ }),
12077
+
11180
12078
  /***/ 28936:
11181
12079
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11182
12080
 
@@ -12621,7 +13519,6 @@ __webpack_require__.r(__webpack_exports__);
12621
13519
  /* harmony export */ });
12622
13520
  /* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68322);
12623
13521
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67952);
12624
- // @ts-ignore
12625
13522
 
12626
13523
 
12627
13524
 
@@ -12642,7 +13539,7 @@ const plugin = ({
12642
13539
  visitor: {
12643
13540
  enter(element) {
12644
13541
  // eslint-disable-next-line no-param-reassign
12645
- element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid());
13542
+ element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid.randomUUID());
12646
13543
  }
12647
13544
  },
12648
13545
  post() {
@@ -12664,7 +13561,6 @@ __webpack_require__.r(__webpack_exports__);
12664
13561
  /* harmony export */ });
12665
13562
  /* harmony import */ var short_unique_id__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68322);
12666
13563
  /* harmony import */ var minim__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67952);
12667
- // @ts-ignore
12668
13564
 
12669
13565
 
12670
13566
 
@@ -12688,7 +13584,7 @@ const plugin = ({
12688
13584
  enter(element) {
12689
13585
  if (!predicates.isPrimitiveElement(element)) {
12690
13586
  // eslint-disable-next-line no-param-reassign
12691
- element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid());
13587
+ element.id = new minim__WEBPACK_IMPORTED_MODULE_1__.StringElement(uuid.randomUUID());
12692
13588
  }
12693
13589
  }
12694
13590
  },
@@ -13833,12 +14729,20 @@ __webpack_require__.r(__webpack_exports__);
13833
14729
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
13834
14730
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
13835
14731
  /* harmony export */ });
13836
- /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39723);
14732
+ /* harmony import */ var ramda_adjunct__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(39723);
13837
14733
  /* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13776);
14734
+ /* harmony import */ var _babel_runtime_corejs3_core_js_aggregate_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21427);
14735
+ var _globalThis$Aggregate;
14736
+
13838
14737
 
14738
+ // @ts-ignore
13839
14739
 
14740
+ const AggregateError = (_globalThis$Aggregate = globalThis.AggregateError) !== null && _globalThis$Aggregate !== void 0 ? _globalThis$Aggregate : _babel_runtime_corejs3_core_js_aggregate_error__WEBPACK_IMPORTED_MODULE_1__;
14741
+ /**
14742
+ * ApiDOMAggregateError is using polyfill of AggregateError from core-js-pure
14743
+ * in environments which don't support global AggregateError symbol.
14744
+ */
13840
14745
  class ApiDOMAggregateError extends AggregateError {
13841
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13842
14746
  constructor(errors, message, options) {
13843
14747
  super(errors, message, options);
13844
14748
  this.name = this.constructor.name;
@@ -13855,7 +14759,7 @@ class ApiDOMAggregateError extends AggregateError {
13855
14759
  * This needs to stay here until our minimum supported version of Node.js is >= 16.9.0.
13856
14760
  * Node.js is >= 16.9.0 supports error causes natively.
13857
14761
  */
13858
- 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)) {
14762
+ 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)) {
13859
14763
  const {
13860
14764
  cause
13861
14765
  } = options;