@dereekb/util 11.1.3 → 11.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.
- package/fetch/package.json +1 -1
- package/index.cjs.js +167 -0
- package/index.esm.js +197 -1
- package/package.json +1 -1
- package/src/lib/date/date.d.ts +12 -1
- package/src/lib/date/date.unix.d.ts +37 -0
- package/src/lib/date/expires.d.ts +105 -0
- package/src/lib/date/index.d.ts +2 -0
- package/test/CHANGELOG.md +8 -0
- package/test/package.json +1 -1
package/fetch/package.json
CHANGED
package/index.cjs.js
CHANGED
|
@@ -9770,6 +9770,9 @@ function isEqualDate(a, b) {
|
|
|
9770
9770
|
function isPast(input) {
|
|
9771
9771
|
return input.getTime() < Date.now();
|
|
9772
9772
|
}
|
|
9773
|
+
function addMilliseconds(input, ms) {
|
|
9774
|
+
return input != null ? new Date(input.getTime() + (ms != null ? ms : 0)) : input;
|
|
9775
|
+
}
|
|
9773
9776
|
|
|
9774
9777
|
const FRACTIONAL_HOURS_PRECISION_FUNCTION = cutValueToPrecisionFunction(3);
|
|
9775
9778
|
/**
|
|
@@ -12983,6 +12986,159 @@ function objectIsEmpty(obj) {
|
|
|
12983
12986
|
return true;
|
|
12984
12987
|
}
|
|
12985
12988
|
|
|
12989
|
+
/**
|
|
12990
|
+
* Converts a Date object or unix timestamp number to a unix timestamp number.
|
|
12991
|
+
*
|
|
12992
|
+
* @param input - Date object or unix timestamp number to convert
|
|
12993
|
+
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
12994
|
+
*/
|
|
12995
|
+
function unixTimeNumberFromDateOrTimeNumber(input) {
|
|
12996
|
+
if (input == null) {
|
|
12997
|
+
return input;
|
|
12998
|
+
} else if (isDate(input)) {
|
|
12999
|
+
return unixTimeNumberFromDate(input);
|
|
13000
|
+
} else {
|
|
13001
|
+
return input;
|
|
13002
|
+
}
|
|
13003
|
+
}
|
|
13004
|
+
/**
|
|
13005
|
+
* Gets the current time as a unix timestamp number.
|
|
13006
|
+
*
|
|
13007
|
+
* @returns Current time as unix timestamp number
|
|
13008
|
+
*/
|
|
13009
|
+
function unixTimeNumberForNow() {
|
|
13010
|
+
return unixTimeNumberFromDate(new Date());
|
|
13011
|
+
}
|
|
13012
|
+
function unixTimeNumberFromDate(date) {
|
|
13013
|
+
return date != null ? Math.ceil(date.getTime() / 1000) : date;
|
|
13014
|
+
}
|
|
13015
|
+
/**
|
|
13016
|
+
* Converts a Date object or unix timestamp number to a Date object.
|
|
13017
|
+
*
|
|
13018
|
+
* @param input - Date object or unix timestamp number to convert
|
|
13019
|
+
* @returns Date object if input is valid, null/undefined if input is null/undefined
|
|
13020
|
+
*/
|
|
13021
|
+
function dateFromDateOrTimeNumber(input) {
|
|
13022
|
+
if (input == null) {
|
|
13023
|
+
return input;
|
|
13024
|
+
} else if (isDate(input)) {
|
|
13025
|
+
return input;
|
|
13026
|
+
} else {
|
|
13027
|
+
return unixTimeNumberToDate(input);
|
|
13028
|
+
}
|
|
13029
|
+
}
|
|
13030
|
+
/**
|
|
13031
|
+
* Converts a unix timestamp number to a Date object.
|
|
13032
|
+
*
|
|
13033
|
+
* @param dateTimeNumber - Unix timestamp number to convert
|
|
13034
|
+
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
13035
|
+
*/
|
|
13036
|
+
function unixTimeNumberToDate(dateTimeNumber) {
|
|
13037
|
+
return dateTimeNumber != null ? new Date(dateTimeNumber * 1000) : dateTimeNumber;
|
|
13038
|
+
}
|
|
13039
|
+
|
|
13040
|
+
/**
|
|
13041
|
+
* Returns expiration details for the input.
|
|
13042
|
+
*
|
|
13043
|
+
* @param input
|
|
13044
|
+
* @returns
|
|
13045
|
+
*/
|
|
13046
|
+
function expirationDetails(input) {
|
|
13047
|
+
const {
|
|
13048
|
+
expiresAt,
|
|
13049
|
+
expires,
|
|
13050
|
+
now: inputNow,
|
|
13051
|
+
expiresFromDate,
|
|
13052
|
+
expiresIn
|
|
13053
|
+
} = input;
|
|
13054
|
+
const parsedExpiresFromDate = expiresFromDate != null ? dateFromDateOrTimeNumber(expiresFromDate) : null;
|
|
13055
|
+
function getNow(nowOverride) {
|
|
13056
|
+
var _ref;
|
|
13057
|
+
const now = (_ref = nowOverride != null ? nowOverride : inputNow) != null ? _ref : new Date();
|
|
13058
|
+
return now;
|
|
13059
|
+
}
|
|
13060
|
+
function hasExpired(nowOverride) {
|
|
13061
|
+
const now = getNow(nowOverride);
|
|
13062
|
+
const expirationDate = getExpirationDateForNow(now);
|
|
13063
|
+
return expirationDate != null && expirationDate <= now;
|
|
13064
|
+
}
|
|
13065
|
+
function getExpirationDate(nowOverride) {
|
|
13066
|
+
const now = getNow(nowOverride);
|
|
13067
|
+
return getExpirationDateForNow(now);
|
|
13068
|
+
}
|
|
13069
|
+
function getExpirationDateForNow(now) {
|
|
13070
|
+
let expirationDate = null;
|
|
13071
|
+
if ((expires == null ? void 0 : expires.expiresAt) != null) {
|
|
13072
|
+
expirationDate = expires.expiresAt;
|
|
13073
|
+
} else if (expiresAt != null) {
|
|
13074
|
+
expirationDate = expiresAt;
|
|
13075
|
+
} else if (expiresIn != null) {
|
|
13076
|
+
const date = parsedExpiresFromDate != null ? parsedExpiresFromDate : now;
|
|
13077
|
+
expirationDate = addMilliseconds(date, expiresIn);
|
|
13078
|
+
}
|
|
13079
|
+
return expirationDate;
|
|
13080
|
+
}
|
|
13081
|
+
return {
|
|
13082
|
+
input,
|
|
13083
|
+
hasExpired,
|
|
13084
|
+
getExpirationDate
|
|
13085
|
+
};
|
|
13086
|
+
}
|
|
13087
|
+
// MARK: Utility
|
|
13088
|
+
/**
|
|
13089
|
+
* Convenience function for calculating and returning the expiration date given the input.
|
|
13090
|
+
*
|
|
13091
|
+
* @param input Input used to calculate the expiration date.
|
|
13092
|
+
* @returns The expiration date, if applicable.
|
|
13093
|
+
*/
|
|
13094
|
+
function calculateExpirationDate(input) {
|
|
13095
|
+
return expirationDetails(input).getExpirationDate();
|
|
13096
|
+
}
|
|
13097
|
+
/**
|
|
13098
|
+
* Convenience function for quickly calculating throttling given a throttle time and last run time.
|
|
13099
|
+
*
|
|
13100
|
+
* Returns true if the throttle time has not passed since the last run time, compared to now.
|
|
13101
|
+
|
|
13102
|
+
* @param throttleTime Time after "now" that expiration will occur.
|
|
13103
|
+
* @param lastRunAt Time the last run occurred.
|
|
13104
|
+
* @param now Optional override for the current time. Defaults to the current time.
|
|
13105
|
+
* @returns
|
|
13106
|
+
*/
|
|
13107
|
+
function isThrottled(throttleTime, lastRunAt, now) {
|
|
13108
|
+
return !expirationDetails({
|
|
13109
|
+
expiresFromDate: lastRunAt,
|
|
13110
|
+
expiresIn: throttleTime
|
|
13111
|
+
}).hasExpired(now);
|
|
13112
|
+
}
|
|
13113
|
+
/**
|
|
13114
|
+
* Returns true if any of the input ExpirationDetails have not expired.
|
|
13115
|
+
*
|
|
13116
|
+
* If the list is empty, returns false.
|
|
13117
|
+
*
|
|
13118
|
+
* @param details List of ExpirationDetails to check.
|
|
13119
|
+
* @returns True if any of the input ExpirationDetails have not expired.
|
|
13120
|
+
*/
|
|
13121
|
+
function checkAtleastOneNotExpired(details) {
|
|
13122
|
+
const firstExpired = details.findIndex(detail => !detail.hasExpired());
|
|
13123
|
+
return firstExpired !== -1;
|
|
13124
|
+
}
|
|
13125
|
+
/**
|
|
13126
|
+
* Returns true if any of the input ExpirationDetails have expired.
|
|
13127
|
+
*
|
|
13128
|
+
* If the list is empty, returns the value of the second argument.
|
|
13129
|
+
*
|
|
13130
|
+
* @param details List of ExpirationDetails to check.
|
|
13131
|
+
* @param defaultIfEmpty Default value to return if the list is empty. True by default.
|
|
13132
|
+
* @returns True if any of the input ExpirationDetails have expired.
|
|
13133
|
+
*/
|
|
13134
|
+
function checkAnyHaveExpired(details, defaultIfEmpty = true) {
|
|
13135
|
+
if (details.length === 0) {
|
|
13136
|
+
return defaultIfEmpty;
|
|
13137
|
+
}
|
|
13138
|
+
const firstExpired = details.findIndex(detail => detail.hasExpired());
|
|
13139
|
+
return firstExpired !== -1;
|
|
13140
|
+
}
|
|
13141
|
+
|
|
12986
13142
|
/**
|
|
12987
13143
|
* Returns the day of the week for the input day.
|
|
12988
13144
|
*
|
|
@@ -16385,6 +16541,7 @@ exports.WEB_PROTOCOL_PREFIX_REGEX = WEB_PROTOCOL_PREFIX_REGEX;
|
|
|
16385
16541
|
exports.ZIP_CODE_STRING_REGEX = ZIP_CODE_STRING_REGEX;
|
|
16386
16542
|
exports.addHttpToUrl = addHttpToUrl;
|
|
16387
16543
|
exports.addLatLngPoints = addLatLngPoints;
|
|
16544
|
+
exports.addMilliseconds = addMilliseconds;
|
|
16388
16545
|
exports.addModifiers = addModifiers;
|
|
16389
16546
|
exports.addPlusPrefixToNumber = addPlusPrefixToNumber;
|
|
16390
16547
|
exports.addPrefix = addPrefix;
|
|
@@ -16450,6 +16607,7 @@ exports.boundNumberFunction = boundNumberFunction;
|
|
|
16450
16607
|
exports.boundToRectangle = boundToRectangle;
|
|
16451
16608
|
exports.build = build;
|
|
16452
16609
|
exports.cachedGetter = cachedGetter;
|
|
16610
|
+
exports.calculateExpirationDate = calculateExpirationDate;
|
|
16453
16611
|
exports.capLatValue = capLatValue;
|
|
16454
16612
|
exports.capitalizeFirstLetter = capitalizeFirstLetter;
|
|
16455
16613
|
exports.caseInsensitiveFilterByIndexOfDecisionFactory = caseInsensitiveFilterByIndexOfDecisionFactory;
|
|
@@ -16457,6 +16615,8 @@ exports.caseInsensitiveString = caseInsensitiveString;
|
|
|
16457
16615
|
exports.catchAllHandlerKey = catchAllHandlerKey;
|
|
16458
16616
|
exports.chainMapFunction = chainMapFunction;
|
|
16459
16617
|
exports.chainMapSameFunctions = chainMapSameFunctions;
|
|
16618
|
+
exports.checkAnyHaveExpired = checkAnyHaveExpired;
|
|
16619
|
+
exports.checkAtleastOneNotExpired = checkAtleastOneNotExpired;
|
|
16460
16620
|
exports.coerceToEmailParticipants = coerceToEmailParticipants;
|
|
16461
16621
|
exports.combineMaps = combineMaps;
|
|
16462
16622
|
exports.compareEqualityWithValueFromItemsFunction = compareEqualityWithValueFromItemsFunction;
|
|
@@ -16497,6 +16657,7 @@ exports.cutToPrecision = cutToPrecision;
|
|
|
16497
16657
|
exports.cutValueToInteger = cutValueToInteger;
|
|
16498
16658
|
exports.cutValueToPrecision = cutValueToPrecision;
|
|
16499
16659
|
exports.cutValueToPrecisionFunction = cutValueToPrecisionFunction;
|
|
16660
|
+
exports.dateFromDateOrTimeNumber = dateFromDateOrTimeNumber;
|
|
16500
16661
|
exports.dateFromLogicalDate = dateFromLogicalDate;
|
|
16501
16662
|
exports.dateFromMinuteOfDay = dateFromMinuteOfDay;
|
|
16502
16663
|
exports.dateToHoursAndMinutes = dateToHoursAndMinutes;
|
|
@@ -16537,6 +16698,7 @@ exports.expandFlattenTreeFunction = expandFlattenTreeFunction;
|
|
|
16537
16698
|
exports.expandIndexSet = expandIndexSet;
|
|
16538
16699
|
exports.expandTreeFunction = expandTreeFunction;
|
|
16539
16700
|
exports.expandTrees = expandTrees;
|
|
16701
|
+
exports.expirationDetails = expirationDetails;
|
|
16540
16702
|
exports.exponentialPromiseRateLimiter = exponentialPromiseRateLimiter;
|
|
16541
16703
|
exports.extendLatLngBound = extendLatLngBound;
|
|
16542
16704
|
exports.filterAndMapFunction = filterAndMapFunction;
|
|
@@ -16727,6 +16889,7 @@ exports.isSlashPathFolder = isSlashPathFolder;
|
|
|
16727
16889
|
exports.isSlashPathTypedFile = isSlashPathTypedFile;
|
|
16728
16890
|
exports.isStandardInternetAccessibleWebsiteUrl = isStandardInternetAccessibleWebsiteUrl;
|
|
16729
16891
|
exports.isStringOrTrue = isStringOrTrue;
|
|
16892
|
+
exports.isThrottled = isThrottled;
|
|
16730
16893
|
exports.isTrueBooleanKeyArray = isTrueBooleanKeyArray;
|
|
16731
16894
|
exports.isUTCDateString = isUTCDateString;
|
|
16732
16895
|
exports.isUniqueKeyedFunction = isUniqueKeyedFunction;
|
|
@@ -17091,6 +17254,10 @@ exports.uniqueCaseInsensitiveStringsSet = uniqueCaseInsensitiveStringsSet;
|
|
|
17091
17254
|
exports.uniqueKeys = uniqueKeys;
|
|
17092
17255
|
exports.uniqueModels = uniqueModels;
|
|
17093
17256
|
exports.unitedStatesAddressString = unitedStatesAddressString;
|
|
17257
|
+
exports.unixTimeNumberForNow = unixTimeNumberForNow;
|
|
17258
|
+
exports.unixTimeNumberFromDate = unixTimeNumberFromDate;
|
|
17259
|
+
exports.unixTimeNumberFromDateOrTimeNumber = unixTimeNumberFromDateOrTimeNumber;
|
|
17260
|
+
exports.unixTimeNumberToDate = unixTimeNumberToDate;
|
|
17094
17261
|
exports.updateMaybeValue = updateMaybeValue;
|
|
17095
17262
|
exports.urlWithoutParameters = urlWithoutParameters;
|
|
17096
17263
|
exports.useAsync = useAsync;
|
package/index.esm.js
CHANGED
|
@@ -11387,6 +11387,19 @@ function isPast(input) {
|
|
|
11387
11387
|
return input.getTime() < Date.now();
|
|
11388
11388
|
}
|
|
11389
11389
|
|
|
11390
|
+
/**
|
|
11391
|
+
* Adds milliseconds to the input date.
|
|
11392
|
+
*
|
|
11393
|
+
* If no date is input, then returns the input.
|
|
11394
|
+
*
|
|
11395
|
+
* @param input
|
|
11396
|
+
* @param ms
|
|
11397
|
+
*/
|
|
11398
|
+
|
|
11399
|
+
function addMilliseconds(input, ms) {
|
|
11400
|
+
return input != null ? new Date(input.getTime() + (ms != null ? ms : 0)) : input;
|
|
11401
|
+
}
|
|
11402
|
+
|
|
11390
11403
|
/**
|
|
11391
11404
|
* A number that represents hours and rounded to the nearest minute.
|
|
11392
11405
|
*
|
|
@@ -14705,6 +14718,189 @@ function objectIsEmpty(obj) {
|
|
|
14705
14718
|
return true;
|
|
14706
14719
|
}
|
|
14707
14720
|
|
|
14721
|
+
/**
|
|
14722
|
+
* Converts a Date object or unix timestamp number to a unix timestamp number.
|
|
14723
|
+
*
|
|
14724
|
+
* @param input - Date object or unix timestamp number to convert
|
|
14725
|
+
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
14726
|
+
*/
|
|
14727
|
+
function unixTimeNumberFromDateOrTimeNumber(input) {
|
|
14728
|
+
if (input == null) {
|
|
14729
|
+
return input;
|
|
14730
|
+
} else if (isDate(input)) {
|
|
14731
|
+
return unixTimeNumberFromDate(input);
|
|
14732
|
+
} else {
|
|
14733
|
+
return input;
|
|
14734
|
+
}
|
|
14735
|
+
}
|
|
14736
|
+
|
|
14737
|
+
/**
|
|
14738
|
+
* Gets the current time as a unix timestamp number.
|
|
14739
|
+
*
|
|
14740
|
+
* @returns Current time as unix timestamp number
|
|
14741
|
+
*/
|
|
14742
|
+
function unixTimeNumberForNow() {
|
|
14743
|
+
return unixTimeNumberFromDate(new Date());
|
|
14744
|
+
}
|
|
14745
|
+
|
|
14746
|
+
/**
|
|
14747
|
+
* Converts a Date object to a unix timestamp number.
|
|
14748
|
+
*
|
|
14749
|
+
* @param date - Date object to convert
|
|
14750
|
+
* @returns Unix timestamp number if date is valid, null/undefined if date is null/undefined
|
|
14751
|
+
*/
|
|
14752
|
+
|
|
14753
|
+
function unixTimeNumberFromDate(date) {
|
|
14754
|
+
return date != null ? Math.ceil(date.getTime() / 1000) : date;
|
|
14755
|
+
}
|
|
14756
|
+
|
|
14757
|
+
/**
|
|
14758
|
+
* Converts a Date object or unix timestamp number to a Date object.
|
|
14759
|
+
*
|
|
14760
|
+
* @param input - Date object or unix timestamp number to convert
|
|
14761
|
+
* @returns Date object if input is valid, null/undefined if input is null/undefined
|
|
14762
|
+
*/
|
|
14763
|
+
function dateFromDateOrTimeNumber(input) {
|
|
14764
|
+
if (input == null) {
|
|
14765
|
+
return input;
|
|
14766
|
+
} else if (isDate(input)) {
|
|
14767
|
+
return input;
|
|
14768
|
+
} else {
|
|
14769
|
+
return unixTimeNumberToDate(input);
|
|
14770
|
+
}
|
|
14771
|
+
}
|
|
14772
|
+
|
|
14773
|
+
/**
|
|
14774
|
+
* Converts a unix timestamp number to a Date object.
|
|
14775
|
+
*
|
|
14776
|
+
* @param dateTimeNumber - Unix timestamp number to convert
|
|
14777
|
+
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
14778
|
+
*/
|
|
14779
|
+
function unixTimeNumberToDate(dateTimeNumber) {
|
|
14780
|
+
return dateTimeNumber != null ? new Date(dateTimeNumber * 1000) : dateTimeNumber;
|
|
14781
|
+
}
|
|
14782
|
+
|
|
14783
|
+
// MARK: Expires
|
|
14784
|
+
/**
|
|
14785
|
+
* An object that can expire.
|
|
14786
|
+
*/
|
|
14787
|
+
|
|
14788
|
+
// MARK: Expiration Details
|
|
14789
|
+
/**
|
|
14790
|
+
* expirationDetails() input.
|
|
14791
|
+
*
|
|
14792
|
+
* The priority that the expiration calculation uses takes the following order:
|
|
14793
|
+
* 1. expires
|
|
14794
|
+
* 2. expiresAt
|
|
14795
|
+
* 3. date + expiresIn
|
|
14796
|
+
*/
|
|
14797
|
+
|
|
14798
|
+
/**
|
|
14799
|
+
* Returns expiration details for the input.
|
|
14800
|
+
*
|
|
14801
|
+
* @param input
|
|
14802
|
+
* @returns
|
|
14803
|
+
*/
|
|
14804
|
+
function expirationDetails(input) {
|
|
14805
|
+
const {
|
|
14806
|
+
expiresAt,
|
|
14807
|
+
expires,
|
|
14808
|
+
now: inputNow,
|
|
14809
|
+
expiresFromDate,
|
|
14810
|
+
expiresIn
|
|
14811
|
+
} = input;
|
|
14812
|
+
const parsedExpiresFromDate = expiresFromDate != null ? dateFromDateOrTimeNumber(expiresFromDate) : null;
|
|
14813
|
+
function getNow(nowOverride) {
|
|
14814
|
+
var _ref;
|
|
14815
|
+
const now = (_ref = nowOverride != null ? nowOverride : inputNow) != null ? _ref : new Date();
|
|
14816
|
+
return now;
|
|
14817
|
+
}
|
|
14818
|
+
function hasExpired(nowOverride) {
|
|
14819
|
+
const now = getNow(nowOverride);
|
|
14820
|
+
const expirationDate = getExpirationDateForNow(now);
|
|
14821
|
+
return expirationDate != null && expirationDate <= now;
|
|
14822
|
+
}
|
|
14823
|
+
function getExpirationDate(nowOverride) {
|
|
14824
|
+
const now = getNow(nowOverride);
|
|
14825
|
+
return getExpirationDateForNow(now);
|
|
14826
|
+
}
|
|
14827
|
+
function getExpirationDateForNow(now) {
|
|
14828
|
+
let expirationDate = null;
|
|
14829
|
+
if ((expires == null ? void 0 : expires.expiresAt) != null) {
|
|
14830
|
+
expirationDate = expires.expiresAt;
|
|
14831
|
+
} else if (expiresAt != null) {
|
|
14832
|
+
expirationDate = expiresAt;
|
|
14833
|
+
} else if (expiresIn != null) {
|
|
14834
|
+
const date = parsedExpiresFromDate != null ? parsedExpiresFromDate : now;
|
|
14835
|
+
expirationDate = addMilliseconds(date, expiresIn);
|
|
14836
|
+
}
|
|
14837
|
+
return expirationDate;
|
|
14838
|
+
}
|
|
14839
|
+
return {
|
|
14840
|
+
input,
|
|
14841
|
+
hasExpired,
|
|
14842
|
+
getExpirationDate
|
|
14843
|
+
};
|
|
14844
|
+
}
|
|
14845
|
+
|
|
14846
|
+
// MARK: Utility
|
|
14847
|
+
/**
|
|
14848
|
+
* Convenience function for calculating and returning the expiration date given the input.
|
|
14849
|
+
*
|
|
14850
|
+
* @param input Input used to calculate the expiration date.
|
|
14851
|
+
* @returns The expiration date, if applicable.
|
|
14852
|
+
*/
|
|
14853
|
+
function calculateExpirationDate(input) {
|
|
14854
|
+
return expirationDetails(input).getExpirationDate();
|
|
14855
|
+
}
|
|
14856
|
+
|
|
14857
|
+
/**
|
|
14858
|
+
* Convenience function for quickly calculating throttling given a throttle time and last run time.
|
|
14859
|
+
*
|
|
14860
|
+
* Returns true if the throttle time has not passed since the last run time, compared to now.
|
|
14861
|
+
|
|
14862
|
+
* @param throttleTime Time after "now" that expiration will occur.
|
|
14863
|
+
* @param lastRunAt Time the last run occurred.
|
|
14864
|
+
* @param now Optional override for the current time. Defaults to the current time.
|
|
14865
|
+
* @returns
|
|
14866
|
+
*/
|
|
14867
|
+
function isThrottled(throttleTime, lastRunAt, now) {
|
|
14868
|
+
return !expirationDetails({
|
|
14869
|
+
expiresFromDate: lastRunAt,
|
|
14870
|
+
expiresIn: throttleTime
|
|
14871
|
+
}).hasExpired(now);
|
|
14872
|
+
}
|
|
14873
|
+
|
|
14874
|
+
/**
|
|
14875
|
+
* Returns true if any of the input ExpirationDetails have not expired.
|
|
14876
|
+
*
|
|
14877
|
+
* If the list is empty, returns false.
|
|
14878
|
+
*
|
|
14879
|
+
* @param details List of ExpirationDetails to check.
|
|
14880
|
+
* @returns True if any of the input ExpirationDetails have not expired.
|
|
14881
|
+
*/
|
|
14882
|
+
function checkAtleastOneNotExpired(details) {
|
|
14883
|
+
const firstExpired = details.findIndex(detail => !detail.hasExpired());
|
|
14884
|
+
return firstExpired !== -1;
|
|
14885
|
+
}
|
|
14886
|
+
|
|
14887
|
+
/**
|
|
14888
|
+
* Returns true if any of the input ExpirationDetails have expired.
|
|
14889
|
+
*
|
|
14890
|
+
* If the list is empty, returns the value of the second argument.
|
|
14891
|
+
*
|
|
14892
|
+
* @param details List of ExpirationDetails to check.
|
|
14893
|
+
* @param defaultIfEmpty Default value to return if the list is empty. True by default.
|
|
14894
|
+
* @returns True if any of the input ExpirationDetails have expired.
|
|
14895
|
+
*/
|
|
14896
|
+
function checkAnyHaveExpired(details, defaultIfEmpty = true) {
|
|
14897
|
+
if (details.length === 0) {
|
|
14898
|
+
return defaultIfEmpty;
|
|
14899
|
+
}
|
|
14900
|
+
const firstExpired = details.findIndex(detail => detail.hasExpired());
|
|
14901
|
+
return firstExpired !== -1;
|
|
14902
|
+
}
|
|
14903
|
+
|
|
14708
14904
|
/**
|
|
14709
14905
|
* Values that correspond to each day of the week.
|
|
14710
14906
|
*/
|
|
@@ -17579,4 +17775,4 @@ async function iterateFilteredPages(inputPage, loadFn, iterFn) {
|
|
|
17579
17775
|
return count;
|
|
17580
17776
|
}
|
|
17581
17777
|
|
|
17582
|
-
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, BooleanStringKeyArrayUtility, BooleanStringKeyArrayUtilityInstance, CATCH_ALL_HANDLE_RESULT_KEY, CUT_VALUE_TO_ZERO_PRECISION, DATE_NOW_VALUE, DEFAULT_CUT_STRING_END_TEXT, 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_PORT_NUMBER_REGEX, 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, MINUTE_OF_DAY_MAXMIMUM, MINUTE_OF_DAY_MINIUMUM, 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, NUMBER_STRING_DENCODER_64, NUMBER_STRING_DENCODER_64_DEFAULT_NEGATIVE_PREFIX, NUMBER_STRING_DENCODER_64_DIGITS, 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, SPLIT_STRING_TREE_NODE_ROOT_VALUE, 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, UNSET_INDEX_NUMBER, US_STATE_CODE_STRING_REGEX, UTC_DATE_STRING_REGEX, UTC_TIMEZONE_STRING, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, UnauthorizedServerErrorResponse, WEBSITE_TLD_DETECTION_REGEX, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, addToSplitStringTree, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applyBestFit, applySplitStringTreeWithMultipleValues, applyToMultipleFields, approximateTimerEndDate, areEqualContext, areEqualPOJOValues, areEqualPOJOValuesUsingPojoFilter, arrayContainsDuplicateValue, arrayContentsDiffer, arrayDecision, arrayDecisionFunction, arrayFactory, arrayInputFactory, arrayToLowercase, arrayToMap, arrayToObject, arrayToUppercase, asArray, asDecisionFunction, asGetter, asIndexRangeCheckFunctionConfig, asIterable, asMinuteOfDay, asNumber, asObjectCopyFactory, asPromise, asSet, assignValuesToPOJO, assignValuesToPOJOFunction, authClaims, authRoleClaimsService, authRolesSetHasRoles, baseWebsiteUrl, batch, batchCalc, bitwiseObjectDencoder, bitwiseObjectEncoder, bitwiseObjectdecoder, bitwiseSetDecoder, bitwiseSetDencoder, booleanFactory, booleanKeyArrayUtility, boundNumber, boundNumberFunction, boundToRectangle, build, cachedGetter, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, coerceToEmailParticipants, combineMaps, compareEqualityWithValueFromItemsFunction, compareEqualityWithValueFromItemsFunctionFactory, compareFnOrder, compareWithMappedValuesFunction, computeNextFractionalHour, computeNextFreeIndexFunction, computeNextFreeIndexOnSortedValuesFunction, 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, cutString, cutStringFunction, cutToPrecision, cutValueToInteger, cutValueToPrecision, cutValueToPrecisionFunction, dateFromLogicalDate, dateFromMinuteOfDay, dateToHoursAndMinutes, dateToMinuteOfDay, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringCharactersFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandTreeFunction, expandTrees, exponentialPromiseRateLimiter, extendLatLngBound, filterAndMapFunction, filterEmptyArrayValues, filterEmptyValues, filterFalsyAndEmptyValues, filterFromIterable, filterFromPOJO, filterFromPOJOFunction, filterKeyValueTupleFunction, filterKeyValueTuples, filterKeyValueTuplesFunction, filterKeyValueTuplesInputToFilter, filterKeysOnPOJOFunction, filterMaybeArrayFunction, filterMaybeArrayValues, filterMaybeValues, filterNullAndUndefinedValues, filterOnlyUndefinedValues, filterTuplesOnPOJOFunction, filterUndefinedValues, filterUniqueByIndex, filterUniqueCaseInsensitiveStrings, filterUniqueFunction, filterUniqueTransform, filterUniqueValues, filterValuesByDistance, filterValuesByDistanceNoOrder, filterValuesToSet, filterValuesUsingSet, filteredPage, findAllCharacterOccurences, findAllCharacterOccurencesFunction, findBest, findBestIndexMatch, findBestIndexMatchFunction, findBestIndexSetPair, findBestSplitStringTreeChildMatch, findBestSplitStringTreeChildMatchPath, findBestSplitStringTreeMatch, findBestSplitStringTreeMatchPath, 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, getBaseLog, getDayOffset, getDayTomorrow, getDayYesterday, getDaysOfWeekNames, getFunctionType, getNextDay, getNextPageNumber, getOverlappingRectangle, getPageNumber, getPreviousDay, getValueFromGetter, groupValues, handlerBindAccessor, handlerConfigurerFactory, handlerFactory, handlerMappedSetFunction, handlerMappedSetFunctionFactory, handlerSetFunction, hasDifferentStringsNoCase, hasDifferentValues, hasHttpPrefix, hasNonNullValue, hasPortNumber, hasSameTimezone, hasSameValues, hasValueFunction, hasValueOrNotEmpty, hasValueOrNotEmptyObject, hasWebsiteDomain, hasWebsiteTopLevelDomain, hashSetForIndexed, hourToFractionalHour, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexRefMap, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, isAllowed, isClassLikeType, isCompleteUnitedStatesAddress, isConsideredUtcTimezoneString, isDate, isDefaultLatLngPoint, isDefaultLatLngPointValue, isDefaultReadableError, isDefinedAndNotFalse, isDollarAmountString, isE164PhoneNumber, isE164PhoneNumberWithExtension, isEmptyIterable, isEqualContext, isEqualDate, isEqualToValueDecisionFunction, isEvenNumber, isFalseBooleanKeyArray, isFinalPage, isGetter, isISO8601DateString, isISO8601DayString, isISO8601DayStringStart, isInAllowedDaysOfWeekSet, isInNumberBoundFunction, isInSetDecisionFunction, isIndexNumberInIndexRange, isIndexNumberInIndexRangeFunction, isIndexRangeInIndexRange, isIndexRangeInIndexRangeFunction, isIterable, isKnownHttpWebsiteProtocol, isLatLngBound, isLatLngBoundWithinLatLngBound, isLatLngPoint, isLatLngPointWithinLatLngBound, isLatLngString, isLogicalDateStringCode, isMapIdentityFunction, isMaybeNot, isMaybeNotOrTrue, isMaybeSo, isMinuteOfDay, isModelKey, isMonthDaySlashDate, isNonClassFunction, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPast, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStandardInternetAccessibleWebsiteUrl, isStringOrTrue, isTrueBooleanKeyArray, isUTCDateString, isUniqueKeyedFunction, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterableToSet, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStringsWithSpaces, keepCharactersAfterFirstCharacterOccurence, keepCharactersAfterFirstCharacterOccurenceFunction, keepFromSetCopy, keepValuesFromArray, keepValuesFromSet, keyValueMapFactory, labeledValueMap, 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, mapObjectKeysFunction, mapObjectKeysToLowercase, mapObjectMap, mapObjectMapFunction, mapObjectToTargetObject, mapPromiseOrValue, mapToObject, mapToTuples, mapValuesToSet, mappedUseAsyncFunction, mappedUseFunction, mapsHaveSameKeys, maybeMergeModelModifiers, maybeMergeModifiers, maybeModifierMapToFunction, maybeSet, mergeArrays, mergeArraysIntoArray, mergeFilterFunctions, mergeModifiers, mergeObjects, mergeObjectsFunction, mergeSlashPaths, messageFromError, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, minutesToHoursAndMinutes, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, multiKeyValueMapFactory, multiValueMapBuilder, neMostLatLngPoint, nearestDivisibleValues, numberStringDencoder, numberStringDencoderDecodedNumberValueFunction, numberStringDencoderEncodedStringValueFunction, numberStringDencoderFunction, objectCopyFactory, objectDeltaArrayCompressor, objectFieldEqualityChecker, objectFlatMergeMatrix, objectHasKey, objectHasKeys, objectHasNoKeys, objectIsEmpty, objectKeyEqualityComparatorFunction, objectKeysEqualityComparatorFunction, objectMergeMatrix, objectToMap, objectToTuples, overlapsLatLngBoundFunction, overrideInObject, overrideInObjectFunctionFactory, padStartFunction, 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, readPortNumber, readUniqueModelKey, readWebsiteProtocol, 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, removeValuesAtIndexesFromArrayCopy, removeWebProtocolPrefix, repeatString, replaceCharacterAtIndexIf, replaceCharacterAtIndexWith, replaceInvalidFilePathTypeSeparatorsInSlashPath, replaceInvalidFilePathTypeSeparatorsInSlashPathFunction, replaceLastCharacterIf, replaceLastCharacterIfIsFunction, replaceMultipleFilePathsInSlashPath, replaceStringsFunction, requireModelKey, resetPeriodPromiseRateLimiter, restoreOrder, restoreOrderWithValues, reverseCompareFn, roundNumberToStepFunction, roundNumberUpToStep, roundToPrecision, roundToPrecisionFunction, roundingFunction, runAsyncTaskForValue, runAsyncTasksForValues, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, separateValues, separateValuesToSets, sequentialIncrementingNumberStringModelIdFactory, 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, splitStringTreeFactory, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringCharactersToIndexRecord, stringContains, stringFactoryFromFactory, stringToLowercaseFunction, stringToUppercaseFunction, stringTrimFunction, sumOfIntegersBetween, swMostLatLngPoint, symmetricDifferenceArray, symmetricDifferenceArrayBetweenSets, symmetricDifferenceWithModels, takeFront, takeLast, takeValuesFromIterable, telUrlString, telUrlStringForE164PhoneNumberPair, terminatingFactoryFromArray, throwKeyIsRequired, timePeriodCounter, timer, toAbsoluteSlashPathStartType, toCaseInsensitiveStringArray, toMinuteOfDay, toModelFieldConversions, toModelMapFunctions, toReadableError, toRelativeSlashPathStartType, toggleInSet, toggleInSetCopy, toggleTimerRunning, transformNumberFunction, transformNumberFunctionConfig, transformStringFunction, transformStringFunctionConfig, transformStrings, trimArray, tryWithPromiseFactoriesFunction, typedServiceRegistry, unique, uniqueCaseInsensitiveStrings, uniqueCaseInsensitiveStringsSet, uniqueKeys, uniqueModels, unitedStatesAddressString, updateMaybeValue, 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 };
|
|
17778
|
+
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, BooleanStringKeyArrayUtility, BooleanStringKeyArrayUtilityInstance, CATCH_ALL_HANDLE_RESULT_KEY, CUT_VALUE_TO_ZERO_PRECISION, DATE_NOW_VALUE, DEFAULT_CUT_STRING_END_TEXT, 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_PORT_NUMBER_REGEX, 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, MINUTE_OF_DAY_MAXMIMUM, MINUTE_OF_DAY_MINIUMUM, 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, NUMBER_STRING_DENCODER_64, NUMBER_STRING_DENCODER_64_DEFAULT_NEGATIVE_PREFIX, NUMBER_STRING_DENCODER_64_DIGITS, 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, SPLIT_STRING_TREE_NODE_ROOT_VALUE, 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, UNSET_INDEX_NUMBER, US_STATE_CODE_STRING_REGEX, UTC_DATE_STRING_REGEX, UTC_TIMEZONE_STRING, UTF_8_START_CHARACTER, UTF_PRIVATE_USAGE_AREA_START, UnauthorizedServerErrorResponse, WEBSITE_TLD_DETECTION_REGEX, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addMilliseconds, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, addToSplitStringTree, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applyBestFit, applySplitStringTreeWithMultipleValues, applyToMultipleFields, approximateTimerEndDate, areEqualContext, areEqualPOJOValues, areEqualPOJOValuesUsingPojoFilter, arrayContainsDuplicateValue, arrayContentsDiffer, arrayDecision, arrayDecisionFunction, arrayFactory, arrayInputFactory, arrayToLowercase, arrayToMap, arrayToObject, arrayToUppercase, asArray, asDecisionFunction, asGetter, asIndexRangeCheckFunctionConfig, asIterable, asMinuteOfDay, asNumber, asObjectCopyFactory, asPromise, asSet, assignValuesToPOJO, assignValuesToPOJOFunction, authClaims, authRoleClaimsService, authRolesSetHasRoles, baseWebsiteUrl, batch, batchCalc, bitwiseObjectDencoder, bitwiseObjectEncoder, bitwiseObjectdecoder, bitwiseSetDecoder, bitwiseSetDencoder, booleanFactory, booleanKeyArrayUtility, boundNumber, boundNumberFunction, boundToRectangle, build, cachedGetter, calculateExpirationDate, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, checkAnyHaveExpired, checkAtleastOneNotExpired, coerceToEmailParticipants, combineMaps, compareEqualityWithValueFromItemsFunction, compareEqualityWithValueFromItemsFunctionFactory, compareFnOrder, compareWithMappedValuesFunction, computeNextFractionalHour, computeNextFreeIndexFunction, computeNextFreeIndexOnSortedValuesFunction, 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, cutString, cutStringFunction, cutToPrecision, cutValueToInteger, cutValueToPrecision, cutValueToPrecisionFunction, dateFromDateOrTimeNumber, dateFromLogicalDate, dateFromMinuteOfDay, dateToHoursAndMinutes, dateToMinuteOfDay, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringCharactersFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandTreeFunction, expandTrees, expirationDetails, exponentialPromiseRateLimiter, extendLatLngBound, filterAndMapFunction, filterEmptyArrayValues, filterEmptyValues, filterFalsyAndEmptyValues, filterFromIterable, filterFromPOJO, filterFromPOJOFunction, filterKeyValueTupleFunction, filterKeyValueTuples, filterKeyValueTuplesFunction, filterKeyValueTuplesInputToFilter, filterKeysOnPOJOFunction, filterMaybeArrayFunction, filterMaybeArrayValues, filterMaybeValues, filterNullAndUndefinedValues, filterOnlyUndefinedValues, filterTuplesOnPOJOFunction, filterUndefinedValues, filterUniqueByIndex, filterUniqueCaseInsensitiveStrings, filterUniqueFunction, filterUniqueTransform, filterUniqueValues, filterValuesByDistance, filterValuesByDistanceNoOrder, filterValuesToSet, filterValuesUsingSet, filteredPage, findAllCharacterOccurences, findAllCharacterOccurencesFunction, findBest, findBestIndexMatch, findBestIndexMatchFunction, findBestIndexSetPair, findBestSplitStringTreeChildMatch, findBestSplitStringTreeChildMatchPath, findBestSplitStringTreeMatch, findBestSplitStringTreeMatchPath, 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, getBaseLog, getDayOffset, getDayTomorrow, getDayYesterday, getDaysOfWeekNames, getFunctionType, getNextDay, getNextPageNumber, getOverlappingRectangle, getPageNumber, getPreviousDay, getValueFromGetter, groupValues, handlerBindAccessor, handlerConfigurerFactory, handlerFactory, handlerMappedSetFunction, handlerMappedSetFunctionFactory, handlerSetFunction, hasDifferentStringsNoCase, hasDifferentValues, hasHttpPrefix, hasNonNullValue, hasPortNumber, hasSameTimezone, hasSameValues, hasValueFunction, hasValueOrNotEmpty, hasValueOrNotEmptyObject, hasWebsiteDomain, hasWebsiteTopLevelDomain, hashSetForIndexed, hourToFractionalHour, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexRefMap, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, isAllowed, isClassLikeType, isCompleteUnitedStatesAddress, isConsideredUtcTimezoneString, isDate, isDefaultLatLngPoint, isDefaultLatLngPointValue, isDefaultReadableError, isDefinedAndNotFalse, isDollarAmountString, isE164PhoneNumber, isE164PhoneNumberWithExtension, isEmptyIterable, isEqualContext, isEqualDate, isEqualToValueDecisionFunction, isEvenNumber, isFalseBooleanKeyArray, isFinalPage, isGetter, isISO8601DateString, isISO8601DayString, isISO8601DayStringStart, isInAllowedDaysOfWeekSet, isInNumberBoundFunction, isInSetDecisionFunction, isIndexNumberInIndexRange, isIndexNumberInIndexRangeFunction, isIndexRangeInIndexRange, isIndexRangeInIndexRangeFunction, isIterable, isKnownHttpWebsiteProtocol, isLatLngBound, isLatLngBoundWithinLatLngBound, isLatLngPoint, isLatLngPointWithinLatLngBound, isLatLngString, isLogicalDateStringCode, isMapIdentityFunction, isMaybeNot, isMaybeNotOrTrue, isMaybeSo, isMinuteOfDay, isModelKey, isMonthDaySlashDate, isNonClassFunction, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPast, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStandardInternetAccessibleWebsiteUrl, isStringOrTrue, isThrottled, isTrueBooleanKeyArray, isUTCDateString, isUniqueKeyedFunction, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterableToSet, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStringsWithSpaces, keepCharactersAfterFirstCharacterOccurence, keepCharactersAfterFirstCharacterOccurenceFunction, keepFromSetCopy, keepValuesFromArray, keepValuesFromSet, keyValueMapFactory, labeledValueMap, 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, mapObjectKeysFunction, mapObjectKeysToLowercase, mapObjectMap, mapObjectMapFunction, mapObjectToTargetObject, mapPromiseOrValue, mapToObject, mapToTuples, mapValuesToSet, mappedUseAsyncFunction, mappedUseFunction, mapsHaveSameKeys, maybeMergeModelModifiers, maybeMergeModifiers, maybeModifierMapToFunction, maybeSet, mergeArrays, mergeArraysIntoArray, mergeFilterFunctions, mergeModifiers, mergeObjects, mergeObjectsFunction, mergeSlashPaths, messageFromError, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, minutesToHoursAndMinutes, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, multiKeyValueMapFactory, multiValueMapBuilder, neMostLatLngPoint, nearestDivisibleValues, numberStringDencoder, numberStringDencoderDecodedNumberValueFunction, numberStringDencoderEncodedStringValueFunction, numberStringDencoderFunction, objectCopyFactory, objectDeltaArrayCompressor, objectFieldEqualityChecker, objectFlatMergeMatrix, objectHasKey, objectHasKeys, objectHasNoKeys, objectIsEmpty, objectKeyEqualityComparatorFunction, objectKeysEqualityComparatorFunction, objectMergeMatrix, objectToMap, objectToTuples, overlapsLatLngBoundFunction, overrideInObject, overrideInObjectFunctionFactory, padStartFunction, 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, readPortNumber, readUniqueModelKey, readWebsiteProtocol, 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, removeValuesAtIndexesFromArrayCopy, removeWebProtocolPrefix, repeatString, replaceCharacterAtIndexIf, replaceCharacterAtIndexWith, replaceInvalidFilePathTypeSeparatorsInSlashPath, replaceInvalidFilePathTypeSeparatorsInSlashPathFunction, replaceLastCharacterIf, replaceLastCharacterIfIsFunction, replaceMultipleFilePathsInSlashPath, replaceStringsFunction, requireModelKey, resetPeriodPromiseRateLimiter, restoreOrder, restoreOrderWithValues, reverseCompareFn, roundNumberToStepFunction, roundNumberUpToStep, roundToPrecision, roundToPrecisionFunction, roundingFunction, runAsyncTaskForValue, runAsyncTasksForValues, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, separateValues, separateValuesToSets, sequentialIncrementingNumberStringModelIdFactory, 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, splitStringTreeFactory, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringCharactersToIndexRecord, stringContains, stringFactoryFromFactory, stringToLowercaseFunction, stringToUppercaseFunction, stringTrimFunction, sumOfIntegersBetween, swMostLatLngPoint, symmetricDifferenceArray, symmetricDifferenceArrayBetweenSets, symmetricDifferenceWithModels, takeFront, takeLast, takeValuesFromIterable, telUrlString, telUrlStringForE164PhoneNumberPair, terminatingFactoryFromArray, throwKeyIsRequired, timePeriodCounter, timer, toAbsoluteSlashPathStartType, toCaseInsensitiveStringArray, toMinuteOfDay, toModelFieldConversions, toModelMapFunctions, toReadableError, toRelativeSlashPathStartType, toggleInSet, toggleInSetCopy, toggleTimerRunning, transformNumberFunction, transformNumberFunctionConfig, transformStringFunction, transformStringFunctionConfig, transformStrings, trimArray, tryWithPromiseFactoriesFunction, typedServiceRegistry, unique, uniqueCaseInsensitiveStrings, uniqueCaseInsensitiveStringsSet, uniqueKeys, uniqueModels, unitedStatesAddressString, unixTimeNumberForNow, unixTimeNumberFromDate, unixTimeNumberFromDateOrTimeNumber, unixTimeNumberToDate, updateMaybeValue, 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
package/src/lib/date/date.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Maybe } from '../value/maybe.type';
|
|
1
|
+
import { type MaybeNot, type Maybe } from '../value/maybe.type';
|
|
2
2
|
/**
|
|
3
3
|
* The past or future direction.
|
|
4
4
|
*/
|
|
@@ -232,3 +232,14 @@ export declare function isEqualDate(a: Date, b: Date): boolean;
|
|
|
232
232
|
* @returns
|
|
233
233
|
*/
|
|
234
234
|
export declare function isPast(input: Date): boolean;
|
|
235
|
+
/**
|
|
236
|
+
* Adds milliseconds to the input date.
|
|
237
|
+
*
|
|
238
|
+
* If no date is input, then returns the input.
|
|
239
|
+
*
|
|
240
|
+
* @param input
|
|
241
|
+
* @param ms
|
|
242
|
+
*/
|
|
243
|
+
export declare function addMilliseconds(input: Date, ms: Maybe<Milliseconds>): Date;
|
|
244
|
+
export declare function addMilliseconds(input: MaybeNot, ms: Maybe<Milliseconds>): MaybeNot;
|
|
245
|
+
export declare function addMilliseconds(input: Maybe<Date>, ms: Maybe<Milliseconds>): Maybe<Date>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Maybe, type MaybeNot } from '../value/maybe.type';
|
|
2
|
+
import { type DateOrUnixDateTimeNumber, type UnixDateTimeNumber } from './date';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a Date object or unix timestamp number to a unix timestamp number.
|
|
5
|
+
*
|
|
6
|
+
* @param input - Date object or unix timestamp number to convert
|
|
7
|
+
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare function unixTimeNumberFromDateOrTimeNumber(input: Maybe<DateOrUnixDateTimeNumber>): Maybe<UnixDateTimeNumber>;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the current time as a unix timestamp number.
|
|
12
|
+
*
|
|
13
|
+
* @returns Current time as unix timestamp number
|
|
14
|
+
*/
|
|
15
|
+
export declare function unixTimeNumberForNow(): UnixDateTimeNumber;
|
|
16
|
+
/**
|
|
17
|
+
* Converts a Date object to a unix timestamp number.
|
|
18
|
+
*
|
|
19
|
+
* @param date - Date object to convert
|
|
20
|
+
* @returns Unix timestamp number if date is valid, null/undefined if date is null/undefined
|
|
21
|
+
*/
|
|
22
|
+
export declare function unixTimeNumberFromDate(date: Date): UnixDateTimeNumber;
|
|
23
|
+
export declare function unixTimeNumberFromDate(date: MaybeNot): MaybeNot;
|
|
24
|
+
/**
|
|
25
|
+
* Converts a Date object or unix timestamp number to a Date object.
|
|
26
|
+
*
|
|
27
|
+
* @param input - Date object or unix timestamp number to convert
|
|
28
|
+
* @returns Date object if input is valid, null/undefined if input is null/undefined
|
|
29
|
+
*/
|
|
30
|
+
export declare function dateFromDateOrTimeNumber(input: Maybe<DateOrUnixDateTimeNumber>): Maybe<Date>;
|
|
31
|
+
/**
|
|
32
|
+
* Converts a unix timestamp number to a Date object.
|
|
33
|
+
*
|
|
34
|
+
* @param dateTimeNumber - Unix timestamp number to convert
|
|
35
|
+
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
36
|
+
*/
|
|
37
|
+
export declare function unixTimeNumberToDate(dateTimeNumber: Maybe<UnixDateTimeNumber>): Maybe<Date>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type Maybe } from '../value/maybe.type';
|
|
2
|
+
import { type DateOrUnixDateTimeNumber, type Milliseconds } from './date';
|
|
3
|
+
/**
|
|
4
|
+
* An object that can expire.
|
|
5
|
+
*/
|
|
6
|
+
export interface Expires {
|
|
7
|
+
/**
|
|
8
|
+
* Date this object expires at. If not defined, it has expired.
|
|
9
|
+
*/
|
|
10
|
+
expiresAt?: Maybe<Date>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* expirationDetails() input.
|
|
14
|
+
*
|
|
15
|
+
* The priority that the expiration calculation uses takes the following order:
|
|
16
|
+
* 1. expires
|
|
17
|
+
* 2. expiresAt
|
|
18
|
+
* 3. date + expiresIn
|
|
19
|
+
*/
|
|
20
|
+
export interface ExpirationDetailsInput<T extends Expires = Expires> extends Expires {
|
|
21
|
+
/**
|
|
22
|
+
* Existing expires instance to use.
|
|
23
|
+
*
|
|
24
|
+
* If provided/
|
|
25
|
+
*/
|
|
26
|
+
expires?: Maybe<T>;
|
|
27
|
+
/**
|
|
28
|
+
* Current time override to use.
|
|
29
|
+
*/
|
|
30
|
+
now?: Maybe<Date>;
|
|
31
|
+
/**
|
|
32
|
+
* The base date or time number to calculate expirations from.
|
|
33
|
+
*
|
|
34
|
+
* If not provided, defaults to now.
|
|
35
|
+
*/
|
|
36
|
+
expiresFromDate?: Maybe<DateOrUnixDateTimeNumber>;
|
|
37
|
+
/**
|
|
38
|
+
* Time after "now" that expiration will occur.
|
|
39
|
+
*/
|
|
40
|
+
expiresIn?: Maybe<Milliseconds>;
|
|
41
|
+
}
|
|
42
|
+
export interface ExpirationDetails<T extends Expires = Expires> {
|
|
43
|
+
/**
|
|
44
|
+
* Input used to create this instance.
|
|
45
|
+
*/
|
|
46
|
+
readonly input: ExpirationDetailsInput<T>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns true if the expiration time has passed.
|
|
49
|
+
*
|
|
50
|
+
* @param nowOverride
|
|
51
|
+
*/
|
|
52
|
+
hasExpired(nowOverride?: Maybe<Date>): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the expiration date.
|
|
55
|
+
*
|
|
56
|
+
* Returns null if no expiration is defined.
|
|
57
|
+
*
|
|
58
|
+
* @param nowOverride
|
|
59
|
+
*/
|
|
60
|
+
getExpirationDate(nowOverride?: Maybe<Date>): Maybe<Date>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns expiration details for the input.
|
|
64
|
+
*
|
|
65
|
+
* @param input
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
export declare function expirationDetails<T extends Expires = Expires>(input: ExpirationDetailsInput<T>): ExpirationDetails<T>;
|
|
69
|
+
/**
|
|
70
|
+
* Convenience function for calculating and returning the expiration date given the input.
|
|
71
|
+
*
|
|
72
|
+
* @param input Input used to calculate the expiration date.
|
|
73
|
+
* @returns The expiration date, if applicable.
|
|
74
|
+
*/
|
|
75
|
+
export declare function calculateExpirationDate(input: ExpirationDetailsInput<any>): Maybe<Date>;
|
|
76
|
+
/**
|
|
77
|
+
* Convenience function for quickly calculating throttling given a throttle time and last run time.
|
|
78
|
+
*
|
|
79
|
+
* Returns true if the throttle time has not passed since the last run time, compared to now.
|
|
80
|
+
|
|
81
|
+
* @param throttleTime Time after "now" that expiration will occur.
|
|
82
|
+
* @param lastRunAt Time the last run occurred.
|
|
83
|
+
* @param now Optional override for the current time. Defaults to the current time.
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
export declare function isThrottled(throttleTime: Maybe<Milliseconds>, lastRunAt: Maybe<DateOrUnixDateTimeNumber>, now?: Maybe<Date>): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Returns true if any of the input ExpirationDetails have not expired.
|
|
89
|
+
*
|
|
90
|
+
* If the list is empty, returns false.
|
|
91
|
+
*
|
|
92
|
+
* @param details List of ExpirationDetails to check.
|
|
93
|
+
* @returns True if any of the input ExpirationDetails have not expired.
|
|
94
|
+
*/
|
|
95
|
+
export declare function checkAtleastOneNotExpired(details: ExpirationDetails<any>[]): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Returns true if any of the input ExpirationDetails have expired.
|
|
98
|
+
*
|
|
99
|
+
* If the list is empty, returns the value of the second argument.
|
|
100
|
+
*
|
|
101
|
+
* @param details List of ExpirationDetails to check.
|
|
102
|
+
* @param defaultIfEmpty Default value to return if the list is empty. True by default.
|
|
103
|
+
* @returns True if any of the input ExpirationDetails have expired.
|
|
104
|
+
*/
|
|
105
|
+
export declare function checkAnyHaveExpired(details: ExpirationDetails<any>[], defaultIfEmpty?: boolean): boolean;
|
package/src/lib/date/index.d.ts
CHANGED
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
|
+
## [11.1.5](https://github.com/dereekb/dbx-components/compare/v11.1.4-dev...v11.1.5) (2025-03-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [11.1.4](https://github.com/dereekb/dbx-components/compare/v11.1.3-dev...v11.1.4) (2025-03-17)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
## [11.1.3](https://github.com/dereekb/dbx-components/compare/v11.1.2-dev...v11.1.3) (2025-03-07)
|
|
6
14
|
|
|
7
15
|
|