@itwin/core-i18n 5.8.1 → 5.8.3

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.
@@ -21343,6 +21343,69 @@ class UnexpectedErrors {
21343
21343
  }
21344
21344
 
21345
21345
 
21346
+ /***/ }),
21347
+
21348
+ /***/ "../bentley/lib/esm/UtilityFunctions.js":
21349
+ /*!**********************************************!*\
21350
+ !*** ../bentley/lib/esm/UtilityFunctions.js ***!
21351
+ \**********************************************/
21352
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
21353
+
21354
+ "use strict";
21355
+ __webpack_require__.r(__webpack_exports__);
21356
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21357
+ /* harmony export */ wrapTimerCallback: () => (/* binding */ wrapTimerCallback)
21358
+ /* harmony export */ });
21359
+ /*---------------------------------------------------------------------------------------------
21360
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
21361
+ * See LICENSE.md in the project root for license terms and full copyright notice.
21362
+ *--------------------------------------------------------------------------------------------*/
21363
+ /** @packageDocumentation
21364
+ * @module Utils
21365
+ */
21366
+ /**
21367
+ * Wrapper function designed to be used for callbacks called by setInterval or setTimeout in order to propagate any
21368
+ * exceptions thrown in the callback to the main promise chain. It does this by creating a new promise for the callback
21369
+ * invocation and adding it to the timerPromises set. The main promise chain can then await
21370
+ * Promise.all(timerPromises) to catch any exceptions thrown in any of the callbacks. Note that if the callback
21371
+ * completes successfully, the promise is resolved and removed from the set. If it throws an exception, the promise is
21372
+ * rejected but not removed from the set, so that the main promise chain can detect that an error occurred and handle
21373
+ * it appropriately.
21374
+ * @param timerPromises A set of promises representing the currently active timer callbacks.
21375
+ * @param callback The async callback to be executed within the timer.
21376
+ * @beta
21377
+ */
21378
+ async function wrapTimerCallback(timerPromises, callback) {
21379
+ let resolvePromise;
21380
+ let rejectPromise;
21381
+ // The callback of the Promise constructor does not have access to the promise itself, so all we do there is
21382
+ // capture the resolve and reject functions for use in the async callback that would have otherwise been
21383
+ // placed in the setInterval or setTimeout callback.
21384
+ const timerPromise = new Promise((resolve, reject) => {
21385
+ resolvePromise = resolve;
21386
+ rejectPromise = reject;
21387
+ });
21388
+ // Note: when we get here, resolvePromise and rejectPromise will always be defined, but there is no way to
21389
+ // convince TS of that fact without extra unnecessary checks, so we use ?. when accessing them.
21390
+ // Prevent unhandled rejection warnings. The rejection is still observable
21391
+ // when the consumer awaits Promise.all(promises).
21392
+ timerPromise.catch(() => { });
21393
+ timerPromises.add(timerPromise);
21394
+ const cleanupAndResolve = () => {
21395
+ resolvePromise?.();
21396
+ // No need to keep track of this promise anymore since it's resolved.
21397
+ timerPromises.delete(timerPromise);
21398
+ };
21399
+ try {
21400
+ await callback();
21401
+ cleanupAndResolve();
21402
+ }
21403
+ catch (err) {
21404
+ rejectPromise?.(err);
21405
+ }
21406
+ }
21407
+
21408
+
21346
21409
  /***/ }),
21347
21410
 
21348
21411
  /***/ "../bentley/lib/esm/UtilityTypes.js":
@@ -21472,12 +21535,12 @@ __webpack_require__.r(__webpack_exports__);
21472
21535
  /* harmony export */ ByteStream: () => (/* reexport safe */ _ByteStream__WEBPACK_IMPORTED_MODULE_7__.ByteStream),
21473
21536
  /* harmony export */ ChangeSetStatus: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.ChangeSetStatus),
21474
21537
  /* harmony export */ CompressedId64Set: () => (/* reexport safe */ _CompressedId64Set__WEBPACK_IMPORTED_MODULE_10__.CompressedId64Set),
