@dereekb/util 10.1.3 → 10.1.5

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.
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.5](https://github.com/dereekb/dbx-components/compare/v10.1.4-dev...v10.1.5) (2024-03-22)
6
+
7
+
8
+
9
+ ## [10.1.4](https://github.com/dereekb/dbx-components/compare/v10.1.3-dev...v10.1.4) (2024-03-14)
10
+
11
+
12
+
5
13
  ## [10.1.3](https://github.com/dereekb/dbx-components/compare/v10.1.2-dev...v10.1.3) (2024-03-11)
6
14
 
7
15
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/fetch",
3
- "version": "10.1.3",
3
+ "version": "10.1.5",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"
package/index.cjs.js CHANGED
@@ -10490,12 +10490,6 @@ function readableError(code, message) {
10490
10490
  message
10491
10491
  };
10492
10492
  }
10493
- /**
10494
- * Converts the input error content to a ReadableError or CodedError.
10495
- *
10496
- * @param inputError
10497
- * @returns
10498
- */
10499
10493
  function toReadableError(inputError) {
10500
10494
  let error;
10501
10495
  if (inputError) {
@@ -13133,7 +13127,7 @@ function spaceSeparatedCssClasses(cssClasses) {
13133
13127
  function cssClassesSet(cssClasses) {
13134
13128
  let result;
13135
13129
  if (cssClasses) {
13136
- const arrayOfClasses = asArray(cssClasses);
13130
+ const arrayOfClasses = iterableToArray(cssClasses, false);
13137
13131
  const arrayOfAllClassValues = arrayOfClasses.map(x => asArray(x).map(x => x.split(' ')).flat()).flat();
13138
13132
  result = new Set(arrayOfAllClassValues);
13139
13133
  } else {
@@ -13689,6 +13683,132 @@ function timePeriodCounter(timePeriodLength, lastTimePeriodStart) {
13689
13683
  fn._reset = reset;
13690
13684
  return fn;
13691
13685
  }
13686
+ class TimerCancelledError extends makeError.BaseError {
13687
+ constructor() {
13688
+ super(`The timer was destroyed before it was completed.`);
13689
+ }
13690
+ }
13691
+ class TimerInstance {
13692
+ constructor(duration, startImmediately = true) {
13693
+ this._createdAt = new Date();
13694
+ this._startedAt = new Date();
13695
+ this._state = 'paused';
13696
+ this._promiseRef = promiseReference();
13697
+ this._duration = duration;
13698
+ if (startImmediately) {
13699
+ this.start();
13700
+ this._startedAt = this._createdAt;
13701
+ }
13702
+ }
13703
+ get state() {
13704
+ return this._state;
13705
+ }
13706
+ get createdAt() {
13707
+ return this._createdAt;
13708
+ }
13709
+ get pausedAt() {
13710
+ return this._pausedAt;
13711
+ }
13712
+ get startedAt() {
13713
+ return this._startedAt;
13714
+ }
13715
+ get promise() {
13716
+ return this._promiseRef.promise;
13717
+ }
13718
+ get duration() {
13719
+ return this._duration;
13720
+ }
13721
+ get durationRemaining() {
13722
+ let remaining;
13723
+ switch (this._state) {
13724
+ case 'complete':
13725
+ remaining = 0;
13726
+ break;
13727
+ case 'running':
13728
+ remaining = Math.max(0, this._duration - (new Date().getTime() - this._startedAt.getTime()));
13729
+ break;
13730
+ case 'paused':
13731
+ remaining = null;
13732
+ break;
13733
+ }
13734
+ return remaining;
13735
+ }
13736
+ start() {
13737
+ if (this._state === 'paused') {
13738
+ this._state = 'running';
13739
+ this._startedAt = new Date();
13740
+ this._enqueueCheck();
13741
+ }
13742
+ }
13743
+ stop() {
13744
+ if (this._state === 'running') {
13745
+ this._state = 'paused';
13746
+ this._pausedAt = new Date();
13747
+ }
13748
+ }
13749
+ reset() {
13750
+ if (this._state !== 'complete') {
13751
+ this._state = 'running';
13752
+ this._startedAt = new Date();
13753
+ this._enqueueCheck();
13754
+ }
13755
+ }
13756
+ setDuration(duration) {
13757
+ this._duration = duration;
13758
+ }
13759
+ destroy() {
13760
+ this._checkComplete();
13761
+ if (this._state === 'running') {
13762
+ const error = new TimerCancelledError();
13763
+ this._promiseRef.reject(error);
13764
+ this._state = 'complete'; // mark as complete
13765
+ }
13766
+ }
13767
+
13768
+ _checkComplete() {
13769
+ if (this._state !== 'complete' && this.durationRemaining === 0) {
13770
+ this._state = 'complete';
13771
+ this._promiseRef.resolve();
13772
+ }
13773
+ }
13774
+ _enqueueCheck() {
13775
+ const durationRemaining = this.durationRemaining;
13776
+ if (durationRemaining != null && this._state !== 'complete') {
13777
+ setTimeout(() => {
13778
+ this._checkComplete();
13779
+ this._enqueueCheck();
13780
+ }, durationRemaining);
13781
+ }
13782
+ }
13783
+ }
13784
+ function timer(duration, startNow = true) {
13785
+ return new TimerInstance(duration, startNow);
13786
+ }
13787
+ /**
13788
+ * Toggles the input Timer's running state.
13789
+ *
13790
+ * @param timer
13791
+ * @param toggleRun
13792
+ */
13793
+ function toggleTimerRunning(timer, toggleRun) {
13794
+ toggleRun = toggleRun != null ? toggleRun : timer.state !== 'running';
13795
+ if (toggleRun) {
13796
+ timer.start();
13797
+ } else {
13798
+ timer.stop();
13799
+ }
13800
+ }
13801
+ /**
13802
+ * Returns the approximate end date of the given timer. If a timer is already complete, it returns the time for now.
13803
+ */
13804
+ function approximateTimerEndDate(timer) {
13805
+ const durationRemaining = timer.durationRemaining;
13806
+ if (durationRemaining != null) {
13807
+ return new Date(Date.now() + durationRemaining);
13808
+ } else {
13809
+ return null;
13810
+ }
13811
+ }
13692
13812
 
13693
13813
  exports.TimeAM = void 0;
13694
13814
  (function (TimeAM) {
@@ -13978,6 +14098,8 @@ exports.TOTAL_LONGITUDE_RANGE = TOTAL_LONGITUDE_RANGE;
13978
14098
  exports.TOTAL_SPAN_OF_LONGITUDE = TOTAL_SPAN_OF_LONGITUDE;
13979
14099
  exports.TRAILING_FILE_TYPE_SEPARATORS_REGEX = TRAILING_FILE_TYPE_SEPARATORS_REGEX;
13980
14100
  exports.TRAILING_SLASHES_REGEX = TRAILING_SLASHES_REGEX;
14101
+ exports.TimerCancelledError = TimerCancelledError;
14102
+ exports.TimerInstance = TimerInstance;
13981
14103
  exports.TypedServiceRegistryInstance = TypedServiceRegistryInstance;
13982
14104
  exports.UNLOADED_PAGE = UNLOADED_PAGE;
13983
14105
  exports.US_STATE_CODE_STRING_REGEX = US_STATE_CODE_STRING_REGEX;
@@ -14009,6 +14131,7 @@ exports.allValuesAreNotMaybe = allValuesAreNotMaybe;
14009
14131
  exports.allowValueOnceFilter = allowValueOnceFilter;
14010
14132
  exports.applyBestFit = applyBestFit;
14011
14133
  exports.applyToMultipleFields = applyToMultipleFields;
14134
+ exports.approximateTimerEndDate = approximateTimerEndDate;
14012
14135
  exports.areEqualContext = areEqualContext;
14013
14136
  exports.areEqualPOJOValues = areEqualPOJOValues;
14014
14137
  exports.arrayContainsDuplicateValue = arrayContainsDuplicateValue;
@@ -14622,6 +14745,7 @@ exports.telUrlStringForE164PhoneNumberPair = telUrlStringForE164PhoneNumberPair;
14622
14745
  exports.terminatingFactoryFromArray = terminatingFactoryFromArray;
14623
14746
  exports.throwKeyIsRequired = throwKeyIsRequired;
14624
14747
  exports.timePeriodCounter = timePeriodCounter;
14748
+ exports.timer = timer;
14625
14749
  exports.toAbsoluteSlashPathStartType = toAbsoluteSlashPathStartType;
14626
14750
  exports.toCaseInsensitiveStringArray = toCaseInsensitiveStringArray;
14627
14751
  exports.toModelFieldConversions = toModelFieldConversions;
@@ -14630,6 +14754,7 @@ exports.toReadableError = toReadableError;
14630
14754
  exports.toRelativeSlashPathStartType = toRelativeSlashPathStartType;
14631
14755
  exports.toggleInSet = toggleInSet;
14632
14756
  exports.toggleInSetCopy = toggleInSetCopy;
14757
+ exports.toggleTimerRunning = toggleTimerRunning;
14633
14758
  exports.transformNumberFunction = transformNumberFunction;
14634
14759
  exports.transformNumberFunctionConfig = transformNumberFunctionConfig;
14635
14760
  exports.transformStringFunction = transformStringFunction;
package/index.esm.js CHANGED
@@ -13158,12 +13158,14 @@ function readableError(code, message) {
13158
13158
  message
13159
13159
  };
13160
13160
  }
13161
+
13161
13162
  /**
13162
13163
  * Converts the input error content to a ReadableError or CodedError.
13163
13164
  *
13164
13165
  * @param inputError
13165
13166
  * @returns
13166
13167
  */
13168
+
13167
13169
  function toReadableError(inputError) {
13168
13170
  let error;
13169
13171
  if (inputError) {
@@ -15089,7 +15091,7 @@ function spaceSeparatedCssClasses(cssClasses) {
15089
15091
  function cssClassesSet(cssClasses) {
15090
15092
  let result;
15091
15093
  if (cssClasses) {
15092
- const arrayOfClasses = asArray(cssClasses);
15094
+ const arrayOfClasses = iterableToArray(cssClasses, false);
15093
15095
  const arrayOfAllClassValues = arrayOfClasses.map(x => asArray(x).map(x => x.split(' ')).flat()).flat();
15094
15096
  result = new Set(arrayOfAllClassValues);
15095
15097
  } else {
@@ -15344,6 +15346,10 @@ function randomBoolean(chance = 50) {
15344
15346
  })();
15345
15347
  }
15346
15348
 
15349
+ /**
15350
+ * The past or future direction.
15351
+ */
15352
+
15347
15353
  /**
15348
15354
  * A valid ISO8601 formatted date string.
15349
15355
  *
@@ -15858,6 +15864,145 @@ function timePeriodCounter(timePeriodLength, lastTimePeriodStart) {
15858
15864
  return fn;
15859
15865
  }
15860
15866
 
15867
+ /**
15868
+ * Timer object that counts down a fixed duration amount.
15869
+ *
15870
+ * The timer is not required to start immediately.
15871
+ *
15872
+ * Once the timer has complete it cannot be reset.
15873
+ */
15874
+
15875
+ class TimerCancelledError extends BaseError {
15876
+ constructor() {
15877
+ super(`The timer was destroyed before it was completed.`);
15878
+ }
15879
+ }
15880
+ class TimerInstance {
15881
+ constructor(duration, startImmediately = true) {
15882
+ this._createdAt = new Date();
15883
+ this._startedAt = new Date();
15884
+ this._pausedAt = void 0;
15885
+ this._state = 'paused';
15886
+ this._duration = void 0;
15887
+ this._promiseRef = promiseReference();
15888
+ this._duration = duration;
15889
+ if (startImmediately) {
15890
+ this.start();
15891
+ this._startedAt = this._createdAt;
15892
+ }
15893
+ }
15894
+ get state() {
15895
+ return this._state;
15896
+ }
15897
+ get createdAt() {
15898
+ return this._createdAt;
15899
+ }
15900
+ get pausedAt() {
15901
+ return this._pausedAt;
15902
+ }
15903
+ get startedAt() {
15904
+ return this._startedAt;
15905
+ }
15906
+ get promise() {
15907
+ return this._promiseRef.promise;
15908
+ }
15909
+ get duration() {
15910
+ return this._duration;
15911
+ }
15912
+ get durationRemaining() {
15913
+ let remaining;
15914
+ switch (this._state) {
15915
+ case 'complete':
15916
+ remaining = 0;
15917
+ break;
15918
+ case 'running':
15919
+ remaining = Math.max(0, this._duration - (new Date().getTime() - this._startedAt.getTime()));
15920
+ break;
15921
+ case 'paused':
15922
+ remaining = null;
15923
+ break;
15924
+ }
15925
+ return remaining;
15926
+ }
15927
+ start() {
15928
+ if (this._state === 'paused') {
15929
+ this._state = 'running';
15930
+ this._startedAt = new Date();
15931
+ this._enqueueCheck();
15932
+ }
15933
+ }
15934
+ stop() {
15935
+ if (this._state === 'running') {
15936
+ this._state = 'paused';
15937
+ this._pausedAt = new Date();
15938
+ }
15939
+ }
15940
+ reset() {
15941
+ if (this._state !== 'complete') {
15942
+ this._state = 'running';
15943
+ this._startedAt = new Date();
15944
+ this._enqueueCheck();
15945
+ }
15946
+ }
15947
+ setDuration(duration) {
15948
+ this._duration = duration;
15949
+ }
15950
+ destroy() {
15951
+ this._checkComplete();
15952
+ if (this._state === 'running') {
15953
+ const error = new TimerCancelledError();
15954
+ this._promiseRef.reject(error);
15955
+ this._state = 'complete'; // mark as complete
15956
+ }
15957
+ }
15958
+
15959
+ _checkComplete() {
15960
+ if (this._state !== 'complete' && this.durationRemaining === 0) {
15961
+ this._state = 'complete';
15962
+ this._promiseRef.resolve();
15963
+ }
15964
+ }
15965
+ _enqueueCheck() {
15966
+ const durationRemaining = this.durationRemaining;
15967
+ if (durationRemaining != null && this._state !== 'complete') {
15968
+ setTimeout(() => {
15969
+ this._checkComplete();
15970
+ this._enqueueCheck();
15971
+ }, durationRemaining);
15972
+ }
15973
+ }
15974
+ }
15975
+ function timer(duration, startNow = true) {
15976
+ return new TimerInstance(duration, startNow);
15977
+ }
15978
+
15979
+ /**
15980
+ * Toggles the input Timer's running state.
15981
+ *
15982
+ * @param timer
15983
+ * @param toggleRun
15984
+ */
15985
+ function toggleTimerRunning(timer, toggleRun) {
15986
+ toggleRun = toggleRun != null ? toggleRun : timer.state !== 'running';
15987
+ if (toggleRun) {
15988
+ timer.start();
15989
+ } else {
15990
+ timer.stop();
15991
+ }
15992
+ }
15993
+
15994
+ /**
15995
+ * Returns the approximate end date of the given timer. If a timer is already complete, it returns the time for now.
15996
+ */
15997
+ function approximateTimerEndDate(timer) {
15998
+ const durationRemaining = timer.durationRemaining;
15999
+ if (durationRemaining != null) {
16000
+ return new Date(Date.now() + durationRemaining);
16001
+ } else {
16002
+ return null;
16003
+ }
16004
+ }
16005
+
15861
16006
  /**
15862
16007
  * Represents a string for a time. This may be human-input, and
15863
16008
  * can be interpreted in various ways depending on the input.
@@ -16098,4 +16243,4 @@ async function iterateFilteredPages(inputPage, loadFn, iterFn) {
16098
16243
  return count;
16099
16244
  }
16100
16245
 
16101
- export { ALL_DOUBLE_SLASHES_REGEX, ALL_SLASHES_REGEX, ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX, ASSERTION_ERROR_CODE, ASSERTION_HANDLER, AUTH_ADMIN_ROLE, AUTH_ONBOARDED_ROLE, AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE, AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE, AUTH_TOS_SIGNED_ROLE, AUTH_USER_ROLE, AbstractUniqueModel, Assert, AssertMax, AssertMin, AssertionError, AssertionIssueHandler, BooleanKeyArrayUtilityInstance, BooleanStringKeyArrayUtilityInstance, CATCH_ALL_HANDLE_RESULT_KEY, CUT_VALUE_TO_ZERO_PRECISION, DATE_NOW_VALUE, DEFAULT_LAT_LNG_STRING_VALUE, DEFAULT_RANDOM_EMAIL_FACTORY_CONFIG, DEFAULT_RANDOM_PHONE_NUMBER_FACTORY_CONFIG, DEFAULT_READABLE_ERROR_CODE, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT, DEFAULT_UNKNOWN_MODEL_TYPE_STRING, DOLLAR_AMOUNT_PRECISION, DOLLAR_AMOUNT_STRING_REGEX, DataDoesNotExistError, DataIsExpiredError, Day, DestroyFunctionObject, E164PHONE_NUMBER_REGEX, E164PHONE_NUMBER_WITH_EXTENSION_REGEX, E164PHONE_NUMBER_WITH_OPTIONAL_EXTENSION_REGEX, FINAL_PAGE, FIRST_PAGE, FRACTIONAL_HOURS_PRECISION_FUNCTION, FullStorageObject, HAS_WEBSITE_DOMAIN_NAME_REGEX, HOURS_IN_DAY, HTTP_OR_HTTPS_REGEX, HashSet, ISO8601_DAY_STRING_REGEX, ISO8601_DAY_STRING_START_REGEX, ISO_8601_DATE_STRING_REGEX, KeyValueTypleValueFilter, LAT_LNG_PATTERN, LAT_LNG_PATTERN_MAX_PRECISION, LAT_LONG_100KM_PRECISION, LAT_LONG_100M_PRECISION, LAT_LONG_10CM_PRECISION, LAT_LONG_10KM_PRECISION, LAT_LONG_10M_PRECISION, LAT_LONG_1CM_PRECISION, LAT_LONG_1KM_PRECISION, LAT_LONG_1MM_PRECISION, LAT_LONG_1M_PRECISION, LAT_LONG_GRAINS_OF_SAND_PRECISION, LEADING_SLASHES_REGEX, MAP_IDENTITY, MAX_BITWISE_SET_SIZE, MAX_LATITUDE_VALUE, MAX_LONGITUDE_VALUE, MINUTES_IN_DAY, MINUTES_IN_HOUR, MIN_LATITUDE_VALUE, MIN_LONGITUDE_VALUE, MONTH_DAY_SLASH_DATE_STRING_REGEX, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, MS_IN_SECOND, MemoryStorageInstance, ModelRelationUtility, NOOP_MODIFIER, PHONE_EXTENSION_NUMBER_REGEX, PRIMATIVE_KEY_DENCODER_VALUE, PageCalculator, PropertyDescriptorUtility, REGEX_SPECIAL_CHARACTERS, REGEX_SPECIAL_CHARACTERS_SET, RelationChange, SECONDS_IN_MINUTE, SHARED_MEMORY_STORAGE, SLASH_PATH_FILE_TYPE_SEPARATOR, SLASH_PATH_SEPARATOR, SORT_VALUE_EQUAL, SORT_VALUE_GREATER_THAN, SORT_VALUE_LESS_THAN, ServerErrorResponse, SetDeltaChange, SimpleStorageObject, StorageObject, StorageObjectUtility, StoredDataError, SyncState, TOTAL_LATITUDE_RANGE, TOTAL_LONGITUDE_RANGE, TOTAL_SPAN_OF_LONGITUDE, TRAILING_FILE_TYPE_SEPARATORS_REGEX, TRAILING_SLASHES_REGEX, TimeAM, TypedServiceRegistryInstance, UNLOADED_PAGE, US_STATE_CODE_STRING_REGEX, UTC_DATE_STRING_REGEX, UTC_TIMEZONE_STRING, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, UnauthorizedServerErrorResponse, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applyBestFit, applyToMultipleFields, areEqualContext, areEqualPOJOValues, arrayContainsDuplicateValue, arrayContentsDiffer, arrayDecision, arrayDecisionFunction, arrayFactory, arrayInputFactory, arrayToLowercase, arrayToMap, arrayToObject, arrayToUppercase, asArray, asDecisionFunction, asGetter, asIndexRangeCheckFunctionConfig, asIterable, asNumber, asObjectCopyFactory, asPromise, asSet, assignValuesToPOJO, assignValuesToPOJOFunction, authClaims, authRoleClaimsService, authRolesSetHasRoles, baseWebsiteUrl, batch, batchCalc, bitwiseObjectDencoder, bitwiseObjectEncoder, bitwiseObjectdecoder, bitwiseSetDecoder, bitwiseSetDencoder, booleanFactory, boundNumber, boundNumberFunction, boundToRectangle, build, cachedGetter, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, coerceToEmailParticipants, combineMaps, compareEqualityWithValueFromItemsFunction, compareEqualityWithValueFromItemsFunctionFactory, compareFnOrder, compareWithMappedValuesFunction, computeNextFractionalHour, computeNextFreeIndexFunction, concatArrays, concatArraysUnique, containsAllStringsAnyCase, containsAllValues, containsAnyStringAnyCase, containsAnyValue, containsAnyValueFromSet, containsNoValueFromSet, containsNoneOfValue, containsStringAnyCase, convertEmailParticipantStringToParticipant, convertMaybeToArray, convertParticipantToEmailParticipantString, convertToArray, copyArray, copyField, copyLatLngBound, copyLatLngPoint, copyObject, copySetAndDo, countAllInNestedArray, countPOJOKeys, countPOJOKeysFunction, cronExpressionRepeatingEveryNMinutes, cssClassesSet, cutToPrecision, cutValueToInteger, cutValueToPrecision, cutValueToPrecisionFunction, dateFromLogicalDate, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandTreeFunction, expandTrees, extendLatLngBound, filterAndMapFunction, filterEmptyValues, filterFalsyAndEmptyValues, filterFromIterable, filterFromPOJO, filterFromPOJOFunction, filterKeyValueTupleFunction, filterKeyValueTuples, filterKeyValueTuplesFunction, filterKeyValueTuplesInputToFilter, filterMaybeValues, filterNullAndUndefinedValues, filterOnlyUndefinedValues, filterUndefinedValues, filterUniqueCaseInsensitiveStrings, filterUniqueFunction, filterUniqueTransform, filterUniqueValues, filterValuesByDistance, filterValuesByDistanceNoOrder, filterValuesToSet, filterValuesUsingSet, filteredPage, findAllCharacterOccurences, findAllCharacterOccurencesFunction, findBest, findBestIndexMatch, findBestIndexMatchFunction, findBestIndexSetPair, findFirstCharacterOccurence, findInIterable, findIndexOfFirstDuplicateValue, findItemsByIndex, findNext, findPOJOKeys, findPOJOKeysFunction, findStringsRegexString, findToIndexSet, findValuesFrom, firstAndLastCharacterOccurrence, firstAndLastValue, firstValue, firstValueFromIterable, fitToIndexRangeFunction, fixExtraQueryParameters, fixMultiSlashesInSlashPath, flattenArray, flattenArrayOrValueArray, flattenArrayToSet, flattenArrayUnique, flattenArrayUniqueCaseInsensitiveStrings, flattenTree, flattenTreeToArray, flattenTreeToArrayFunction, flattenTrees, forEachInIterable, forEachKeyValue, forEachKeyValueOnPOJOFunction, forEachWithArray, forwardFunction, fractionalHoursToMinutes, generateIfDoesNotExist, getArrayNextIndex, getDayOffset, getDayTomorrow, getDayYesterday, getDaysOfWeekNames, getFunctionType, getNextDay, getNextPageNumber, getOverlappingRectangle, getPageNumber, getPreviousDay, getValueFromGetter, groupValues, handlerBindAccessor, handlerConfigurerFactory, handlerFactory, handlerMappedSetFunction, handlerMappedSetFunctionFactory, handlerSetFunction, hasDifferentStringsNoCase, hasDifferentValues, hasHttpPrefix, hasNonNullValue, hasSameTimezone, hasSameValues, hasValueFunction, hasValueOrNotEmpty, hasValueOrNotEmptyObject, hasWebsiteDomain, hashSetForIndexed, hourToFractionalHour, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, isAllowed, isClassLikeType, isCompleteUnitedStatesAddress, isConsideredUtcTimezoneString, isDate, isDefaultLatLngPoint, isDefaultLatLngPointValue, isDefaultReadableError, isDefinedAndNotFalse, isDollarAmountString, isE164PhoneNumber, isE164PhoneNumberWithExtension, isEmptyIterable, isEqualContext, isEqualToValueDecisionFunction, isEvenNumber, isFalseBooleanKeyArray, isFinalPage, isGetter, isISO8601DateString, isISO8601DayString, isISO8601DayStringStart, isInAllowedDaysOfWeekSet, isInNumberBoundFunction, isInSetDecisionFunction, isIndexNumberInIndexRange, isIndexNumberInIndexRangeFunction, isIndexRangeInIndexRange, isIndexRangeInIndexRangeFunction, isIterable, isLatLngBound, isLatLngBoundWithinLatLngBound, isLatLngPoint, isLatLngPointWithinLatLngBound, isLatLngString, isLogicalDateStringCode, isMapIdentityFunction, isMaybeNot, isMaybeNotOrTrue, isMaybeSo, isModelKey, isMonthDaySlashDate, isNonClassFunction, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStringOrTrue, isTrueBooleanKeyArray, isUTCDateString, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStringsWithSpaces, keepCharactersAfterFirstCharacterOccurence, keepCharactersAfterFirstCharacterOccurenceFunction, keepFromSetCopy, keepValuesFromArray, keepValuesFromSet, keyValueMapFactory, lastValue, latLngBound, latLngBoundCenterPoint, latLngBoundEastBound, latLngBoundFromInput, latLngBoundFullyWrapsMap, latLngBoundFunction, latLngBoundNorthBound, latLngBoundNorthEastPoint, latLngBoundNorthWestPoint, latLngBoundOverlapsLatLngBound, latLngBoundSouthBound, latLngBoundSouthEastPoint, latLngBoundSouthWestPoint, latLngBoundStrictlyWrapsMap, latLngBoundTuple, latLngBoundTupleFunction, latLngBoundWestBound, latLngBoundWrapsMap, latLngDataPointFunction, latLngPoint, latLngPointFromString, latLngPointFunction, latLngPointPrecisionFunction, latLngString, latLngStringFunction, latLngTuple, latLngTupleFunction, limitArray, lonLatTuple, lowercaseFirstLetter, mailToUrlString, makeBestFit, makeCopyModelFieldFunction, makeDateMonthForMonthOfYear, makeGetter, makeHandler, makeHashDecodeMap, makeKeyPairs, makeModelConversionFieldValuesFunction, makeModelMap, makeModelMapFunctions, makeMultiModelKeyMap, makeValuesGroupMap, makeWithFactory, makeWithFactoryInput, mapArrayFunction, mapFunctionOutput, mapFunctionOutputPair, mapGetter, mapGetterFactory, mapIdentityFunction, mapIterable, mapKeysIntersectionObjectToArray, mapMaybeFunction, mapObjectMap, mapObjectMapFunction, mapObjectToTargetObject, mapPromiseOrValue, mapToObject, mapToTuples, mapValuesToSet, mappedUseAsyncFunction, mappedUseFunction, mapsHaveSameKeys, maybeMergeModelModifiers, maybeMergeModifiers, maybeModifierMapToFunction, maybeSet, mergeArrayIntoArray, mergeArrayOrValueIntoArray, mergeArrays, mergeArraysIntoArray, mergeFilterFunctions, mergeIntoArray, mergeModifiers, mergeObjects, mergeObjectsFunction, mergeSlashPaths, messageFromError, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, multiKeyValueMapFactory, multiValueMapBuilder, neMostLatLngPoint, nearestDivisibleValues, objectCopyFactory, objectDeltaArrayCompressor, objectFieldEqualityChecker, objectFlatMergeMatrix, objectHasKey, objectHasKeys, objectHasNoKeys, objectIsEmpty, objectKeyEqualityComparatorFunction, objectKeysEqualityComparatorFunction, objectMergeMatrix, objectToMap, objectToTuples, overlapsLatLngBoundFunction, overrideInObject, overrideInObjectFunctionFactory, pairGroupValues, parseISO8601DayStringToUTCDate, partialServerError, passThrough, percentNumberFromDecimal, percentNumberToDecimal, performAsyncTask, performAsyncTasks, performBatchLoop, performMakeLoop, performTaskCountLoop, performTaskLoop, performTasksFromFactoryInParallelFunction, performTasksInParallel, performTasksInParallelFunction, pickOneRandomly, poll, primativeKeyDencoder, primativeKeyDencoderMap, primativeKeyStringDencoder, primativeValuesDelta, promiseReference, protectedFactory, pushArrayItemsIntoArray, pushElementOntoArray, pushItemOrArrayItemsIntoArray, randomArrayFactory, randomArrayIndex, randomBoolean, randomEmailFactory, randomFromArrayFactory, randomLatLngFactory, randomLatLngFromCenterFactory, randomNumber, randomNumberFactory, randomPhoneNumberFactory, randomPickFactory, range, rangedIndexedValuesArrayAccessorFactory, rangedIndexedValuesArrayAccessorInfoFactory, readBooleanKeySafetyWrap, readDomainFromEmailAddress, readDomainsFromEmailAddresses, readEmailDomainFromUrlOrEmailAddress, readIndexNumber, readKeysFrom, readKeysFromFilterUniqueFunctionAdditionalKeys, readKeysFromFilterUniqueFunctionAdditionalKeysInput, readKeysFunction, readKeysSetFrom, readKeysSetFunction, readKeysToMap, readModelKey, readModelKeyFromObject, readModelKeys, readModelKeysFromObjects, readMultipleKeysToMap, readUniqueModelKey, readableError, readableStreamToBase64, readableStreamToBuffer, readableStreamToStringFunction, rectangleOverlapsRectangle, reduceBooleansFn, reduceBooleansWithAnd, reduceBooleansWithAndFn, reduceBooleansWithOr, reduceBooleansWithOrFn, reduceNumbers, reduceNumbersFn, reduceNumbersWithAdd, reduceNumbersWithAddFn, reduceNumbersWithMax, reduceNumbersWithMaxFn, reduceNumbersWithMin, reduceNumbersWithMinFn, removeByKeyFromBooleanKeyArray, removeCharactersAfterFirstCharacterOccurence, removeCharactersAfterFirstCharacterOccurenceFunction, removeExtensionFromPhoneNumber, removeFromBooleanKeyArray, removeFromSet, removeFromSetCopy, removeHttpFromUrl, removeModelsWithKey, removeModelsWithSameKey, removeModifiers, removeTrailingFileTypeSeparators, removeTrailingSlashes, removeWebProtocolPrefix, repeatString, replaceCharacterAtIndexIf, replaceCharacterAtIndexWith, replaceInvalidFilePathTypeSeparatorsInSlashPath, replaceInvalidFilePathTypeSeparatorsInSlashPathFunction, replaceLastCharacterIf, replaceLastCharacterIfIsFunction, replaceMultipleFilePathsInSlashPath, replaceStringsFunction, requireModelKey, restoreOrder, restoreOrderWithValues, reverseCompareFn, roundNumberToStepFunction, roundNumberUpToStep, roundToPrecision, roundToPrecisionFunction, roundingFunction, runAsyncTaskForValue, runAsyncTasksForValues, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, separateValues, separateValuesToSets, serverError, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, setDeltaChangeKeys, setDeltaFunction, setHasValueFunction, setIncludes, setIncludesFunction, setKeysOnMap, setWebProtocolPrefix, setsAreEquivalent, simpleSortValuesFunctionWithSortRef, slashPathFactory, slashPathInvalidError, slashPathName, slashPathParts, slashPathStartTypeFactory, slashPathType, slashPathValidationFactory, sliceIndexRangeFunction, sortAscendingIndexNumberRefFunction, sortByIndexAscendingCompareFunction, sortByIndexRangeAscendingCompareFunction, sortByLabelFunction, sortByNumberFunction, sortByStringFunction, sortCompareNumberFunction, sortNumbersAscendingFunction, sortValues, sortValuesFunctionOrMapIdentityWithSortRef, sortValuesFunctionWithSortRef, spaceSeparatedCssClasses, splitCommaSeparatedString, splitCommaSeparatedStringToSet, splitJoinNameString, splitJoinRemainder, splitStringAtFirstCharacterOccurence, splitStringAtFirstCharacterOccurenceFunction, splitStringAtIndex, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringFactoryFromFactory, stringToLowercaseFunction, stringToUppercaseFunction, stringTrimFunction, sumOfIntegersBetween, swMostLatLngPoint, symmetricDifferenceArray, symmetricDifferenceArrayBetweenSets, symmetricDifferenceWithModels, takeFront, takeLast, takeValuesFromIterable, telUrlString, telUrlStringForE164PhoneNumberPair, terminatingFactoryFromArray, throwKeyIsRequired, timePeriodCounter, toAbsoluteSlashPathStartType, toCaseInsensitiveStringArray, toModelFieldConversions, toModelMapFunctions, toReadableError, toRelativeSlashPathStartType, toggleInSet, toggleInSetCopy, transformNumberFunction, transformNumberFunctionConfig, transformStringFunction, transformStringFunctionConfig, transformStrings, trimArray, typedServiceRegistry, unique, uniqueCaseInsensitiveStrings, uniqueCaseInsensitiveStringsSet, uniqueKeys, uniqueModels, unitedStatesAddressString, urlWithoutParameters, useAsync, useCallback, useContextFunction, useIterableOrValue, useModelOrKey, usePromise, useValue, validLatLngPoint, validLatLngPointFunction, valueAtIndex, valuesAreBothNullishOrEquivalent, valuesFromPOJO, valuesFromPOJOFunction, vectorMinimumSizeResizeFunction, vectorsAreEqual, waitForMs, websiteDomainAndPathPair, websiteDomainAndPathPairFromWebsiteUrl, websitePathAndQueryPair, websitePathFromWebsiteDomainAndPath, websitePathFromWebsiteUrl, websiteUrlFromPaths, wrapIndexRangeFunction, wrapLatLngPoint, wrapLngValue, wrapMapFunctionOutput, wrapNumberFunction, wrapTuples, wrapUseAsyncFunction, wrapUseFunction };
16246
+ export { ALL_DOUBLE_SLASHES_REGEX, ALL_SLASHES_REGEX, ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX, ASSERTION_ERROR_CODE, ASSERTION_HANDLER, AUTH_ADMIN_ROLE, AUTH_ONBOARDED_ROLE, AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE, AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE, AUTH_TOS_SIGNED_ROLE, AUTH_USER_ROLE, AbstractUniqueModel, Assert, AssertMax, AssertMin, AssertionError, AssertionIssueHandler, BooleanKeyArrayUtilityInstance, BooleanStringKeyArrayUtilityInstance, CATCH_ALL_HANDLE_RESULT_KEY, CUT_VALUE_TO_ZERO_PRECISION, DATE_NOW_VALUE, DEFAULT_LAT_LNG_STRING_VALUE, DEFAULT_RANDOM_EMAIL_FACTORY_CONFIG, DEFAULT_RANDOM_PHONE_NUMBER_FACTORY_CONFIG, DEFAULT_READABLE_ERROR_CODE, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS, DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT, DEFAULT_UNKNOWN_MODEL_TYPE_STRING, DOLLAR_AMOUNT_PRECISION, DOLLAR_AMOUNT_STRING_REGEX, DataDoesNotExistError, DataIsExpiredError, Day, DestroyFunctionObject, E164PHONE_NUMBER_REGEX, E164PHONE_NUMBER_WITH_EXTENSION_REGEX, E164PHONE_NUMBER_WITH_OPTIONAL_EXTENSION_REGEX, FINAL_PAGE, FIRST_PAGE, FRACTIONAL_HOURS_PRECISION_FUNCTION, FullStorageObject, HAS_WEBSITE_DOMAIN_NAME_REGEX, HOURS_IN_DAY, HTTP_OR_HTTPS_REGEX, HashSet, ISO8601_DAY_STRING_REGEX, ISO8601_DAY_STRING_START_REGEX, ISO_8601_DATE_STRING_REGEX, KeyValueTypleValueFilter, LAT_LNG_PATTERN, LAT_LNG_PATTERN_MAX_PRECISION, LAT_LONG_100KM_PRECISION, LAT_LONG_100M_PRECISION, LAT_LONG_10CM_PRECISION, LAT_LONG_10KM_PRECISION, LAT_LONG_10M_PRECISION, LAT_LONG_1CM_PRECISION, LAT_LONG_1KM_PRECISION, LAT_LONG_1MM_PRECISION, LAT_LONG_1M_PRECISION, LAT_LONG_GRAINS_OF_SAND_PRECISION, LEADING_SLASHES_REGEX, MAP_IDENTITY, MAX_BITWISE_SET_SIZE, MAX_LATITUDE_VALUE, MAX_LONGITUDE_VALUE, MINUTES_IN_DAY, MINUTES_IN_HOUR, MIN_LATITUDE_VALUE, MIN_LONGITUDE_VALUE, MONTH_DAY_SLASH_DATE_STRING_REGEX, MS_IN_DAY, MS_IN_HOUR, MS_IN_MINUTE, MS_IN_SECOND, MemoryStorageInstance, ModelRelationUtility, NOOP_MODIFIER, PHONE_EXTENSION_NUMBER_REGEX, PRIMATIVE_KEY_DENCODER_VALUE, PageCalculator, PropertyDescriptorUtility, REGEX_SPECIAL_CHARACTERS, REGEX_SPECIAL_CHARACTERS_SET, RelationChange, SECONDS_IN_MINUTE, SHARED_MEMORY_STORAGE, SLASH_PATH_FILE_TYPE_SEPARATOR, SLASH_PATH_SEPARATOR, SORT_VALUE_EQUAL, SORT_VALUE_GREATER_THAN, SORT_VALUE_LESS_THAN, ServerErrorResponse, SetDeltaChange, SimpleStorageObject, StorageObject, StorageObjectUtility, StoredDataError, SyncState, TOTAL_LATITUDE_RANGE, TOTAL_LONGITUDE_RANGE, TOTAL_SPAN_OF_LONGITUDE, TRAILING_FILE_TYPE_SEPARATORS_REGEX, TRAILING_SLASHES_REGEX, TimeAM, TimerCancelledError, TimerInstance, TypedServiceRegistryInstance, UNLOADED_PAGE, US_STATE_CODE_STRING_REGEX, UTC_DATE_STRING_REGEX, UTC_TIMEZONE_STRING, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, UnauthorizedServerErrorResponse, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applyBestFit, applyToMultipleFields, approximateTimerEndDate, areEqualContext, areEqualPOJOValues, arrayContainsDuplicateValue, arrayContentsDiffer, arrayDecision, arrayDecisionFunction, arrayFactory, arrayInputFactory, arrayToLowercase, arrayToMap, arrayToObject, arrayToUppercase, asArray, asDecisionFunction, asGetter, asIndexRangeCheckFunctionConfig, asIterable, asNumber, asObjectCopyFactory, asPromise, asSet, assignValuesToPOJO, assignValuesToPOJOFunction, authClaims, authRoleClaimsService, authRolesSetHasRoles, baseWebsiteUrl, batch, batchCalc, bitwiseObjectDencoder, bitwiseObjectEncoder, bitwiseObjectdecoder, bitwiseSetDecoder, bitwiseSetDencoder, booleanFactory, boundNumber, boundNumberFunction, boundToRectangle, build, cachedGetter, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, coerceToEmailParticipants, combineMaps, compareEqualityWithValueFromItemsFunction, compareEqualityWithValueFromItemsFunctionFactory, compareFnOrder, compareWithMappedValuesFunction, computeNextFractionalHour, computeNextFreeIndexFunction, concatArrays, concatArraysUnique, containsAllStringsAnyCase, containsAllValues, containsAnyStringAnyCase, containsAnyValue, containsAnyValueFromSet, containsNoValueFromSet, containsNoneOfValue, containsStringAnyCase, convertEmailParticipantStringToParticipant, convertMaybeToArray, convertParticipantToEmailParticipantString, convertToArray, copyArray, copyField, copyLatLngBound, copyLatLngPoint, copyObject, copySetAndDo, countAllInNestedArray, countPOJOKeys, countPOJOKeysFunction, cronExpressionRepeatingEveryNMinutes, cssClassesSet, cutToPrecision, cutValueToInteger, cutValueToPrecision, cutValueToPrecisionFunction, dateFromLogicalDate, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandTreeFunction, expandTrees, extendLatLngBound, filterAndMapFunction, filterEmptyValues, filterFalsyAndEmptyValues, filterFromIterable, filterFromPOJO, filterFromPOJOFunction, filterKeyValueTupleFunction, filterKeyValueTuples, filterKeyValueTuplesFunction, filterKeyValueTuplesInputToFilter, filterMaybeValues, filterNullAndUndefinedValues, filterOnlyUndefinedValues, filterUndefinedValues, filterUniqueCaseInsensitiveStrings, filterUniqueFunction, filterUniqueTransform, filterUniqueValues, filterValuesByDistance, filterValuesByDistanceNoOrder, filterValuesToSet, filterValuesUsingSet, filteredPage, findAllCharacterOccurences, findAllCharacterOccurencesFunction, findBest, findBestIndexMatch, findBestIndexMatchFunction, findBestIndexSetPair, findFirstCharacterOccurence, findInIterable, findIndexOfFirstDuplicateValue, findItemsByIndex, findNext, findPOJOKeys, findPOJOKeysFunction, findStringsRegexString, findToIndexSet, findValuesFrom, firstAndLastCharacterOccurrence, firstAndLastValue, firstValue, firstValueFromIterable, fitToIndexRangeFunction, fixExtraQueryParameters, fixMultiSlashesInSlashPath, flattenArray, flattenArrayOrValueArray, flattenArrayToSet, flattenArrayUnique, flattenArrayUniqueCaseInsensitiveStrings, flattenTree, flattenTreeToArray, flattenTreeToArrayFunction, flattenTrees, forEachInIterable, forEachKeyValue, forEachKeyValueOnPOJOFunction, forEachWithArray, forwardFunction, fractionalHoursToMinutes, generateIfDoesNotExist, getArrayNextIndex, getDayOffset, getDayTomorrow, getDayYesterday, getDaysOfWeekNames, getFunctionType, getNextDay, getNextPageNumber, getOverlappingRectangle, getPageNumber, getPreviousDay, getValueFromGetter, groupValues, handlerBindAccessor, handlerConfigurerFactory, handlerFactory, handlerMappedSetFunction, handlerMappedSetFunctionFactory, handlerSetFunction, hasDifferentStringsNoCase, hasDifferentValues, hasHttpPrefix, hasNonNullValue, hasSameTimezone, hasSameValues, hasValueFunction, hasValueOrNotEmpty, hasValueOrNotEmptyObject, hasWebsiteDomain, hashSetForIndexed, hourToFractionalHour, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, isAllowed, isClassLikeType, isCompleteUnitedStatesAddress, isConsideredUtcTimezoneString, isDate, isDefaultLatLngPoint, isDefaultLatLngPointValue, isDefaultReadableError, isDefinedAndNotFalse, isDollarAmountString, isE164PhoneNumber, isE164PhoneNumberWithExtension, isEmptyIterable, isEqualContext, isEqualToValueDecisionFunction, isEvenNumber, isFalseBooleanKeyArray, isFinalPage, isGetter, isISO8601DateString, isISO8601DayString, isISO8601DayStringStart, isInAllowedDaysOfWeekSet, isInNumberBoundFunction, isInSetDecisionFunction, isIndexNumberInIndexRange, isIndexNumberInIndexRangeFunction, isIndexRangeInIndexRange, isIndexRangeInIndexRangeFunction, isIterable, isLatLngBound, isLatLngBoundWithinLatLngBound, isLatLngPoint, isLatLngPointWithinLatLngBound, isLatLngString, isLogicalDateStringCode, isMapIdentityFunction, isMaybeNot, isMaybeNotOrTrue, isMaybeSo, isModelKey, isMonthDaySlashDate, isNonClassFunction, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStringOrTrue, isTrueBooleanKeyArray, isUTCDateString, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStringsWithSpaces, keepCharactersAfterFirstCharacterOccurence, keepCharactersAfterFirstCharacterOccurenceFunction, keepFromSetCopy, keepValuesFromArray, keepValuesFromSet, keyValueMapFactory, lastValue, latLngBound, latLngBoundCenterPoint, latLngBoundEastBound, latLngBoundFromInput, latLngBoundFullyWrapsMap, latLngBoundFunction, latLngBoundNorthBound, latLngBoundNorthEastPoint, latLngBoundNorthWestPoint, latLngBoundOverlapsLatLngBound, latLngBoundSouthBound, latLngBoundSouthEastPoint, latLngBoundSouthWestPoint, latLngBoundStrictlyWrapsMap, latLngBoundTuple, latLngBoundTupleFunction, latLngBoundWestBound, latLngBoundWrapsMap, latLngDataPointFunction, latLngPoint, latLngPointFromString, latLngPointFunction, latLngPointPrecisionFunction, latLngString, latLngStringFunction, latLngTuple, latLngTupleFunction, limitArray, lonLatTuple, lowercaseFirstLetter, mailToUrlString, makeBestFit, makeCopyModelFieldFunction, makeDateMonthForMonthOfYear, makeGetter, makeHandler, makeHashDecodeMap, makeKeyPairs, makeModelConversionFieldValuesFunction, makeModelMap, makeModelMapFunctions, makeMultiModelKeyMap, makeValuesGroupMap, makeWithFactory, makeWithFactoryInput, mapArrayFunction, mapFunctionOutput, mapFunctionOutputPair, mapGetter, mapGetterFactory, mapIdentityFunction, mapIterable, mapKeysIntersectionObjectToArray, mapMaybeFunction, mapObjectMap, mapObjectMapFunction, mapObjectToTargetObject, mapPromiseOrValue, mapToObject, mapToTuples, mapValuesToSet, mappedUseAsyncFunction, mappedUseFunction, mapsHaveSameKeys, maybeMergeModelModifiers, maybeMergeModifiers, maybeModifierMapToFunction, maybeSet, mergeArrayIntoArray, mergeArrayOrValueIntoArray, mergeArrays, mergeArraysIntoArray, mergeFilterFunctions, mergeIntoArray, mergeModifiers, mergeObjects, mergeObjectsFunction, mergeSlashPaths, messageFromError, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, multiKeyValueMapFactory, multiValueMapBuilder, neMostLatLngPoint, nearestDivisibleValues, objectCopyFactory, objectDeltaArrayCompressor, objectFieldEqualityChecker, objectFlatMergeMatrix, objectHasKey, objectHasKeys, objectHasNoKeys, objectIsEmpty, objectKeyEqualityComparatorFunction, objectKeysEqualityComparatorFunction, objectMergeMatrix, objectToMap, objectToTuples, overlapsLatLngBoundFunction, overrideInObject, overrideInObjectFunctionFactory, pairGroupValues, parseISO8601DayStringToUTCDate, partialServerError, passThrough, percentNumberFromDecimal, percentNumberToDecimal, performAsyncTask, performAsyncTasks, performBatchLoop, performMakeLoop, performTaskCountLoop, performTaskLoop, performTasksFromFactoryInParallelFunction, performTasksInParallel, performTasksInParallelFunction, pickOneRandomly, poll, primativeKeyDencoder, primativeKeyDencoderMap, primativeKeyStringDencoder, primativeValuesDelta, promiseReference, protectedFactory, pushArrayItemsIntoArray, pushElementOntoArray, pushItemOrArrayItemsIntoArray, randomArrayFactory, randomArrayIndex, randomBoolean, randomEmailFactory, randomFromArrayFactory, randomLatLngFactory, randomLatLngFromCenterFactory, randomNumber, randomNumberFactory, randomPhoneNumberFactory, randomPickFactory, range, rangedIndexedValuesArrayAccessorFactory, rangedIndexedValuesArrayAccessorInfoFactory, readBooleanKeySafetyWrap, readDomainFromEmailAddress, readDomainsFromEmailAddresses, readEmailDomainFromUrlOrEmailAddress, readIndexNumber, readKeysFrom, readKeysFromFilterUniqueFunctionAdditionalKeys, readKeysFromFilterUniqueFunctionAdditionalKeysInput, readKeysFunction, readKeysSetFrom, readKeysSetFunction, readKeysToMap, readModelKey, readModelKeyFromObject, readModelKeys, readModelKeysFromObjects, readMultipleKeysToMap, readUniqueModelKey, readableError, readableStreamToBase64, readableStreamToBuffer, readableStreamToStringFunction, rectangleOverlapsRectangle, reduceBooleansFn, reduceBooleansWithAnd, reduceBooleansWithAndFn, reduceBooleansWithOr, reduceBooleansWithOrFn, reduceNumbers, reduceNumbersFn, reduceNumbersWithAdd, reduceNumbersWithAddFn, reduceNumbersWithMax, reduceNumbersWithMaxFn, reduceNumbersWithMin, reduceNumbersWithMinFn, removeByKeyFromBooleanKeyArray, removeCharactersAfterFirstCharacterOccurence, removeCharactersAfterFirstCharacterOccurenceFunction, removeExtensionFromPhoneNumber, removeFromBooleanKeyArray, removeFromSet, removeFromSetCopy, removeHttpFromUrl, removeModelsWithKey, removeModelsWithSameKey, removeModifiers, removeTrailingFileTypeSeparators, removeTrailingSlashes, removeWebProtocolPrefix, repeatString, replaceCharacterAtIndexIf, replaceCharacterAtIndexWith, replaceInvalidFilePathTypeSeparatorsInSlashPath, replaceInvalidFilePathTypeSeparatorsInSlashPathFunction, replaceLastCharacterIf, replaceLastCharacterIfIsFunction, replaceMultipleFilePathsInSlashPath, replaceStringsFunction, requireModelKey, restoreOrder, restoreOrderWithValues, reverseCompareFn, roundNumberToStepFunction, roundNumberUpToStep, roundToPrecision, roundToPrecisionFunction, roundingFunction, runAsyncTaskForValue, runAsyncTasksForValues, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, separateValues, separateValuesToSets, serverError, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, setDeltaChangeKeys, setDeltaFunction, setHasValueFunction, setIncludes, setIncludesFunction, setKeysOnMap, setWebProtocolPrefix, setsAreEquivalent, simpleSortValuesFunctionWithSortRef, slashPathFactory, slashPathInvalidError, slashPathName, slashPathParts, slashPathStartTypeFactory, slashPathType, slashPathValidationFactory, sliceIndexRangeFunction, sortAscendingIndexNumberRefFunction, sortByIndexAscendingCompareFunction, sortByIndexRangeAscendingCompareFunction, sortByLabelFunction, sortByNumberFunction, sortByStringFunction, sortCompareNumberFunction, sortNumbersAscendingFunction, sortValues, sortValuesFunctionOrMapIdentityWithSortRef, sortValuesFunctionWithSortRef, spaceSeparatedCssClasses, splitCommaSeparatedString, splitCommaSeparatedStringToSet, splitJoinNameString, splitJoinRemainder, splitStringAtFirstCharacterOccurence, splitStringAtFirstCharacterOccurenceFunction, splitStringAtIndex, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringFactoryFromFactory, stringToLowercaseFunction, stringToUppercaseFunction, stringTrimFunction, sumOfIntegersBetween, swMostLatLngPoint, symmetricDifferenceArray, symmetricDifferenceArrayBetweenSets, symmetricDifferenceWithModels, takeFront, takeLast, takeValuesFromIterable, telUrlString, telUrlStringForE164PhoneNumberPair, terminatingFactoryFromArray, throwKeyIsRequired, timePeriodCounter, timer, toAbsoluteSlashPathStartType, toCaseInsensitiveStringArray, toModelFieldConversions, toModelMapFunctions, toReadableError, toRelativeSlashPathStartType, toggleInSet, toggleInSetCopy, toggleTimerRunning, transformNumberFunction, transformNumberFunctionConfig, transformStringFunction, transformStringFunctionConfig, transformStrings, trimArray, typedServiceRegistry, unique, uniqueCaseInsensitiveStrings, uniqueCaseInsensitiveStringsSet, uniqueKeys, uniqueModels, unitedStatesAddressString, urlWithoutParameters, useAsync, useCallback, useContextFunction, useIterableOrValue, useModelOrKey, usePromise, useValue, validLatLngPoint, validLatLngPointFunction, valueAtIndex, valuesAreBothNullishOrEquivalent, valuesFromPOJO, valuesFromPOJOFunction, vectorMinimumSizeResizeFunction, vectorsAreEqual, waitForMs, websiteDomainAndPathPair, websiteDomainAndPathPairFromWebsiteUrl, websitePathAndQueryPair, websitePathFromWebsiteDomainAndPath, websitePathFromWebsiteUrl, websiteUrlFromPaths, wrapIndexRangeFunction, wrapLatLngPoint, wrapLngValue, wrapMapFunctionOutput, wrapNumberFunction, wrapTuples, wrapUseAsyncFunction, wrapUseFunction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "10.1.3",
3
+ "version": "10.1.5",
4
4
  "exports": {
5
5
  ".": {
6
6
  "types": "./src/index.d.ts",
@@ -1,4 +1,8 @@
1
1
  import { type Maybe } from '../value/maybe.type';
2
+ /**
3
+ * The past or future direction.
4
+ */
5
+ export type DateRelativeDirection = 'past' | 'future';
2
6
  /**
3
7
  * A valid ISO8601 formatted date string.
4
8
  *
@@ -199,7 +203,7 @@ export type YearNumber = number;
199
203
  /**
200
204
  * Current state of the date relative to another date.
201
205
  */
202
- export type DateRelativeState = 'past' | 'present' | 'future';
206
+ export type DateRelativeState = DateRelativeDirection | 'present';
203
207
  /**
204
208
  * Returns true if the value is a date.
205
209
  *
@@ -1,5 +1,7 @@
1
+ import { type Destroyable } from '../lifecycle';
1
2
  import { type Maybe } from '../value/maybe.type';
2
3
  import { type Milliseconds } from './date';
4
+ import { BaseError } from 'make-error';
3
5
  /**
4
6
  * Returns the number of invocations that have occurred since the period started.
5
7
  *
@@ -18,3 +20,103 @@ export type TimePeriodCounter = (() => number) & {
18
20
  readonly _reset: (start?: Date) => Date;
19
21
  };
20
22
  export declare function timePeriodCounter(timePeriodLength: number, lastTimePeriodStart?: Maybe<Date>): TimePeriodCounter;
23
+ export type TimerState = 'running' | 'paused' | 'complete';
24
+ /**
25
+ * Timer object that counts down a fixed duration amount.
26
+ *
27
+ * The timer is not required to start immediately.
28
+ *
29
+ * Once the timer has complete it cannot be reset.
30
+ */
31
+ export interface Timer extends Destroyable {
32
+ /**
33
+ * Promise that resolves once the timer is complete, or throws an error if the timer is destroyed before it completes.
34
+ */
35
+ readonly promise: Promise<void>;
36
+ /**
37
+ * Current timer state.
38
+ */
39
+ readonly state: TimerState;
40
+ /**
41
+ * The time the Timer was created originally.
42
+ */
43
+ readonly createdAt: Date;
44
+ /**
45
+ * The last time the timer was paused.
46
+ */
47
+ readonly pausedAt?: Maybe<Date>;
48
+ /**
49
+ * The last started at date, if applicable.
50
+ */
51
+ readonly startedAt?: Maybe<Date>;
52
+ /**
53
+ * The configured duration.
54
+ */
55
+ readonly duration: Milliseconds;
56
+ /**
57
+ * The number of ms remaining.
58
+ *
59
+ * If the timer is paused, this returns null.
60
+ *
61
+ * If the timer is complete, this returns 0.
62
+ */
63
+ readonly durationRemaining: Maybe<Milliseconds>;
64
+ /**
65
+ * Starts the timer if it was not running. Does nothing if already running.
66
+ */
67
+ start(): void;
68
+ /**
69
+ * Stops the timer if it was running. Does nothing if already complete.
70
+ */
71
+ stop(): void;
72
+ /**
73
+ * Resets the timer to start now. If the timer is already complete then this does nothing.
74
+ */
75
+ reset(): void;
76
+ /**
77
+ * Sets a new duration on the timer. IF the timer is already complete this does nothing.
78
+ *
79
+ * If the new duration is less than the remaining duration it stops immediately.
80
+ *
81
+ * @param duration
82
+ */
83
+ setDuration(duration: Milliseconds): void;
84
+ }
85
+ export declare class TimerCancelledError extends BaseError {
86
+ constructor();
87
+ }
88
+ export declare class TimerInstance implements Timer {
89
+ private _createdAt;
90
+ private _startedAt;
91
+ private _pausedAt?;
92
+ private _state;
93
+ private _duration;
94
+ private _promiseRef;
95
+ constructor(duration: Milliseconds, startImmediately?: boolean);
96
+ get state(): TimerState;
97
+ get createdAt(): Date;
98
+ get pausedAt(): Maybe<Date>;
99
+ get startedAt(): Date;
100
+ get promise(): Promise<void>;
101
+ get duration(): Milliseconds;
102
+ get durationRemaining(): Maybe<Milliseconds>;
103
+ start(): void;
104
+ stop(): void;
105
+ reset(): void;
106
+ setDuration(duration: Milliseconds): void;
107
+ destroy(): void;
108
+ private _checkComplete;
109
+ private _enqueueCheck;
110
+ }
111
+ export declare function timer(duration: Milliseconds, startNow?: boolean): Timer;
112
+ /**
113
+ * Toggles the input Timer's running state.
114
+ *
115
+ * @param timer
116
+ * @param toggleRun
117
+ */
118
+ export declare function toggleTimerRunning(timer: Timer, toggleRun?: boolean): void;
119
+ /**
120
+ * Returns the approximate end date of the given timer. If a timer is already complete, it returns the time for now.
121
+ */
122
+ export declare function approximateTimerEndDate(timer: Timer): Maybe<Date>;
@@ -12,26 +12,26 @@ export declare const DEFAULT_READABLE_ERROR_CODE = "ERROR";
12
12
  * An error that is identified by a unique code.
13
13
  */
14
14
  export interface CodedError {
15
- code: StringErrorCode;
15
+ readonly code: StringErrorCode;
16
16
  /**
17
17
  * The original error, if available.
18
18
  */
19
- _error?: unknown;
19
+ readonly _error?: unknown;
20
20
  }
21
21
  /**
22
22
  * An error with a human-readable message.
23
23
  */
24
24
  export interface ReadableError extends Partial<CodedError> {
25
- message?: Maybe<string>;
25
+ readonly message?: Maybe<string>;
26
26
  }
27
27
  export declare function isDefaultReadableError(error: Maybe<ReadableError | StringErrorCode>): boolean;
28
28
  export type ReadableErrorWithCode<T extends ReadableError = ReadableError> = T & CodedError;
29
29
  export declare function readableError(code: StringErrorCode, message?: string): ReadableErrorWithCode;
30
30
  export interface ReadableDataError<T = unknown> extends ReadableError {
31
- data?: T;
31
+ readonly data?: T;
32
32
  }
33
33
  export interface ErrorWrapper {
34
- data: ReadableError | CodedError;
34
+ readonly data: ReadableError | CodedError;
35
35
  }
36
36
  export type ErrorInput = ErrorWrapper | CodedError | ReadableError | ReadableDataError;
37
37
  /**
@@ -40,6 +40,7 @@ export type ErrorInput = ErrorWrapper | CodedError | ReadableError | ReadableDat
40
40
  * @param inputError
41
41
  * @returns
42
42
  */
43
+ export declare function toReadableError(inputError: ErrorInput): CodedError | ReadableErrorWithCode;
43
44
  export declare function toReadableError(inputError: Maybe<ErrorInput>): Maybe<CodedError | ReadableErrorWithCode>;
44
45
  export declare function errorMessageContainsString(input: Maybe<ErrorInput | string>, target: string): boolean;
45
46
  export type ErrorMessageContainsStringFunction = (input: Maybe<ErrorInput | string>) => boolean;
@@ -1,19 +1,14 @@
1
1
  import { type Maybe } from '../value/maybe.type';
2
- import { type ReadableError, type ReadableDataError, type StringErrorCode, type CodedError } from './error';
2
+ import { type ReadableDataError, type StringErrorCode, type CodedError } from './error';
3
3
  /**
4
4
  * The expected error object returned from the server.
5
5
  */
6
- export interface ServerErrorResponseData extends ReadableError {
7
- /**
8
- * Additional keys/data returned in the error data.
9
- */
10
- [key: string]: unknown;
11
- }
6
+ export type ServerErrorResponseData = object;
12
7
  /**
13
8
  * Human-readable server error with additional data and a status code.
14
9
  */
15
10
  export interface ServerError<T = ServerErrorResponseData> extends ReadableDataError<T> {
16
- status: number;
11
+ readonly status: number;
17
12
  }
18
13
  export declare function isServerError(input: unknown): input is ServerError;
19
14
  export type ErrorMessageOrPartialServerError<T = ServerErrorResponseData> = string | Partial<ReadableDataError | ServerError<T>>;
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [10.1.5](https://github.com/dereekb/dbx-components/compare/v10.1.4-dev...v10.1.5) (2024-03-22)
6
+
7
+
8
+
9
+ ## [10.1.4](https://github.com/dereekb/dbx-components/compare/v10.1.3-dev...v10.1.4) (2024-03-14)
10
+
11
+
12
+
5
13
  ## [10.1.3](https://github.com/dereekb/dbx-components/compare/v10.1.2-dev...v10.1.3) (2024-03-11)
6
14
 
7
15
 
package/test/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "10.1.3",
3
+ "version": "10.1.5",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "@dereekb/util": "*"