21475
- /* harmony export */ DbChangeStage: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_36__.DbChangeStage),
21476
- /* harmony export */ DbConflictCause: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_36__.DbConflictCause),
21477
- /* harmony export */ DbConflictResolution: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_36__.DbConflictResolution),
21538
+ /* harmony export */ DbChangeStage: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_37__.DbChangeStage),
21539
+ /* harmony export */ DbConflictCause: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_37__.DbConflictCause),
21540
+ /* harmony export */ DbConflictResolution: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_37__.DbConflictResolution),
21478
21541
  /* harmony export */ DbOpcode: () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbOpcode),
21479
21542
  /* harmony export */ DbResult: () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbResult),
21480
- /* harmony export */ DbValueType: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_36__.DbValueType),
21543
+ /* harmony export */ DbValueType: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_37__.DbValueType),
21481
21544
  /* harmony export */ Dictionary: () => (/* reexport safe */ _Dictionary__WEBPACK_IMPORTED_MODULE_11__.Dictionary),
21482
21545
  /* harmony export */ DisposableList: () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.DisposableList),
21483
21546
  /* harmony export */ DuplicatePolicy: () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_27__.DuplicatePolicy),
@@ -21511,7 +21574,7 @@ __webpack_require__.r(__webpack_exports__);
21511
21574
  /* harmony export */ ReadonlyOrderedSet: () => (/* reexport safe */ _OrderedSet__WEBPACK_IMPORTED_MODULE_23__.ReadonlyOrderedSet),
21512
21575
  /* harmony export */ ReadonlySortedArray: () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_27__.ReadonlySortedArray),
21513
21576
  /* harmony export */ RealityDataStatus: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RealityDataStatus),
21514
- /* harmony export */ RepositoryStatus: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_36__.RepositoryStatus),
21577
+ /* harmony export */ RepositoryStatus: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_37__.RepositoryStatus),
21515
21578
  /* harmony export */ RpcInterfaceStatus: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RpcInterfaceStatus),
21516
21579
  /* harmony export */ SortedArray: () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_27__.SortedArray),
21517
21580
  /* harmony export */ SpanKind: () => (/* reexport safe */ _Tracing__WEBPACK_IMPORTED_MODULE_30__.SpanKind),
@@ -21527,9 +21590,9 @@ __webpack_require__.r(__webpack_exports__);
21527
21590
  /* harmony export */ Uint8ArrayBuilder: () => (/* reexport safe */ _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__.Uint8ArrayBuilder),
21528
21591
  /* harmony export */ UintArrayBuilder: () => (/* reexport safe */ _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__.UintArrayBuilder),
21529
21592
  /* harmony export */ UnexpectedErrors: () => (/* reexport safe */ _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_33__.UnexpectedErrors),
21530
- /* harmony export */ YieldManager: () => (/* reexport safe */ _YieldManager__WEBPACK_IMPORTED_MODULE_35__.YieldManager),
21593
+ /* harmony export */ YieldManager: () => (/* reexport safe */ _YieldManager__WEBPACK_IMPORTED_MODULE_36__.YieldManager),
21531
21594
  /* harmony export */ areEqualPossiblyUndefined: () => (/* reexport safe */ _Compare__WEBPACK_IMPORTED_MODULE_9__.areEqualPossiblyUndefined),
21532
- /* harmony export */ asInstanceOf: () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_34__.asInstanceOf),
21595
+ /* harmony export */ asInstanceOf: () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_35__.asInstanceOf),
21533
21596
  /* harmony export */ assert: () => (/* reexport safe */ _Assert__WEBPACK_IMPORTED_MODULE_1__.assert),
21534
21597
  /* harmony export */ base64StringToUint8Array: () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_28__.base64StringToUint8Array),
21535
21598
  /* harmony export */ compareArrays: () => (/* reexport safe */ _Compare__WEBPACK_IMPORTED_MODULE_9__.compareArrays),
@@ -21549,15 +21612,16 @@ __webpack_require__.r(__webpack_exports__);
21549
21612
  /* harmony export */ expectNotNull: () => (/* reexport safe */ _Expect__WEBPACK_IMPORTED_MODULE_13__.expectNotNull),
21550
21613
  /* harmony export */ isDisposable: () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.isDisposable),
21551
21614
  /* harmony export */ isIDisposable: () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.isIDisposable),
21552
- /* harmony export */ isInstanceOf: () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_34__.isInstanceOf),
21615
+ /* harmony export */ isInstanceOf: () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_35__.isInstanceOf),
21553
21616
  /* harmony export */ isProperSubclassOf: () => (/* reexport safe */ _ClassUtils__WEBPACK_IMPORTED_MODULE_8__.isProperSubclassOf),
21554
21617
  /* harmony export */ isSubclassOf: () => (/* reexport safe */ _ClassUtils__WEBPACK_IMPORTED_MODULE_8__.isSubclassOf),
21555
21618
  /* harmony export */ lowerBound: () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_27__.lowerBound),
21556
- /* harmony export */ omit: () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_34__.omit),
21619
+ /* harmony export */ omit: () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_35__.omit),
21557
21620
  /* harmony export */ partitionArray: () => (/* reexport safe */ _partitionArray__WEBPACK_IMPORTED_MODULE_24__.partitionArray),
21558
21621
  /* harmony export */ shallowClone: () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_27__.shallowClone),
21559
21622
  /* harmony export */ using: () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.using),
21560
- /* harmony export */ utf8ToString: () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_28__.utf8ToString)
21623
+ /* harmony export */ utf8ToString: () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_28__.utf8ToString),
21624
+ /* harmony export */ wrapTimerCallback: () => (/* reexport safe */ _UtilityFunctions__WEBPACK_IMPORTED_MODULE_34__.wrapTimerCallback)
21561
21625
  /* harmony export */ });
21562
21626
  /* harmony import */ var _AccessToken__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AccessToken */ "../bentley/lib/esm/AccessToken.js");
21563
21627
  /* harmony import */ var _Assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Assert */ "../bentley/lib/esm/Assert.js");
@@ -21593,9 +21657,10 @@ __webpack_require__.r(__webpack_exports__);
21593
21657
  /* harmony import */ var _TupleKeyedMap__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./TupleKeyedMap */ "../bentley/lib/esm/TupleKeyedMap.js");
21594
21658
  /* harmony import */ var _TypedArrayBuilder__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./TypedArrayBuilder */ "../bentley/lib/esm/TypedArrayBuilder.js");
21595
21659
  /* harmony import */ var _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./UnexpectedErrors */ "../bentley/lib/esm/UnexpectedErrors.js");
21596
- /* harmony import */ var _UtilityTypes__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./UtilityTypes */ "../bentley/lib/esm/UtilityTypes.js");
21597
- /* harmony import */ var _YieldManager__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./YieldManager */ "../bentley/lib/esm/YieldManager.js");
21598
- /* harmony import */ var _internal_cross_package__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./internal/cross-package */ "../bentley/lib/esm/internal/cross-package.js");
21660
+ /* harmony import */ var _UtilityFunctions__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./UtilityFunctions */ "../bentley/lib/esm/UtilityFunctions.js");
21661
+ /* harmony import */ var _UtilityTypes__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./UtilityTypes */ "../bentley/lib/esm/UtilityTypes.js");
21662
+ /* harmony import */ var _YieldManager__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./YieldManager */ "../bentley/lib/esm/YieldManager.js");
21663
+ /* harmony import */ var _internal_cross_package__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./internal/cross-package */ "../bentley/lib/esm/internal/cross-package.js");
21599
21664
  /*---------------------------------------------------------------------------------------------
21600
21665
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
21601
21666
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -21634,6 +21699,7 @@ __webpack_require__.r(__webpack_exports__);
21634
21699
 
21635
21700
 
21636
21701
 
21702
+
21637
21703
 
21638
21704
 
21639
21705
  // Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.