@dereekb/util 12.5.10 → 12.6.0
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 +221 -38
- package/index.esm.js +188 -39
- package/package.json +1 -1
- package/src/lib/date/date.d.ts +27 -3
- package/src/lib/date/date.unix.d.ts +38 -10
- package/src/lib/object/object.d.ts +2 -2
- package/src/lib/path/index.d.ts +1 -0
- package/src/lib/path/path.d.ts +4 -0
- package/src/lib/path/path.tree.d.ts +23 -0
- package/src/lib/string/index.d.ts +1 -0
- package/src/lib/string/mimetype.d.ts +75 -3
- package/src/lib/string/record.d.ts +11 -0
- package/test/CHANGELOG.md +4 -0
- package/test/package.json +1 -1
package/fetch/package.json
CHANGED
package/index.cjs.js
CHANGED
|
@@ -8068,6 +8068,20 @@ function cssClassesSet(cssClasses) {
|
|
|
8068
8068
|
return result;
|
|
8069
8069
|
}
|
|
8070
8070
|
|
|
8071
|
+
/**
|
|
8072
|
+
* Inverts a string record, inverting the key and value of each entry in the record.
|
|
8073
|
+
*
|
|
8074
|
+
* @param record
|
|
8075
|
+
* @returns
|
|
8076
|
+
*/
|
|
8077
|
+
function invertStringRecord(record) {
|
|
8078
|
+
const inverted = {};
|
|
8079
|
+
Object.entries(record).forEach(([key, value]) => {
|
|
8080
|
+
inverted[value] = key;
|
|
8081
|
+
});
|
|
8082
|
+
return inverted;
|
|
8083
|
+
}
|
|
8084
|
+
|
|
8071
8085
|
const JPEG_MIME_TYPE = 'image/jpeg';
|
|
8072
8086
|
const PNG_MIME_TYPE = 'image/png';
|
|
8073
8087
|
const WEBP_MIME_TYPE = 'image/webp';
|
|
@@ -8076,37 +8090,82 @@ const HEIF_MIME_TYPE = 'image/heif';
|
|
|
8076
8090
|
const TIFF_MIME_TYPE = 'image/tiff';
|
|
8077
8091
|
const SVG_MIME_TYPE = 'image/svg+xml';
|
|
8078
8092
|
const RAW_MIME_TYPE = 'image/raw';
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8093
|
+
const IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
|
|
8094
|
+
jpeg: JPEG_MIME_TYPE,
|
|
8095
|
+
jpg: JPEG_MIME_TYPE,
|
|
8096
|
+
png: PNG_MIME_TYPE,
|
|
8097
|
+
webp: WEBP_MIME_TYPE,
|
|
8098
|
+
gif: GIF_MIME_TYPE,
|
|
8099
|
+
svg: SVG_MIME_TYPE,
|
|
8100
|
+
raw: RAW_MIME_TYPE,
|
|
8101
|
+
heif: HEIF_MIME_TYPE,
|
|
8102
|
+
tiff: TIFF_MIME_TYPE
|
|
8103
|
+
};
|
|
8104
|
+
const IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = invertStringRecord(IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD);
|
|
8105
|
+
function mimeTypeForImageFileExtension(extension) {
|
|
8106
|
+
return extension ? IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD[extension] : undefined;
|
|
8107
|
+
}
|
|
8108
|
+
function imageFileExtensionForMimeType(mimeType) {
|
|
8109
|
+
return mimeType ? IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
|
|
8110
|
+
}
|
|
8111
|
+
const PDF_MIME_TYPE = 'application/pdf';
|
|
8112
|
+
const DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
8113
|
+
const XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
8114
|
+
const TXT_MIME_TYPE = 'text/plain';
|
|
8115
|
+
const CSV_MIME_TYPE = 'text/csv';
|
|
8116
|
+
const HTML_MIME_TYPE = 'text/html';
|
|
8117
|
+
const XML_MIME_TYPE = 'application/xml';
|
|
8118
|
+
const JSON_MIME_TYPE = 'application/json';
|
|
8119
|
+
const YAML_MIME_TYPE = 'application/yaml';
|
|
8120
|
+
const MARKDOWN_MIME_TYPE = 'text/markdown';
|
|
8121
|
+
const DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
|
|
8122
|
+
pdf: PDF_MIME_TYPE,
|
|
8123
|
+
docx: DOCX_MIME_TYPE,
|
|
8124
|
+
xlsx: XLSX_MIME_TYPE,
|
|
8125
|
+
txt: TXT_MIME_TYPE,
|
|
8126
|
+
csv: CSV_MIME_TYPE,
|
|
8127
|
+
html: HTML_MIME_TYPE,
|
|
8128
|
+
xml: XML_MIME_TYPE,
|
|
8129
|
+
json: JSON_MIME_TYPE,
|
|
8130
|
+
yaml: YAML_MIME_TYPE,
|
|
8131
|
+
md: MARKDOWN_MIME_TYPE
|
|
8132
|
+
};
|
|
8133
|
+
const DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = invertStringRecord(DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD);
|
|
8134
|
+
function mimeTypeForDocumentFileExtension(extension) {
|
|
8135
|
+
return extension ? DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD[extension] : undefined;
|
|
8136
|
+
}
|
|
8137
|
+
/**
|
|
8138
|
+
* Returns the document file extension for the given mimetype, or undefined if the mimetype is not known/recognized.
|
|
8139
|
+
*
|
|
8140
|
+
* @param mimeType The mimetype to get the document file extension for.
|
|
8141
|
+
* @returns The document file extension for the given mimetype, or undefined if the mimetype is not known.
|
|
8142
|
+
*/
|
|
8143
|
+
function documentFileExtensionForMimeType(mimeType) {
|
|
8144
|
+
return mimeType ? DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
|
|
8145
|
+
}
|
|
8146
|
+
const ZIP_FILE_MIME_TYPE = 'application/zip';
|
|
8147
|
+
const APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
|
|
8148
|
+
zip: ZIP_FILE_MIME_TYPE
|
|
8149
|
+
};
|
|
8150
|
+
const APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = invertStringRecord(APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD);
|
|
8151
|
+
function mimeTypeForApplicationFileExtension(extension) {
|
|
8152
|
+
return extension ? APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD[extension] : undefined;
|
|
8153
|
+
}
|
|
8154
|
+
function applicationFileExtensionForMimeType(mimeType) {
|
|
8155
|
+
return mimeType ? APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
|
|
8156
|
+
}
|
|
8157
|
+
function mimeTypeForFileExtension(extension) {
|
|
8158
|
+
const result = mimeTypeForImageFileExtension(extension) ?? mimeTypeForDocumentFileExtension(extension);
|
|
8159
|
+
return result;
|
|
8160
|
+
}
|
|
8161
|
+
function fileExtensionForMimeType(mimeType) {
|
|
8162
|
+
const result = imageFileExtensionForMimeType(mimeType) ?? documentFileExtensionForMimeType(mimeType) ?? applicationFileExtensionForMimeType(mimeType);
|
|
8108
8163
|
return result;
|
|
8109
8164
|
}
|
|
8165
|
+
/**
|
|
8166
|
+
* @deprecated Use mimeTypeForImageFileExtension instead.
|
|
8167
|
+
*/
|
|
8168
|
+
const mimetypeForImageType = mimeTypeForImageFileExtension;
|
|
8110
8169
|
|
|
8111
8170
|
/**
|
|
8112
8171
|
* Creates a CharacterPrefixSuffixInstance
|
|
@@ -10702,6 +10761,24 @@ function monthDaySlashDateToDateString(slashDate) {
|
|
|
10702
10761
|
const result = `${year}-${month}-${day}`;
|
|
10703
10762
|
return result;
|
|
10704
10763
|
}
|
|
10764
|
+
function dateFromDateOrTimeMillisecondsNumber(input) {
|
|
10765
|
+
if (input == null) {
|
|
10766
|
+
return input;
|
|
10767
|
+
} else if (isDate(input)) {
|
|
10768
|
+
return input;
|
|
10769
|
+
} else {
|
|
10770
|
+
return unixMillisecondsNumberToDate(input);
|
|
10771
|
+
}
|
|
10772
|
+
}
|
|
10773
|
+
/**
|
|
10774
|
+
* Converts a unix timestamp number to a Date object.
|
|
10775
|
+
*
|
|
10776
|
+
* @param dateTimeNumber - Unix timestamp number to convert
|
|
10777
|
+
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
10778
|
+
*/
|
|
10779
|
+
function unixMillisecondsNumberToDate(dateTimeNumber) {
|
|
10780
|
+
return dateTimeNumber != null ? new Date(dateTimeNumber) : dateTimeNumber;
|
|
10781
|
+
}
|
|
10705
10782
|
/**
|
|
10706
10783
|
* Converts the input DateOrMilliseconds to a Date.
|
|
10707
10784
|
*
|
|
@@ -11410,11 +11487,11 @@ function objectIsEmpty(obj) {
|
|
|
11410
11487
|
* @param input - Date object or unix timestamp number to convert
|
|
11411
11488
|
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
11412
11489
|
*/
|
|
11413
|
-
function
|
|
11490
|
+
function unixDateTimeSecondsNumberFromDateOrTimeNumber(input) {
|
|
11414
11491
|
if (input == null) {
|
|
11415
11492
|
return input;
|
|
11416
11493
|
} else if (isDate(input)) {
|
|
11417
|
-
return
|
|
11494
|
+
return unixDateTimeSecondsNumberFromDate(input);
|
|
11418
11495
|
} else {
|
|
11419
11496
|
return input;
|
|
11420
11497
|
}
|
|
@@ -11424,19 +11501,19 @@ function unixTimeNumberFromDateOrTimeNumber(input) {
|
|
|
11424
11501
|
*
|
|
11425
11502
|
* @returns Current time as unix timestamp number
|
|
11426
11503
|
*/
|
|
11427
|
-
function
|
|
11428
|
-
return
|
|
11504
|
+
function unixDateTimeSecondsNumberForNow() {
|
|
11505
|
+
return unixDateTimeSecondsNumberFromDate(new Date());
|
|
11429
11506
|
}
|
|
11430
|
-
function
|
|
11507
|
+
function unixDateTimeSecondsNumberFromDate(date) {
|
|
11431
11508
|
return date != null ? Math.ceil(date.getTime() / 1000) : date;
|
|
11432
11509
|
}
|
|
11433
|
-
function
|
|
11510
|
+
function dateFromDateOrTimeSecondsNumber(input) {
|
|
11434
11511
|
if (input == null) {
|
|
11435
11512
|
return input;
|
|
11436
11513
|
} else if (isDate(input)) {
|
|
11437
11514
|
return input;
|
|
11438
11515
|
} else {
|
|
11439
|
-
return
|
|
11516
|
+
return unixDateTimeSecondsNumberToDate(input);
|
|
11440
11517
|
}
|
|
11441
11518
|
}
|
|
11442
11519
|
/**
|
|
@@ -11445,9 +11522,29 @@ function dateFromDateOrTimeNumber(input) {
|
|
|
11445
11522
|
* @param dateTimeNumber - Unix timestamp number to convert
|
|
11446
11523
|
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
11447
11524
|
*/
|
|
11448
|
-
function
|
|
11525
|
+
function unixDateTimeSecondsNumberToDate(dateTimeNumber) {
|
|
11449
11526
|
return dateTimeNumber != null ? new Date(dateTimeNumber * 1000) : dateTimeNumber;
|
|
11450
11527
|
}
|
|
11528
|
+
/**
|
|
11529
|
+
* @deprecated use unixDateTimeSecondsNumberFromDateOrTimeNumber instead
|
|
11530
|
+
*/
|
|
11531
|
+
const unixTimeNumberFromDateOrTimeNumber = unixDateTimeSecondsNumberFromDateOrTimeNumber;
|
|
11532
|
+
/**
|
|
11533
|
+
* @deprecated use unixDateTimeSecondsNumberForNow instead
|
|
11534
|
+
*/
|
|
11535
|
+
const unixTimeNumberForNow = unixDateTimeSecondsNumberForNow;
|
|
11536
|
+
/**
|
|
11537
|
+
* @deprecated use unixDateTimeSecondsNumberFromDate instead
|
|
11538
|
+
*/
|
|
11539
|
+
const unixTimeNumberFromDate = unixDateTimeSecondsNumberFromDate;
|
|
11540
|
+
/**
|
|
11541
|
+
* @deprecated use dateFromDateOrTimeSecondsNumber instead
|
|
11542
|
+
*/
|
|
11543
|
+
const dateFromDateOrTimeNumber = dateFromDateOrTimeSecondsNumber;
|
|
11544
|
+
/**
|
|
11545
|
+
* @deprecated use unixDateTimeSecondsNumberToDate instead
|
|
11546
|
+
*/
|
|
11547
|
+
const unixTimeNumberToDate = unixDateTimeSecondsNumberToDate;
|
|
11451
11548
|
|
|
11452
11549
|
/**
|
|
11453
11550
|
* Returns expiration details for the input configuration.
|
|
@@ -11466,7 +11563,7 @@ function expirationDetails(input) {
|
|
|
11466
11563
|
defaultExpiresFromDateToNow,
|
|
11467
11564
|
expiresIn
|
|
11468
11565
|
} = input;
|
|
11469
|
-
const parsedExpiresFromDate = expiresFromDate != null ?
|
|
11566
|
+
const parsedExpiresFromDate = expiresFromDate != null ? dateFromDateOrTimeMillisecondsNumber(expiresFromDate) : null;
|
|
11470
11567
|
function getNow(nowOverride) {
|
|
11471
11568
|
const now = nowOverride ?? inputNow ?? new Date();
|
|
11472
11569
|
return now;
|
|
@@ -14278,9 +14375,63 @@ async function iterateFilteredPages(inputPage, loadFn, iterFn) {
|
|
|
14278
14375
|
return count;
|
|
14279
14376
|
}
|
|
14280
14377
|
|
|
14378
|
+
function slashPathDirectoryTree(nodeValues, options) {
|
|
14379
|
+
const {
|
|
14380
|
+
includeChildrenWithMissingParentFolder
|
|
14381
|
+
} = options ?? {};
|
|
14382
|
+
/**
|
|
14383
|
+
* Create all nodes first.
|
|
14384
|
+
*/
|
|
14385
|
+
const nodes = nodeValues.map(x => ({
|
|
14386
|
+
depth: x.slashPathDetails.parts.length - 1,
|
|
14387
|
+
value: x
|
|
14388
|
+
}));
|
|
14389
|
+
const nodeMap = new Map();
|
|
14390
|
+
nodes.forEach(node => {
|
|
14391
|
+
// only add typed files to the node map
|
|
14392
|
+
if (!node.value.slashPathDetails.typedFile) {
|
|
14393
|
+
const key = node.value.slashPathDetails.parts.join('/');
|
|
14394
|
+
nodeMap.set(key, node);
|
|
14395
|
+
}
|
|
14396
|
+
});
|
|
14397
|
+
/**
|
|
14398
|
+
* Create the tree second, and add the root children nodes.
|
|
14399
|
+
*/
|
|
14400
|
+
const children = [];
|
|
14401
|
+
nodes.forEach(node => {
|
|
14402
|
+
const {
|
|
14403
|
+
slashPathDetails
|
|
14404
|
+
} = node.value;
|
|
14405
|
+
const parts = slashPathDetails.parts;
|
|
14406
|
+
if (parts.length > 1) {
|
|
14407
|
+
const parentParts = parts.slice(0, parts.length - 1);
|
|
14408
|
+
const parentKey = parentParts.join('/');
|
|
14409
|
+
const parent = nodeMap.get(parentKey);
|
|
14410
|
+
if (parent) {
|
|
14411
|
+
if (!parent.children) {
|
|
14412
|
+
parent.children = [];
|
|
14413
|
+
}
|
|
14414
|
+
parent.children.push(node);
|
|
14415
|
+
node.parent = parent;
|
|
14416
|
+
} else if (includeChildrenWithMissingParentFolder) {
|
|
14417
|
+
children.push(node);
|
|
14418
|
+
}
|
|
14419
|
+
} else {
|
|
14420
|
+
children.push(node);
|
|
14421
|
+
}
|
|
14422
|
+
});
|
|
14423
|
+
const root = {
|
|
14424
|
+
depth: -1,
|
|
14425
|
+
children
|
|
14426
|
+
};
|
|
14427
|
+
return root;
|
|
14428
|
+
}
|
|
14429
|
+
|
|
14281
14430
|
exports.ALL_DOUBLE_SLASHES_REGEX = ALL_DOUBLE_SLASHES_REGEX;
|
|
14282
14431
|
exports.ALL_SLASHES_REGEX = ALL_SLASHES_REGEX;
|
|
14283
14432
|
exports.ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX;
|
|
14433
|
+
exports.APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD = APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD;
|
|
14434
|
+
exports.APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD;
|
|
14284
14435
|
exports.ASSERTION_ERROR_CODE = ASSERTION_ERROR_CODE;
|
|
14285
14436
|
exports.ASSERTION_HANDLER = ASSERTION_HANDLER;
|
|
14286
14437
|
exports.AUTH_ADMIN_ROLE = AUTH_ADMIN_ROLE;
|
|
@@ -14299,6 +14450,7 @@ exports.BooleanStringKeyArrayUtility = BooleanStringKeyArrayUtility;
|
|
|
14299
14450
|
exports.BooleanStringKeyArrayUtilityInstance = BooleanStringKeyArrayUtilityInstance;
|
|
14300
14451
|
exports.CATCH_ALL_HANDLE_RESULT_KEY = CATCH_ALL_HANDLE_RESULT_KEY;
|
|
14301
14452
|
exports.COMMA_JOINER = COMMA_JOINER;
|
|
14453
|
+
exports.CSV_MIME_TYPE = CSV_MIME_TYPE;
|
|
14302
14454
|
exports.CUT_VALUE_TO_ZERO_PRECISION = CUT_VALUE_TO_ZERO_PRECISION;
|
|
14303
14455
|
exports.DASH_CHARACTER_PREFIX_INSTANCE = DASH_CHARACTER_PREFIX_INSTANCE;
|
|
14304
14456
|
exports.DATE_NOW_VALUE = DATE_NOW_VALUE;
|
|
@@ -14311,6 +14463,9 @@ exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS = DEFAULT_SLASH_PATH_ILLEGAL_CHARA
|
|
|
14311
14463
|
exports.DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT = DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT;
|
|
14312
14464
|
exports.DEFAULT_SLASH_PATH_PATH_MATCHER_NON_MATCHING_FILL_VALUE = DEFAULT_SLASH_PATH_PATH_MATCHER_NON_MATCHING_FILL_VALUE;
|
|
14313
14465
|
exports.DEFAULT_UNKNOWN_MODEL_TYPE_STRING = DEFAULT_UNKNOWN_MODEL_TYPE_STRING;
|
|
14466
|
+
exports.DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD = DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD;
|
|
14467
|
+
exports.DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD;
|
|
14468
|
+
exports.DOCX_MIME_TYPE = DOCX_MIME_TYPE;
|
|
14314
14469
|
exports.DOLLAR_AMOUNT_PRECISION = DOLLAR_AMOUNT_PRECISION;
|
|
14315
14470
|
exports.DOLLAR_AMOUNT_STRING_REGEX = DOLLAR_AMOUNT_STRING_REGEX;
|
|
14316
14471
|
exports.DataDoesNotExistError = DataDoesNotExistError;
|
|
@@ -14330,12 +14485,16 @@ exports.HAS_PORT_NUMBER_REGEX = HAS_PORT_NUMBER_REGEX;
|
|
|
14330
14485
|
exports.HAS_WEBSITE_DOMAIN_NAME_REGEX = HAS_WEBSITE_DOMAIN_NAME_REGEX;
|
|
14331
14486
|
exports.HEIF_MIME_TYPE = HEIF_MIME_TYPE;
|
|
14332
14487
|
exports.HOURS_IN_DAY = HOURS_IN_DAY;
|
|
14488
|
+
exports.HTML_MIME_TYPE = HTML_MIME_TYPE;
|
|
14333
14489
|
exports.HTTP_OR_HTTPS_REGEX = HTTP_OR_HTTPS_REGEX;
|
|
14334
14490
|
exports.HashSet = HashSet;
|
|
14491
|
+
exports.IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD = IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD;
|
|
14492
|
+
exports.IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD;
|
|
14335
14493
|
exports.ISO8601_DAY_STRING_REGEX = ISO8601_DAY_STRING_REGEX;
|
|
14336
14494
|
exports.ISO8601_DAY_STRING_START_REGEX = ISO8601_DAY_STRING_START_REGEX;
|
|
14337
14495
|
exports.ISO_8601_DATE_STRING_REGEX = ISO_8601_DATE_STRING_REGEX;
|
|
14338
14496
|
exports.JPEG_MIME_TYPE = JPEG_MIME_TYPE;
|
|
14497
|
+
exports.JSON_MIME_TYPE = JSON_MIME_TYPE;
|
|
14339
14498
|
exports.LAT_LNG_PATTERN = LAT_LNG_PATTERN;
|
|
14340
14499
|
exports.LAT_LNG_PATTERN_MAX_PRECISION = LAT_LNG_PATTERN_MAX_PRECISION;
|
|
14341
14500
|
exports.LAT_LONG_100KM_PRECISION = LAT_LONG_100KM_PRECISION;
|
|
@@ -14350,6 +14509,7 @@ exports.LAT_LONG_1M_PRECISION = LAT_LONG_1M_PRECISION;
|
|
|
14350
14509
|
exports.LAT_LONG_GRAINS_OF_SAND_PRECISION = LAT_LONG_GRAINS_OF_SAND_PRECISION;
|
|
14351
14510
|
exports.LEADING_SLASHES_REGEX = LEADING_SLASHES_REGEX;
|
|
14352
14511
|
exports.MAP_IDENTITY = MAP_IDENTITY;
|
|
14512
|
+
exports.MARKDOWN_MIME_TYPE = MARKDOWN_MIME_TYPE;
|
|
14353
14513
|
exports.MAX_BITWISE_SET_SIZE = MAX_BITWISE_SET_SIZE;
|
|
14354
14514
|
exports.MAX_LATITUDE_VALUE = MAX_LATITUDE_VALUE;
|
|
14355
14515
|
exports.MAX_LONGITUDE_VALUE = MAX_LONGITUDE_VALUE;
|
|
@@ -14370,6 +14530,7 @@ exports.NOOP_MODIFIER = NOOP_MODIFIER;
|
|
|
14370
14530
|
exports.NUMBER_STRING_DENCODER_64 = NUMBER_STRING_DENCODER_64;
|
|
14371
14531
|
exports.NUMBER_STRING_DENCODER_64_DEFAULT_NEGATIVE_PREFIX = NUMBER_STRING_DENCODER_64_DEFAULT_NEGATIVE_PREFIX;
|
|
14372
14532
|
exports.NUMBER_STRING_DENCODER_64_DIGITS = NUMBER_STRING_DENCODER_64_DIGITS;
|
|
14533
|
+
exports.PDF_MIME_TYPE = PDF_MIME_TYPE;
|
|
14373
14534
|
exports.PHONE_EXTENSION_NUMBER_REGEX = PHONE_EXTENSION_NUMBER_REGEX;
|
|
14374
14535
|
exports.PNG_MIME_TYPE = PNG_MIME_TYPE;
|
|
14375
14536
|
exports.PRIMATIVE_KEY_DENCODER_VALUE = PRIMATIVE_KEY_DENCODER_VALUE;
|
|
@@ -14400,6 +14561,7 @@ exports.TOTAL_LONGITUDE_RANGE = TOTAL_LONGITUDE_RANGE;
|
|
|
14400
14561
|
exports.TOTAL_SPAN_OF_LONGITUDE = TOTAL_SPAN_OF_LONGITUDE;
|
|
14401
14562
|
exports.TRAILING_FILE_TYPE_SEPARATORS_REGEX = TRAILING_FILE_TYPE_SEPARATORS_REGEX;
|
|
14402
14563
|
exports.TRAILING_SLASHES_REGEX = TRAILING_SLASHES_REGEX;
|
|
14564
|
+
exports.TXT_MIME_TYPE = TXT_MIME_TYPE;
|
|
14403
14565
|
exports.TimerCancelledError = TimerCancelledError;
|
|
14404
14566
|
exports.TypedServiceRegistryInstance = TypedServiceRegistryInstance;
|
|
14405
14567
|
exports.UNLOADED_PAGE = UNLOADED_PAGE;
|
|
@@ -14413,7 +14575,11 @@ exports.UnauthorizedServerErrorResponse = UnauthorizedServerErrorResponse;
|
|
|
14413
14575
|
exports.WEBP_MIME_TYPE = WEBP_MIME_TYPE;
|
|
14414
14576
|
exports.WEBSITE_TLD_DETECTION_REGEX = WEBSITE_TLD_DETECTION_REGEX;
|
|
14415
14577
|
exports.WEB_PROTOCOL_PREFIX_REGEX = WEB_PROTOCOL_PREFIX_REGEX;
|
|
14578
|
+
exports.XLSX_MIME_TYPE = XLSX_MIME_TYPE;
|
|
14579
|
+
exports.XML_MIME_TYPE = XML_MIME_TYPE;
|
|
14580
|
+
exports.YAML_MIME_TYPE = YAML_MIME_TYPE;
|
|
14416
14581
|
exports.ZIP_CODE_STRING_REGEX = ZIP_CODE_STRING_REGEX;
|
|
14582
|
+
exports.ZIP_FILE_MIME_TYPE = ZIP_FILE_MIME_TYPE;
|
|
14417
14583
|
exports.addHttpToUrl = addHttpToUrl;
|
|
14418
14584
|
exports.addLatLngPoints = addLatLngPoints;
|
|
14419
14585
|
exports.addMilliseconds = addMilliseconds;
|
|
@@ -14436,6 +14602,7 @@ exports.allObjectsAreEqual = allObjectsAreEqual;
|
|
|
14436
14602
|
exports.allValuesAreMaybeNot = allValuesAreMaybeNot;
|
|
14437
14603
|
exports.allValuesAreNotMaybe = allValuesAreNotMaybe;
|
|
14438
14604
|
exports.allowValueOnceFilter = allowValueOnceFilter;
|
|
14605
|
+
exports.applicationFileExtensionForMimeType = applicationFileExtensionForMimeType;
|
|
14439
14606
|
exports.applyBestFit = applyBestFit;
|
|
14440
14607
|
exports.applySplitStringTreeWithMultipleValues = applySplitStringTreeWithMultipleValues;
|
|
14441
14608
|
exports.applyToMultipleFields = applyToMultipleFields;
|
|
@@ -14535,7 +14702,9 @@ exports.cutToPrecision = cutToPrecision;
|
|
|
14535
14702
|
exports.cutValueToInteger = cutValueToInteger;
|
|
14536
14703
|
exports.cutValueToPrecision = cutValueToPrecision;
|
|
14537
14704
|
exports.cutValueToPrecisionFunction = cutValueToPrecisionFunction;
|
|
14705
|
+
exports.dateFromDateOrTimeMillisecondsNumber = dateFromDateOrTimeMillisecondsNumber;
|
|
14538
14706
|
exports.dateFromDateOrTimeNumber = dateFromDateOrTimeNumber;
|
|
14707
|
+
exports.dateFromDateOrTimeSecondsNumber = dateFromDateOrTimeSecondsNumber;
|
|
14539
14708
|
exports.dateFromLogicalDate = dateFromLogicalDate;
|
|
14540
14709
|
exports.dateFromMinuteOfDay = dateFromMinuteOfDay;
|
|
14541
14710
|
exports.dateOrMillisecondsToDate = dateOrMillisecondsToDate;
|
|
@@ -14558,6 +14727,7 @@ exports.dencodeBitwiseSet = dencodeBitwiseSet;
|
|
|
14558
14727
|
exports.depthFirstExploreTreeTraversalFactoryFunction = depthFirstExploreTreeTraversalFactoryFunction;
|
|
14559
14728
|
exports.diffLatLngBoundPoints = diffLatLngBoundPoints;
|
|
14560
14729
|
exports.diffLatLngPoints = diffLatLngPoints;
|
|
14730
|
+
exports.documentFileExtensionForMimeType = documentFileExtensionForMimeType;
|
|
14561
14731
|
exports.dollarAmountString = dollarAmountString;
|
|
14562
14732
|
exports.dollarAmountStringWithUnitFunction = dollarAmountStringWithUnitFunction;
|
|
14563
14733
|
exports.e164PhoneNumberExtensionPair = e164PhoneNumberExtensionPair;
|
|
@@ -14584,6 +14754,7 @@ exports.expirationDetails = expirationDetails;
|
|
|
14584
14754
|
exports.exploreTreeFunction = exploreTreeFunction;
|
|
14585
14755
|
exports.exponentialPromiseRateLimiter = exponentialPromiseRateLimiter;
|
|
14586
14756
|
exports.extendLatLngBound = extendLatLngBound;
|
|
14757
|
+
exports.fileExtensionForMimeType = fileExtensionForMimeType;
|
|
14587
14758
|
exports.filterAndMapFunction = filterAndMapFunction;
|
|
14588
14759
|
exports.filterEmptyArrayValues = filterEmptyArrayValues;
|
|
14589
14760
|
exports.filterEmptyPojoValues = filterEmptyPojoValues;
|
|
@@ -14694,6 +14865,7 @@ exports.hashSetForIndexed = hashSetForIndexed;
|
|
|
14694
14865
|
exports.hourToFractionalHour = hourToFractionalHour;
|
|
14695
14866
|
exports.hoursAndMinutesToString = hoursAndMinutesToString;
|
|
14696
14867
|
exports.idBatchFactory = idBatchFactory;
|
|
14868
|
+
exports.imageFileExtensionForMimeType = imageFileExtensionForMimeType;
|
|
14697
14869
|
exports.incrementingNumberFactory = incrementingNumberFactory;
|
|
14698
14870
|
exports.indexDeltaGroup = indexDeltaGroup;
|
|
14699
14871
|
exports.indexDeltaGroupFunction = indexDeltaGroupFunction;
|
|
@@ -14711,6 +14883,7 @@ exports.invertBooleanReturnFunction = invertBooleanReturnFunction;
|
|
|
14711
14883
|
exports.invertDecision = invertDecision;
|
|
14712
14884
|
exports.invertFilter = invertFilter;
|
|
14713
14885
|
exports.invertMaybeBoolean = invertMaybeBoolean;
|
|
14886
|
+
exports.invertStringRecord = invertStringRecord;
|
|
14714
14887
|
exports.isAllowed = isAllowed;
|
|
14715
14888
|
exports.isClassLikeType = isClassLikeType;
|
|
14716
14889
|
exports.isCompleteUnitedStatesAddress = isCompleteUnitedStatesAddress;
|
|
@@ -14895,6 +15068,10 @@ exports.mergeObjectsFunction = mergeObjectsFunction;
|
|
|
14895
15068
|
exports.mergeSlashPaths = mergeSlashPaths;
|
|
14896
15069
|
exports.messageFromError = messageFromError;
|
|
14897
15070
|
exports.millisecondsToMinutesAndSeconds = millisecondsToMinutesAndSeconds;
|
|
15071
|
+
exports.mimeTypeForApplicationFileExtension = mimeTypeForApplicationFileExtension;
|
|
15072
|
+
exports.mimeTypeForDocumentFileExtension = mimeTypeForDocumentFileExtension;
|
|
15073
|
+
exports.mimeTypeForFileExtension = mimeTypeForFileExtension;
|
|
15074
|
+
exports.mimeTypeForImageFileExtension = mimeTypeForImageFileExtension;
|
|
14898
15075
|
exports.mimetypeForImageType = mimetypeForImageType;
|
|
14899
15076
|
exports.minAndMaxFunction = minAndMaxFunction;
|
|
14900
15077
|
exports.minAndMaxIndex = minAndMaxIndex;
|
|
@@ -15079,6 +15256,7 @@ exports.setsAreEquivalent = setsAreEquivalent;
|
|
|
15079
15256
|
exports.simpleSortValuesFunctionWithSortRef = simpleSortValuesFunctionWithSortRef;
|
|
15080
15257
|
exports.simplifyWhitespace = simplifyWhitespace;
|
|
15081
15258
|
exports.slashPathDetails = slashPathDetails;
|
|
15259
|
+
exports.slashPathDirectoryTree = slashPathDirectoryTree;
|
|
15082
15260
|
exports.slashPathFactory = slashPathFactory;
|
|
15083
15261
|
exports.slashPathFolder = slashPathFolder;
|
|
15084
15262
|
exports.slashPathFolderFactory = slashPathFolderFactory;
|
|
@@ -15165,6 +15343,11 @@ exports.uniqueCaseInsensitiveStringsSet = uniqueCaseInsensitiveStringsSet;
|
|
|
15165
15343
|
exports.uniqueKeys = uniqueKeys;
|
|
15166
15344
|
exports.uniqueModels = uniqueModels;
|
|
15167
15345
|
exports.unitedStatesAddressString = unitedStatesAddressString;
|
|
15346
|
+
exports.unixDateTimeSecondsNumberForNow = unixDateTimeSecondsNumberForNow;
|
|
15347
|
+
exports.unixDateTimeSecondsNumberFromDate = unixDateTimeSecondsNumberFromDate;
|
|
15348
|
+
exports.unixDateTimeSecondsNumberFromDateOrTimeNumber = unixDateTimeSecondsNumberFromDateOrTimeNumber;
|
|
15349
|
+
exports.unixDateTimeSecondsNumberToDate = unixDateTimeSecondsNumberToDate;
|
|
15350
|
+
exports.unixMillisecondsNumberToDate = unixMillisecondsNumberToDate;
|
|
15168
15351
|
exports.unixTimeNumberForNow = unixTimeNumberForNow;
|
|
15169
15352
|
exports.unixTimeNumberFromDate = unixTimeNumberFromDate;
|
|
15170
15353
|
exports.unixTimeNumberFromDateOrTimeNumber = unixTimeNumberFromDateOrTimeNumber;
|
package/index.esm.js
CHANGED
|
@@ -8066,6 +8066,20 @@ function cssClassesSet(cssClasses) {
|
|
|
8066
8066
|
return result;
|
|
8067
8067
|
}
|
|
8068
8068
|
|
|
8069
|
+
/**
|
|
8070
|
+
* Inverts a string record, inverting the key and value of each entry in the record.
|
|
8071
|
+
*
|
|
8072
|
+
* @param record
|
|
8073
|
+
* @returns
|
|
8074
|
+
*/
|
|
8075
|
+
function invertStringRecord(record) {
|
|
8076
|
+
const inverted = {};
|
|
8077
|
+
Object.entries(record).forEach(([key, value]) => {
|
|
8078
|
+
inverted[value] = key;
|
|
8079
|
+
});
|
|
8080
|
+
return inverted;
|
|
8081
|
+
}
|
|
8082
|
+
|
|
8069
8083
|
const JPEG_MIME_TYPE = 'image/jpeg';
|
|
8070
8084
|
const PNG_MIME_TYPE = 'image/png';
|
|
8071
8085
|
const WEBP_MIME_TYPE = 'image/webp';
|
|
@@ -8074,37 +8088,82 @@ const HEIF_MIME_TYPE = 'image/heif';
|
|
|
8074
8088
|
const TIFF_MIME_TYPE = 'image/tiff';
|
|
8075
8089
|
const SVG_MIME_TYPE = 'image/svg+xml';
|
|
8076
8090
|
const RAW_MIME_TYPE = 'image/raw';
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8091
|
+
const IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
|
|
8092
|
+
jpeg: JPEG_MIME_TYPE,
|
|
8093
|
+
jpg: JPEG_MIME_TYPE,
|
|
8094
|
+
png: PNG_MIME_TYPE,
|
|
8095
|
+
webp: WEBP_MIME_TYPE,
|
|
8096
|
+
gif: GIF_MIME_TYPE,
|
|
8097
|
+
svg: SVG_MIME_TYPE,
|
|
8098
|
+
raw: RAW_MIME_TYPE,
|
|
8099
|
+
heif: HEIF_MIME_TYPE,
|
|
8100
|
+
tiff: TIFF_MIME_TYPE
|
|
8101
|
+
};
|
|
8102
|
+
const IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = invertStringRecord(IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD);
|
|
8103
|
+
function mimeTypeForImageFileExtension(extension) {
|
|
8104
|
+
return extension ? IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD[extension] : undefined;
|
|
8105
|
+
}
|
|
8106
|
+
function imageFileExtensionForMimeType(mimeType) {
|
|
8107
|
+
return mimeType ? IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
|
|
8108
|
+
}
|
|
8109
|
+
const PDF_MIME_TYPE = 'application/pdf';
|
|
8110
|
+
const DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
8111
|
+
const XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
8112
|
+
const TXT_MIME_TYPE = 'text/plain';
|
|
8113
|
+
const CSV_MIME_TYPE = 'text/csv';
|
|
8114
|
+
const HTML_MIME_TYPE = 'text/html';
|
|
8115
|
+
const XML_MIME_TYPE = 'application/xml';
|
|
8116
|
+
const JSON_MIME_TYPE = 'application/json';
|
|
8117
|
+
const YAML_MIME_TYPE = 'application/yaml';
|
|
8118
|
+
const MARKDOWN_MIME_TYPE = 'text/markdown';
|
|
8119
|
+
const DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
|
|
8120
|
+
pdf: PDF_MIME_TYPE,
|
|
8121
|
+
docx: DOCX_MIME_TYPE,
|
|
8122
|
+
xlsx: XLSX_MIME_TYPE,
|
|
8123
|
+
txt: TXT_MIME_TYPE,
|
|
8124
|
+
csv: CSV_MIME_TYPE,
|
|
8125
|
+
html: HTML_MIME_TYPE,
|
|
8126
|
+
xml: XML_MIME_TYPE,
|
|
8127
|
+
json: JSON_MIME_TYPE,
|
|
8128
|
+
yaml: YAML_MIME_TYPE,
|
|
8129
|
+
md: MARKDOWN_MIME_TYPE
|
|
8130
|
+
};
|
|
8131
|
+
const DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = invertStringRecord(DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD);
|
|
8132
|
+
function mimeTypeForDocumentFileExtension(extension) {
|
|
8133
|
+
return extension ? DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD[extension] : undefined;
|
|
8134
|
+
}
|
|
8135
|
+
/**
|
|
8136
|
+
* Returns the document file extension for the given mimetype, or undefined if the mimetype is not known/recognized.
|
|
8137
|
+
*
|
|
8138
|
+
* @param mimeType The mimetype to get the document file extension for.
|
|
8139
|
+
* @returns The document file extension for the given mimetype, or undefined if the mimetype is not known.
|
|
8140
|
+
*/
|
|
8141
|
+
function documentFileExtensionForMimeType(mimeType) {
|
|
8142
|
+
return mimeType ? DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
|
|
8143
|
+
}
|
|
8144
|
+
const ZIP_FILE_MIME_TYPE = 'application/zip';
|
|
8145
|
+
const APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
|
|
8146
|
+
zip: ZIP_FILE_MIME_TYPE
|
|
8147
|
+
};
|
|
8148
|
+
const APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD = invertStringRecord(APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD);
|
|
8149
|
+
function mimeTypeForApplicationFileExtension(extension) {
|
|
8150
|
+
return extension ? APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD[extension] : undefined;
|
|
8151
|
+
}
|
|
8152
|
+
function applicationFileExtensionForMimeType(mimeType) {
|
|
8153
|
+
return mimeType ? APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
|
|
8154
|
+
}
|
|
8155
|
+
function mimeTypeForFileExtension(extension) {
|
|
8156
|
+
const result = mimeTypeForImageFileExtension(extension) ?? mimeTypeForDocumentFileExtension(extension);
|
|
8157
|
+
return result;
|
|
8158
|
+
}
|
|
8159
|
+
function fileExtensionForMimeType(mimeType) {
|
|
8160
|
+
const result = imageFileExtensionForMimeType(mimeType) ?? documentFileExtensionForMimeType(mimeType) ?? applicationFileExtensionForMimeType(mimeType);
|
|
8106
8161
|
return result;
|
|
8107
8162
|
}
|
|
8163
|
+
/**
|
|
8164
|
+
* @deprecated Use mimeTypeForImageFileExtension instead.
|
|
8165
|
+
*/
|
|
8166
|
+
const mimetypeForImageType = mimeTypeForImageFileExtension;
|
|
8108
8167
|
|
|
8109
8168
|
/**
|
|
8110
8169
|
* Creates a CharacterPrefixSuffixInstance
|
|
@@ -10700,6 +10759,24 @@ function monthDaySlashDateToDateString(slashDate) {
|
|
|
10700
10759
|
const result = `${year}-${month}-${day}`;
|
|
10701
10760
|
return result;
|
|
10702
10761
|
}
|
|
10762
|
+
function dateFromDateOrTimeMillisecondsNumber(input) {
|
|
10763
|
+
if (input == null) {
|
|
10764
|
+
return input;
|
|
10765
|
+
} else if (isDate(input)) {
|
|
10766
|
+
return input;
|
|
10767
|
+
} else {
|
|
10768
|
+
return unixMillisecondsNumberToDate(input);
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
10771
|
+
/**
|
|
10772
|
+
* Converts a unix timestamp number to a Date object.
|
|
10773
|
+
*
|
|
10774
|
+
* @param dateTimeNumber - Unix timestamp number to convert
|
|
10775
|
+
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
10776
|
+
*/
|
|
10777
|
+
function unixMillisecondsNumberToDate(dateTimeNumber) {
|
|
10778
|
+
return dateTimeNumber != null ? new Date(dateTimeNumber) : dateTimeNumber;
|
|
10779
|
+
}
|
|
10703
10780
|
/**
|
|
10704
10781
|
* Converts the input DateOrMilliseconds to a Date.
|
|
10705
10782
|
*
|
|
@@ -11408,11 +11485,11 @@ function objectIsEmpty(obj) {
|
|
|
11408
11485
|
* @param input - Date object or unix timestamp number to convert
|
|
11409
11486
|
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
11410
11487
|
*/
|
|
11411
|
-
function
|
|
11488
|
+
function unixDateTimeSecondsNumberFromDateOrTimeNumber(input) {
|
|
11412
11489
|
if (input == null) {
|
|
11413
11490
|
return input;
|
|
11414
11491
|
} else if (isDate(input)) {
|
|
11415
|
-
return
|
|
11492
|
+
return unixDateTimeSecondsNumberFromDate(input);
|
|
11416
11493
|
} else {
|
|
11417
11494
|
return input;
|
|
11418
11495
|
}
|
|
@@ -11422,19 +11499,19 @@ function unixTimeNumberFromDateOrTimeNumber(input) {
|
|
|
11422
11499
|
*
|
|
11423
11500
|
* @returns Current time as unix timestamp number
|
|
11424
11501
|
*/
|
|
11425
|
-
function
|
|
11426
|
-
return
|
|
11502
|
+
function unixDateTimeSecondsNumberForNow() {
|
|
11503
|
+
return unixDateTimeSecondsNumberFromDate(new Date());
|
|
11427
11504
|
}
|
|
11428
|
-
function
|
|
11505
|
+
function unixDateTimeSecondsNumberFromDate(date) {
|
|
11429
11506
|
return date != null ? Math.ceil(date.getTime() / 1000) : date;
|
|
11430
11507
|
}
|
|
11431
|
-
function
|
|
11508
|
+
function dateFromDateOrTimeSecondsNumber(input) {
|
|
11432
11509
|
if (input == null) {
|
|
11433
11510
|
return input;
|
|
11434
11511
|
} else if (isDate(input)) {
|
|
11435
11512
|
return input;
|
|
11436
11513
|
} else {
|
|
11437
|
-
return
|
|
11514
|
+
return unixDateTimeSecondsNumberToDate(input);
|
|
11438
11515
|
}
|
|
11439
11516
|
}
|
|
11440
11517
|
/**
|
|
@@ -11443,9 +11520,29 @@ function dateFromDateOrTimeNumber(input) {
|
|
|
11443
11520
|
* @param dateTimeNumber - Unix timestamp number to convert
|
|
11444
11521
|
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
11445
11522
|
*/
|
|
11446
|
-
function
|
|
11523
|
+
function unixDateTimeSecondsNumberToDate(dateTimeNumber) {
|
|
11447
11524
|
return dateTimeNumber != null ? new Date(dateTimeNumber * 1000) : dateTimeNumber;
|
|
11448
11525
|
}
|
|
11526
|
+
/**
|
|
11527
|
+
* @deprecated use unixDateTimeSecondsNumberFromDateOrTimeNumber instead
|
|
11528
|
+
*/
|
|
11529
|
+
const unixTimeNumberFromDateOrTimeNumber = unixDateTimeSecondsNumberFromDateOrTimeNumber;
|
|
11530
|
+
/**
|
|
11531
|
+
* @deprecated use unixDateTimeSecondsNumberForNow instead
|
|
11532
|
+
*/
|
|
11533
|
+
const unixTimeNumberForNow = unixDateTimeSecondsNumberForNow;
|
|
11534
|
+
/**
|
|
11535
|
+
* @deprecated use unixDateTimeSecondsNumberFromDate instead
|
|
11536
|
+
*/
|
|
11537
|
+
const unixTimeNumberFromDate = unixDateTimeSecondsNumberFromDate;
|
|
11538
|
+
/**
|
|
11539
|
+
* @deprecated use dateFromDateOrTimeSecondsNumber instead
|
|
11540
|
+
*/
|
|
11541
|
+
const dateFromDateOrTimeNumber = dateFromDateOrTimeSecondsNumber;
|
|
11542
|
+
/**
|
|
11543
|
+
* @deprecated use unixDateTimeSecondsNumberToDate instead
|
|
11544
|
+
*/
|
|
11545
|
+
const unixTimeNumberToDate = unixDateTimeSecondsNumberToDate;
|
|
11449
11546
|
|
|
11450
11547
|
/**
|
|
11451
11548
|
* Returns expiration details for the input configuration.
|
|
@@ -11464,7 +11561,7 @@ function expirationDetails(input) {
|
|
|
11464
11561
|
defaultExpiresFromDateToNow,
|
|
11465
11562
|
expiresIn
|
|
11466
11563
|
} = input;
|
|
11467
|
-
const parsedExpiresFromDate = expiresFromDate != null ?
|
|
11564
|
+
const parsedExpiresFromDate = expiresFromDate != null ? dateFromDateOrTimeMillisecondsNumber(expiresFromDate) : null;
|
|
11468
11565
|
function getNow(nowOverride) {
|
|
11469
11566
|
const now = nowOverride ?? inputNow ?? new Date();
|
|
11470
11567
|
return now;
|
|
@@ -14276,4 +14373,56 @@ async function iterateFilteredPages(inputPage, loadFn, iterFn) {
|
|
|
14276
14373
|
return count;
|
|
14277
14374
|
}
|
|
14278
14375
|
|
|
14279
|
-
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, COMMA_JOINER, CUT_VALUE_TO_ZERO_PRECISION, DASH_CHARACTER_PREFIX_INSTANCE, 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_SLASH_PATH_PATH_MATCHER_NON_MATCHING_FILL_VALUE, 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, ExploreTreeVisitNodeDecision, FINAL_PAGE, FIRST_PAGE, FRACTIONAL_HOURS_PRECISION_FUNCTION, FlattenTreeAddNodeDecision, FullStorageObject, GIF_MIME_TYPE, HAS_PORT_NUMBER_REGEX, HAS_WEBSITE_DOMAIN_NAME_REGEX, HEIF_MIME_TYPE, HOURS_IN_DAY, HTTP_OR_HTTPS_REGEX, HashSet, ISO8601_DAY_STRING_REGEX, ISO8601_DAY_STRING_START_REGEX, ISO_8601_DATE_STRING_REGEX, JPEG_MIME_TYPE, 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, PNG_MIME_TYPE, PRIMATIVE_KEY_DENCODER_VALUE, PageCalculator, PropertyDescriptorUtility, RAW_MIME_TYPE, 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, SPACE_JOINER, SPLIT_STRING_TREE_NODE_ROOT_VALUE, SVG_MIME_TYPE, ServerErrorResponse, SetDeltaChange, SimpleStorageObject, SlashPathPathMatcherPartCode, StorageObject, StorageObjectUtility, StoredDataError, SyncState, TIFF_MIME_TYPE, TOTAL_LATITUDE_RANGE, TOTAL_LONGITUDE_RANGE, TOTAL_SPAN_OF_LONGITUDE, TRAILING_FILE_TYPE_SEPARATORS_REGEX, TRAILING_SLASHES_REGEX, TimeAM, TimerCancelledError, 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, WEBP_MIME_TYPE, WEBSITE_TLD_DETECTION_REGEX, WEB_PROTOCOL_PREFIX_REGEX, ZIP_CODE_STRING_REGEX, addHttpToUrl, addLatLngPoints, addMilliseconds, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, addToSplitStringTree, addTrailingSlash, 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, breadthFirstExploreTreeTraversalFactoryFunction, build, cachedGetter, calculateExpirationDate, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, characterPrefixSuffixInstance, 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, dateOrMillisecondsToDate, dateToHoursAndMinutes, dateToMinuteOfDay, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, depthFirstExploreTreeTraversalFactoryFunction, diffLatLngBoundPoints, diffLatLngPoints, dollarAmountString, dollarAmountStringWithUnitFunction, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringCharactersFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandSlashPathPathMatcherPartToDecisionFunctions, expandTreeFunction, expandTrees, expirationDetails, exploreTreeFunction, exponentialPromiseRateLimiter, extendLatLngBound, filterAndMapFunction, filterEmptyArrayValues, filterEmptyPojoValues, 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, flattenWhitespace, 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, hoursAndMinutesToString, idBatchFactory, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexRefMap, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, invertMaybeBoolean, 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, isNotFalse, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPast, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStandardInternetAccessibleWebsiteUrl, isStringOrTrue, isThrottled, isTrueBooleanKeyArray, isUTCDateString, isUnderThreshold, isUniqueKeyedFunction, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterableToSet, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStrings, joinStringsWithCommas, 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, makeDefaultNonConcurrentTaskKeyFactory, makeGetter, makeHandler, makeHashDecodeMap, makeKeyPairs, makeModelConversionFieldValuesFunction, makeModelMap, makeModelMapFunctions, makeMultiModelKeyMap, makeTimer, 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, millisecondsToMinutesAndSeconds, mimetypeForImageType, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, minutesToHoursAndMinutes, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, monthOfYearFromUTCDate, 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, runNamedAsyncTasks, runNamedAsyncTasksFunction, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, secondsToMinutesAndSeconds, separateValues, separateValuesToSets, sequentialIncrementingNumberStringModelIdFactory, serverError, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, setDeltaChangeKeys, setDeltaFunction, setHasValueFunction, setIncludes, setIncludesFunction, setKeysOnMap, setWebProtocolPrefix, setsAreEquivalent, simpleSortValuesFunctionWithSortRef, simplifyWhitespace, slashPathDetails, slashPathFactory, slashPathFolder, slashPathFolderFactory, slashPathInvalidError, slashPathName, slashPathParts, slashPathPathMatcher, slashPathPathMatcherConfig, slashPathStartTypeFactory, slashPathSubPathMatcher, slashPathType, slashPathValidationFactory, sliceIndexRangeFunction, sliceStringFunction, sortAscendingIndexNumberRefFunction, sortByIndexAscendingCompareFunction, sortByIndexRangeAscendingCompareFunction, sortByLabelFunction, sortByNumberFunction, sortByStringFunction, sortCompareNumberFunction, sortNumbersAscendingFunction, sortValues, sortValuesFunctionOrMapIdentityWithSortRef, sortValuesFunctionWithSortRef, spaceSeparatedCssClasses, splitCommaSeparatedString, splitCommaSeparatedStringToSet, splitFront, splitJoinNameString, splitJoinRemainder, splitStringAtFirstCharacterOccurence, splitStringAtFirstCharacterOccurenceFunction, splitStringAtIndex, splitStringTreeFactory, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringCharactersToIndexRecord, stringContains, stringFactoryFromFactory, stringFromDateFactory, stringFromTimeFactory, stringToBoolean, 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, websiteUrlDetails, websiteUrlFromPaths, wrapIndexRangeFunction, wrapLatLngPoint, wrapLngValue, wrapMapFunctionOutput, wrapNumberFunction, wrapTuples, wrapUseAsyncFunction, wrapUseFunction };
|
|
14376
|
+
function slashPathDirectoryTree(nodeValues, options) {
|
|
14377
|
+
const {
|
|
14378
|
+
includeChildrenWithMissingParentFolder
|
|
14379
|
+
} = options ?? {};
|
|
14380
|
+
/**
|
|
14381
|
+
* Create all nodes first.
|
|
14382
|
+
*/
|
|
14383
|
+
const nodes = nodeValues.map(x => ({
|
|
14384
|
+
depth: x.slashPathDetails.parts.length - 1,
|
|
14385
|
+
value: x
|
|
14386
|
+
}));
|
|
14387
|
+
const nodeMap = new Map();
|
|
14388
|
+
nodes.forEach(node => {
|
|
14389
|
+
// only add typed files to the node map
|
|
14390
|
+
if (!node.value.slashPathDetails.typedFile) {
|
|
14391
|
+
const key = node.value.slashPathDetails.parts.join('/');
|
|
14392
|
+
nodeMap.set(key, node);
|
|
14393
|
+
}
|
|
14394
|
+
});
|
|
14395
|
+
/**
|
|
14396
|
+
* Create the tree second, and add the root children nodes.
|
|
14397
|
+
*/
|
|
14398
|
+
const children = [];
|
|
14399
|
+
nodes.forEach(node => {
|
|
14400
|
+
const {
|
|
14401
|
+
slashPathDetails
|
|
14402
|
+
} = node.value;
|
|
14403
|
+
const parts = slashPathDetails.parts;
|
|
14404
|
+
if (parts.length > 1) {
|
|
14405
|
+
const parentParts = parts.slice(0, parts.length - 1);
|
|
14406
|
+
const parentKey = parentParts.join('/');
|
|
14407
|
+
const parent = nodeMap.get(parentKey);
|
|
14408
|
+
if (parent) {
|
|
14409
|
+
if (!parent.children) {
|
|
14410
|
+
parent.children = [];
|
|
14411
|
+
}
|
|
14412
|
+
parent.children.push(node);
|
|
14413
|
+
node.parent = parent;
|
|
14414
|
+
} else if (includeChildrenWithMissingParentFolder) {
|
|
14415
|
+
children.push(node);
|
|
14416
|
+
}
|
|
14417
|
+
} else {
|
|
14418
|
+
children.push(node);
|
|
14419
|
+
}
|
|
14420
|
+
});
|
|
14421
|
+
const root = {
|
|
14422
|
+
depth: -1,
|
|
14423
|
+
children
|
|
14424
|
+
};
|
|
14425
|
+
return root;
|
|
14426
|
+
}
|
|
14427
|
+
|
|
14428
|
+
export { ALL_DOUBLE_SLASHES_REGEX, ALL_SLASHES_REGEX, ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX, APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD, APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD, 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, COMMA_JOINER, CSV_MIME_TYPE, CUT_VALUE_TO_ZERO_PRECISION, DASH_CHARACTER_PREFIX_INSTANCE, 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_SLASH_PATH_PATH_MATCHER_NON_MATCHING_FILL_VALUE, DEFAULT_UNKNOWN_MODEL_TYPE_STRING, DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD, DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD, DOCX_MIME_TYPE, 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, ExploreTreeVisitNodeDecision, FINAL_PAGE, FIRST_PAGE, FRACTIONAL_HOURS_PRECISION_FUNCTION, FlattenTreeAddNodeDecision, FullStorageObject, GIF_MIME_TYPE, HAS_PORT_NUMBER_REGEX, HAS_WEBSITE_DOMAIN_NAME_REGEX, HEIF_MIME_TYPE, HOURS_IN_DAY, HTML_MIME_TYPE, HTTP_OR_HTTPS_REGEX, HashSet, IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD, IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD, ISO8601_DAY_STRING_REGEX, ISO8601_DAY_STRING_START_REGEX, ISO_8601_DATE_STRING_REGEX, JPEG_MIME_TYPE, JSON_MIME_TYPE, 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, MARKDOWN_MIME_TYPE, 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, PDF_MIME_TYPE, PHONE_EXTENSION_NUMBER_REGEX, PNG_MIME_TYPE, PRIMATIVE_KEY_DENCODER_VALUE, PageCalculator, PropertyDescriptorUtility, RAW_MIME_TYPE, 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, SPACE_JOINER, SPLIT_STRING_TREE_NODE_ROOT_VALUE, SVG_MIME_TYPE, ServerErrorResponse, SetDeltaChange, SimpleStorageObject, SlashPathPathMatcherPartCode, StorageObject, StorageObjectUtility, StoredDataError, SyncState, TIFF_MIME_TYPE, TOTAL_LATITUDE_RANGE, TOTAL_LONGITUDE_RANGE, TOTAL_SPAN_OF_LONGITUDE, TRAILING_FILE_TYPE_SEPARATORS_REGEX, TRAILING_SLASHES_REGEX, TXT_MIME_TYPE, TimeAM, TimerCancelledError, 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, WEBP_MIME_TYPE, WEBSITE_TLD_DETECTION_REGEX, WEB_PROTOCOL_PREFIX_REGEX, XLSX_MIME_TYPE, XML_MIME_TYPE, YAML_MIME_TYPE, ZIP_CODE_STRING_REGEX, ZIP_FILE_MIME_TYPE, addHttpToUrl, addLatLngPoints, addMilliseconds, addModifiers, addPlusPrefixToNumber, addPrefix, addPrefixFunction, addSuffix, addSuffixFunction, addToSet, addToSetCopy, addToSplitStringTree, addTrailingSlash, allFalsyOrEmptyKeys, allIndexesInIndexRange, allKeyValueTuples, allMaybeSoKeys, allNonUndefinedKeys, allObjectsAreEqual, allValuesAreMaybeNot, allValuesAreNotMaybe, allowValueOnceFilter, applicationFileExtensionForMimeType, 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, breadthFirstExploreTreeTraversalFactoryFunction, build, cachedGetter, calculateExpirationDate, capLatValue, capitalizeFirstLetter, caseInsensitiveFilterByIndexOfDecisionFactory, caseInsensitiveString, catchAllHandlerKey, chainMapFunction, chainMapSameFunctions, characterPrefixSuffixInstance, 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, dateFromDateOrTimeMillisecondsNumber, dateFromDateOrTimeNumber, dateFromDateOrTimeSecondsNumber, dateFromLogicalDate, dateFromMinuteOfDay, dateOrMillisecondsToDate, dateToHoursAndMinutes, dateToMinuteOfDay, dayOfWeek, daysOfWeekArray, daysOfWeekFromEnabledDays, daysOfWeekNameFunction, daysOfWeekNameMap, decisionFunction, decodeHashedValues, decodeHashedValuesWithDecodeMap, decodeModelKeyTypePair, defaultFilterFromPOJOFunctionNoCopy, defaultForwardFunctionFactory, defaultLatLngPoint, defaultLatLngString, dencodeBitwiseSet, depthFirstExploreTreeTraversalFactoryFunction, diffLatLngBoundPoints, diffLatLngPoints, documentFileExtensionForMimeType, dollarAmountString, dollarAmountStringWithUnitFunction, e164PhoneNumberExtensionPair, e164PhoneNumberFromE164PhoneNumberExtensionPair, enabledDaysFromDaysOfWeek, encodeBitwiseSet, encodeModelKeyTypePair, errorMessageContainsString, errorMessageContainsStringFunction, escapeStringCharactersFunction, escapeStringForRegex, excludeValues, excludeValuesFromArray, excludeValuesFromSet, existsInIterable, expandArrayMapTuples, expandArrayValueTuples, expandFlattenTreeFunction, expandIndexSet, expandSlashPathPathMatcherPartToDecisionFunctions, expandTreeFunction, expandTrees, expirationDetails, exploreTreeFunction, exponentialPromiseRateLimiter, extendLatLngBound, fileExtensionForMimeType, filterAndMapFunction, filterEmptyArrayValues, filterEmptyPojoValues, 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, flattenWhitespace, 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, hoursAndMinutesToString, idBatchFactory, imageFileExtensionForMimeType, incrementingNumberFactory, indexDeltaGroup, indexDeltaGroupFunction, indexRange, indexRangeCheckFunction, indexRangeCheckReaderFunction, indexRangeForArray, indexRangeOverlapsIndexRange, indexRangeOverlapsIndexRangeFunction, indexRangeReaderPairFactory, indexRefMap, indexedValuesArrayAccessorFactory, insertIntoBooleanKeyArray, invertBooleanReturnFunction, invertDecision, invertFilter, invertMaybeBoolean, invertStringRecord, 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, isNotFalse, isNotNullOrEmptyString, isNumberDivisibleBy, isObjectWithConstructor, isOddNumber, isPast, isPromise, isPromiseLike, isSameLatLngBound, isSameLatLngPoint, isSameNonNullValue, isSameVector, isSelectedDecisionFunctionFactory, isSelectedIndexDecisionFunction, isServerError, isSlashPathFile, isSlashPathFolder, isSlashPathTypedFile, isStandardInternetAccessibleWebsiteUrl, isStringOrTrue, isThrottled, isTrueBooleanKeyArray, isUTCDateString, isUnderThreshold, isUniqueKeyedFunction, isUsStateCodeString, isValidLatLngPoint, isValidLatitude, isValidLongitude, isValidNumberBound, isValidPhoneExtensionNumber, isValidSlashPath, isWebsiteUrl, isWebsiteUrlWithPrefix, isWithinLatLngBoundFunction, isolateSlashPath, isolateSlashPathFunction, isolateWebsitePathFunction, itemCountForBatchIndex, iterableToArray, iterableToMap, iterableToSet, iterablesAreSetEquivalent, iterate, iterateFilteredPages, joinHostAndPort, joinStrings, joinStringsWithCommas, 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, makeDefaultNonConcurrentTaskKeyFactory, makeGetter, makeHandler, makeHashDecodeMap, makeKeyPairs, makeModelConversionFieldValuesFunction, makeModelMap, makeModelMapFunctions, makeMultiModelKeyMap, makeTimer, 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, millisecondsToMinutesAndSeconds, mimeTypeForApplicationFileExtension, mimeTypeForDocumentFileExtension, mimeTypeForFileExtension, mimeTypeForImageFileExtension, mimetypeForImageType, minAndMaxFunction, minAndMaxIndex, minAndMaxIndexFunction, minAndMaxIndexItemsFunction, minAndMaxNumber, minutesToFractionalHours, minutesToHoursAndMinutes, modelFieldConversions, modelFieldMapFunction, modelFieldMapFunctions, modelTypeDataPairFactory, modifier, modifierMapToFunction, modifyModelMapFunction, modifyModelMapFunctions, monthDaySlashDateToDateString, monthOfYearFromDate, monthOfYearFromDateMonth, monthOfYearFromUTCDate, 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, runNamedAsyncTasks, runNamedAsyncTasksFunction, safeCompareEquality, safeEqualityComparatorFunction, safeFindBestIndexMatch, searchStringFilterFunction, secondsToMinutesAndSeconds, separateValues, separateValuesToSets, sequentialIncrementingNumberStringModelIdFactory, serverError, setContainsAllValues, setContainsAnyValue, setContainsNoneOfValue, setDeltaChangeKeys, setDeltaFunction, setHasValueFunction, setIncludes, setIncludesFunction, setKeysOnMap, setWebProtocolPrefix, setsAreEquivalent, simpleSortValuesFunctionWithSortRef, simplifyWhitespace, slashPathDetails, slashPathDirectoryTree, slashPathFactory, slashPathFolder, slashPathFolderFactory, slashPathInvalidError, slashPathName, slashPathParts, slashPathPathMatcher, slashPathPathMatcherConfig, slashPathStartTypeFactory, slashPathSubPathMatcher, slashPathType, slashPathValidationFactory, sliceIndexRangeFunction, sliceStringFunction, sortAscendingIndexNumberRefFunction, sortByIndexAscendingCompareFunction, sortByIndexRangeAscendingCompareFunction, sortByLabelFunction, sortByNumberFunction, sortByStringFunction, sortCompareNumberFunction, sortNumbersAscendingFunction, sortValues, sortValuesFunctionOrMapIdentityWithSortRef, sortValuesFunctionWithSortRef, spaceSeparatedCssClasses, splitCommaSeparatedString, splitCommaSeparatedStringToSet, splitFront, splitJoinNameString, splitJoinRemainder, splitStringAtFirstCharacterOccurence, splitStringAtFirstCharacterOccurenceFunction, splitStringAtIndex, splitStringTreeFactory, startOfDayForSystemDateInUTC, startOfDayForUTCDateInUTC, stepsFromIndex, stepsFromIndexFunction, stringCharactersToIndexRecord, stringContains, stringFactoryFromFactory, stringFromDateFactory, stringFromTimeFactory, stringToBoolean, 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, unixDateTimeSecondsNumberForNow, unixDateTimeSecondsNumberFromDate, unixDateTimeSecondsNumberFromDateOrTimeNumber, unixDateTimeSecondsNumberToDate, unixMillisecondsNumberToDate, 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, websiteUrlDetails, websiteUrlFromPaths, wrapIndexRangeFunction, wrapLatLngPoint, wrapLngValue, wrapMapFunctionOutput, wrapNumberFunction, wrapTuples, wrapUseAsyncFunction, wrapUseFunction };
|
package/package.json
CHANGED
package/src/lib/date/date.d.ts
CHANGED
|
@@ -204,11 +204,27 @@ export declare function monthDaySlashDateToDateString(slashDate: MonthDaySlashDa
|
|
|
204
204
|
*
|
|
205
205
|
* Returned by Date.getTime().
|
|
206
206
|
*/
|
|
207
|
-
export type
|
|
207
|
+
export type UnixDateTimeMillisecondsNumber = number;
|
|
208
208
|
/**
|
|
209
|
-
* A date or a unix timestamp
|
|
209
|
+
* A date or a unix timestamp (in milliseconds)
|
|
210
210
|
*/
|
|
211
|
-
export type
|
|
211
|
+
export type DateOrUnixDateTimeMillisecondsNumber = Date | UnixDateTimeMillisecondsNumber;
|
|
212
|
+
/**
|
|
213
|
+
* Converts a Date object or unix timestamp (in milliseconds) to a Date object.
|
|
214
|
+
*
|
|
215
|
+
* @param input - Date object or unix timestamp (in milliseconds) to convert
|
|
216
|
+
* @returns Date object if input is valid. Returns null/undefined if input is null/undefined
|
|
217
|
+
*/
|
|
218
|
+
export declare function dateFromDateOrTimeMillisecondsNumber(input: DateOrUnixDateTimeMillisecondsNumber): Date;
|
|
219
|
+
export declare function dateFromDateOrTimeMillisecondsNumber(input: MaybeNot): MaybeNot;
|
|
220
|
+
export declare function dateFromDateOrTimeMillisecondsNumber(input: Maybe<DateOrUnixDateTimeMillisecondsNumber>): Maybe<Date>;
|
|
221
|
+
/**
|
|
222
|
+
* Converts a unix timestamp number to a Date object.
|
|
223
|
+
*
|
|
224
|
+
* @param dateTimeNumber - Unix timestamp number to convert
|
|
225
|
+
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
226
|
+
*/
|
|
227
|
+
export declare function unixMillisecondsNumberToDate(dateTimeNumber: Maybe<UnixDateTimeMillisecondsNumber>): Maybe<Date>;
|
|
212
228
|
/**
|
|
213
229
|
* Number of milliseconds.
|
|
214
230
|
*/
|
|
@@ -366,3 +382,11 @@ export declare function isPast(input: Date): boolean;
|
|
|
366
382
|
export declare function addMilliseconds(input: Date, ms: Maybe<Milliseconds>): Date;
|
|
367
383
|
export declare function addMilliseconds(input: MaybeNot, ms: Maybe<Milliseconds>): MaybeNot;
|
|
368
384
|
export declare function addMilliseconds(input: Maybe<Date>, ms: Maybe<Milliseconds>): Maybe<Date>;
|
|
385
|
+
/**
|
|
386
|
+
* @deprecated use UnixDateTimeMillisecondsNumber instead.
|
|
387
|
+
*/
|
|
388
|
+
export type UnixDateTimeNumber = UnixDateTimeMillisecondsNumber;
|
|
389
|
+
/**
|
|
390
|
+
* @deprecated use DateOrUnixDateTimeMillisecondsNumber instead.
|
|
391
|
+
*/
|
|
392
|
+
export type DateOrUnixDateTimeNumber = DateOrUnixDateTimeMillisecondsNumber;
|
|
@@ -2,45 +2,73 @@ import { type Maybe, type MaybeNot } from '../value/maybe.type';
|
|
|
2
2
|
/**
|
|
3
3
|
* Not to be confused with UnixDateTimeNumber, this value is in seconds instead of milliseconds.
|
|
4
4
|
*/
|
|
5
|
-
export type
|
|
5
|
+
export type UnixDateTimeSecondsNumber = number;
|
|
6
6
|
/**
|
|
7
7
|
* Not to be confused with DateOrUnixDateTimeNumber, this value is in seconds instead of milliseconds.
|
|
8
8
|
*/
|
|
9
|
-
export type
|
|
9
|
+
export type DateOrUnixDateTimeSecondsNumber = Date | UnixDateTimeSecondsNumber;
|
|
10
10
|
/**
|
|
11
11
|
* Converts a Date object or unix timestamp number to a unix timestamp number.
|
|
12
12
|
*
|
|
13
13
|
* @param input - Date object or unix timestamp number to convert
|
|
14
14
|
* @returns Unix timestamp number if input is valid, null/undefined if input is null/undefined
|
|
15
15
|
*/
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function unixDateTimeSecondsNumberFromDateOrTimeNumber(input: Maybe<DateOrUnixDateTimeSecondsNumber>): Maybe<UnixDateTimeSecondsNumber>;
|
|
17
17
|
/**
|
|
18
18
|
* Gets the current time as a unix timestamp number.
|
|
19
19
|
*
|
|
20
20
|
* @returns Current time as unix timestamp number
|
|
21
21
|
*/
|
|
22
|
-
export declare function
|
|
22
|
+
export declare function unixDateTimeSecondsNumberForNow(): UnixDateTimeSecondsNumber;
|
|
23
23
|
/**
|
|
24
24
|
* Converts a Date object to a unix timestamp number.
|
|
25
25
|
*
|
|
26
26
|
* @param date - Date object to convert
|
|
27
27
|
* @returns Unix timestamp number if date is valid, null/undefined if date is null/undefined
|
|
28
28
|
*/
|
|
29
|
-
export declare function
|
|
30
|
-
export declare function
|
|
29
|
+
export declare function unixDateTimeSecondsNumberFromDate(date: Date): UnixDateTimeSecondsNumber;
|
|
30
|
+
export declare function unixDateTimeSecondsNumberFromDate(date: MaybeNot): MaybeNot;
|
|
31
31
|
/**
|
|
32
32
|
* Converts a Date object or unix timestamp number to a Date object.
|
|
33
33
|
*
|
|
34
34
|
* @param input - Date object or unix timestamp number to convert
|
|
35
35
|
* @returns Date object if input is valid. Returns null/undefined if input is null/undefined
|
|
36
36
|
*/
|
|
37
|
-
export declare function
|
|
38
|
-
export declare function
|
|
39
|
-
export declare function
|
|
37
|
+
export declare function dateFromDateOrTimeSecondsNumber(input: DateOrUnixDateTimeSecondsNumber): Date;
|
|
38
|
+
export declare function dateFromDateOrTimeSecondsNumber(input: MaybeNot): MaybeNot;
|
|
39
|
+
export declare function dateFromDateOrTimeSecondsNumber(input: Maybe<DateOrUnixDateTimeSecondsNumber>): Maybe<Date>;
|
|
40
40
|
/**
|
|
41
41
|
* Converts a unix timestamp number to a Date object.
|
|
42
42
|
*
|
|
43
43
|
* @param dateTimeNumber - Unix timestamp number to convert
|
|
44
44
|
* @returns Date object if timestamp is valid, null/undefined if timestamp is null/undefined
|
|
45
45
|
*/
|
|
46
|
-
export declare function
|
|
46
|
+
export declare function unixDateTimeSecondsNumberToDate(dateTimeNumber: Maybe<UnixDateTimeSecondsNumber>): Maybe<Date>;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated use UnixDateTimeSecondsNumber instead
|
|
49
|
+
*/
|
|
50
|
+
export type UnixTimeNumber = UnixDateTimeSecondsNumber;
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated use DateOrUnixDateTimeSecondsNumber instead
|
|
53
|
+
*/
|
|
54
|
+
export type DateOrUnixTimeNumber = Date | UnixTimeNumber;
|
|
55
|
+
/**
|
|
56
|
+
* @deprecated use unixDateTimeSecondsNumberFromDateOrTimeNumber instead
|
|
57
|
+
*/
|
|
58
|
+
export declare const unixTimeNumberFromDateOrTimeNumber: typeof unixDateTimeSecondsNumberFromDateOrTimeNumber;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated use unixDateTimeSecondsNumberForNow instead
|
|
61
|
+
*/
|
|
62
|
+
export declare const unixTimeNumberForNow: typeof unixDateTimeSecondsNumberForNow;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated use unixDateTimeSecondsNumberFromDate instead
|
|
65
|
+
*/
|
|
66
|
+
export declare const unixTimeNumberFromDate: typeof unixDateTimeSecondsNumberFromDate;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated use dateFromDateOrTimeSecondsNumber instead
|
|
69
|
+
*/
|
|
70
|
+
export declare const dateFromDateOrTimeNumber: typeof dateFromDateOrTimeSecondsNumber;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated use unixDateTimeSecondsNumberToDate instead
|
|
73
|
+
*/
|
|
74
|
+
export declare const unixTimeNumberToDate: typeof unixDateTimeSecondsNumberToDate;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type FieldOfType } from '../key';
|
|
1
|
+
import { type PrimativeKey, type FieldOfType } from '../key';
|
|
2
2
|
import { type SetIncludesMode } from '../set/set.mode';
|
|
3
3
|
import { type KeyAsString } from '../type';
|
|
4
4
|
/**
|
|
5
5
|
* Any valid Plain-old Javascript Object key.
|
|
6
6
|
*/
|
|
7
|
-
export type POJOKey =
|
|
7
|
+
export type POJOKey = PrimativeKey | symbol;
|
|
8
8
|
/**
|
|
9
9
|
* String key of an object.
|
|
10
10
|
*/
|
package/src/lib/path/index.d.ts
CHANGED
package/src/lib/path/path.d.ts
CHANGED
|
@@ -312,10 +312,14 @@ export interface SlashPathDetails {
|
|
|
312
312
|
readonly file?: Maybe<SlashPathFile | SlashPathTypedFile>;
|
|
313
313
|
/**
|
|
314
314
|
* The file name, if file is defined.
|
|
315
|
+
*
|
|
316
|
+
* This is only the filename without the extension, even if the file is a typed file.
|
|
315
317
|
*/
|
|
316
318
|
readonly fileName?: Maybe<string>;
|
|
317
319
|
/**
|
|
318
320
|
* The typed file part, if the file is a typed file.
|
|
321
|
+
*
|
|
322
|
+
* This is the full file name including the extension if the file is a typed file.
|
|
319
323
|
*/
|
|
320
324
|
readonly typedFile: Maybe<SlashPathTypedFile>;
|
|
321
325
|
/**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type TreeNode } from '../tree/tree';
|
|
2
|
+
import { type Maybe } from '../value/maybe.type';
|
|
3
|
+
import { type SlashPathDetails } from './path';
|
|
4
|
+
/**
|
|
5
|
+
* A value that has a corresponding SlashPathDetails value.
|
|
6
|
+
*/
|
|
7
|
+
export type SlashPathDirectoryTreeNodeValue<T> = {
|
|
8
|
+
readonly value: T;
|
|
9
|
+
readonly slashPathDetails: SlashPathDetails;
|
|
10
|
+
};
|
|
11
|
+
export type SlashPathDirectoryTreeNode<T, V extends SlashPathDirectoryTreeNodeValue<T> = SlashPathDirectoryTreeNodeValue<T>> = TreeNode<V>;
|
|
12
|
+
export type SlashPathDirectoryTreeRoot<T, V extends SlashPathDirectoryTreeNodeValue<T> = SlashPathDirectoryTreeNodeValue<T>> = Omit<SlashPathDirectoryTreeNode<T, V>, 'value'>;
|
|
13
|
+
export interface SlashPathDirectoryTreeOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Whether or not to include node values in the tree if their parent folders do not appear in the tree.
|
|
16
|
+
*
|
|
17
|
+
* If true, these nodes will be added to the root of the tree.
|
|
18
|
+
*
|
|
19
|
+
* Defaults to false
|
|
20
|
+
*/
|
|
21
|
+
readonly includeChildrenWithMissingParentFolder?: Maybe<boolean>;
|
|
22
|
+
}
|
|
23
|
+
export declare function slashPathDirectoryTree<T, V extends SlashPathDirectoryTreeNodeValue<T> = SlashPathDirectoryTreeNodeValue<T>>(nodeValues: V[], options?: SlashPathDirectoryTreeOptions): SlashPathDirectoryTreeRoot<T, V>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SlashPathTypedFileExtension } from '../path/path';
|
|
1
2
|
import { type Maybe } from '../value/maybe.type';
|
|
2
3
|
/**
|
|
3
4
|
* A simple mime type string with just the type/subtype and no parameters.
|
|
@@ -26,7 +27,7 @@ export type ContentTypeMimeType = string;
|
|
|
26
27
|
*
|
|
27
28
|
* This is a non-exhaustive list of common image types.
|
|
28
29
|
*/
|
|
29
|
-
export type
|
|
30
|
+
export type ImageFileExtension = 'jpeg' | 'jpg' | 'png' | 'webp' | 'gif' | 'svg' | 'raw' | 'heif' | 'tiff';
|
|
30
31
|
export declare const JPEG_MIME_TYPE: MimeTypeWithoutParameters;
|
|
31
32
|
export declare const PNG_MIME_TYPE: MimeTypeWithoutParameters;
|
|
32
33
|
export declare const WEBP_MIME_TYPE: MimeTypeWithoutParameters;
|
|
@@ -35,14 +36,85 @@ export declare const HEIF_MIME_TYPE: MimeTypeWithoutParameters;
|
|
|
35
36
|
export declare const TIFF_MIME_TYPE: MimeTypeWithoutParameters;
|
|
36
37
|
export declare const SVG_MIME_TYPE: MimeTypeWithoutParameters;
|
|
37
38
|
export declare const RAW_MIME_TYPE: MimeTypeWithoutParameters;
|
|
39
|
+
export declare const IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD: Record<ImageFileExtension, MimeTypeWithoutParameters>;
|
|
40
|
+
export declare const IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD: Record<MimeTypeWithoutParameters, ImageFileExtension>;
|
|
38
41
|
/**
|
|
39
42
|
* Returns the mimetype for the given image type, or undefined if the type is not known.
|
|
40
43
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
export declare function
|
|
44
|
+
export declare function mimeTypeForImageFileExtension(extension: ImageFileExtension): MimeTypeWithoutParameters;
|
|
45
|
+
export declare function mimeTypeForImageFileExtension(extension: SlashPathTypedFileExtension): Maybe<MimeTypeWithoutParameters>;
|
|
46
|
+
export declare function mimeTypeForImageFileExtension(extension: Maybe<ImageFileExtension | SlashPathTypedFileExtension>): Maybe<MimeTypeWithoutParameters>;
|
|
47
|
+
export declare function imageFileExtensionForMimeType(mimeType: Maybe<MimeTypeWithoutParameters>): Maybe<ImageFileExtension>;
|
|
48
|
+
export type DocumentFileExtension = 'pdf' | 'docx' | 'xlsx' | 'txt' | 'csv' | 'html' | 'xml' | 'json' | 'yaml' | 'md';
|
|
49
|
+
export declare const PDF_MIME_TYPE: MimeTypeWithoutParameters;
|
|
50
|
+
export declare const DOCX_MIME_TYPE: MimeTypeWithoutParameters;
|
|
51
|
+
export declare const XLSX_MIME_TYPE: MimeTypeWithoutParameters;
|
|
52
|
+
export declare const TXT_MIME_TYPE: MimeTypeWithoutParameters;
|
|
53
|
+
export declare const CSV_MIME_TYPE: MimeTypeWithoutParameters;
|
|
54
|
+
export declare const HTML_MIME_TYPE: MimeTypeWithoutParameters;
|
|
55
|
+
export declare const XML_MIME_TYPE: MimeTypeWithoutParameters;
|
|
56
|
+
export declare const JSON_MIME_TYPE: MimeTypeWithoutParameters;
|
|
57
|
+
export declare const YAML_MIME_TYPE: MimeTypeWithoutParameters;
|
|
58
|
+
export declare const MARKDOWN_MIME_TYPE: MimeTypeWithoutParameters;
|
|
59
|
+
export declare const DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD: Record<DocumentFileExtension, MimeTypeWithoutParameters>;
|
|
60
|
+
export declare const DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD: Record<MimeTypeWithoutParameters, DocumentFileExtension>;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the mimetype for the given document file extension, or undefined if the extension is not known/recognized.
|
|
63
|
+
*
|
|
64
|
+
* @param extension The document file extension to get the mimetype for.
|
|
65
|
+
* @returns The mimetype for the given document file extension, or undefined if the extension is not known.
|
|
66
|
+
*/
|
|
67
|
+
export declare function mimeTypeForDocumentFileExtension(extension: DocumentFileExtension): MimeTypeWithoutParameters;
|
|
68
|
+
export declare function mimeTypeForDocumentFileExtension(extension: SlashPathTypedFileExtension): Maybe<MimeTypeWithoutParameters>;
|
|
69
|
+
export declare function mimeTypeForDocumentFileExtension(extension: Maybe<DocumentFileExtension | SlashPathTypedFileExtension>): Maybe<MimeTypeWithoutParameters>;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the document file extension for the given mimetype, or undefined if the mimetype is not known/recognized.
|
|
72
|
+
*
|
|
73
|
+
* @param mimeType The mimetype to get the document file extension for.
|
|
74
|
+
* @returns The document file extension for the given mimetype, or undefined if the mimetype is not known.
|
|
75
|
+
*/
|
|
76
|
+
export declare function documentFileExtensionForMimeType(mimeType: Maybe<MimeTypeWithoutParameters>): Maybe<DocumentFileExtension>;
|
|
77
|
+
export type ApplicationFileExtension = 'zip';
|
|
78
|
+
export declare const ZIP_FILE_MIME_TYPE: MimeTypeWithoutParameters;
|
|
79
|
+
export declare const APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD: Record<ApplicationFileExtension, MimeTypeWithoutParameters>;
|
|
80
|
+
export declare const APPLICATION_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD: Record<MimeTypeWithoutParameters, ApplicationFileExtension>;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the mimetype for the given application file extension, or undefined if the extension is not known/recognized.
|
|
83
|
+
*
|
|
84
|
+
* @param extension The application file extension to get the mimetype for.
|
|
85
|
+
* @returns The mimetype for the given application file extension, or undefined if the extension is not known.
|
|
86
|
+
*/
|
|
87
|
+
export declare function mimeTypeForApplicationFileExtension(extension: ApplicationFileExtension): MimeTypeWithoutParameters;
|
|
88
|
+
export declare function mimeTypeForApplicationFileExtension(extension: SlashPathTypedFileExtension): Maybe<MimeTypeWithoutParameters>;
|
|
89
|
+
export declare function mimeTypeForApplicationFileExtension(extension: Maybe<ApplicationFileExtension | SlashPathTypedFileExtension>): Maybe<MimeTypeWithoutParameters>;
|
|
90
|
+
export declare function applicationFileExtensionForMimeType(mimeType: Maybe<MimeTypeWithoutParameters>): Maybe<ApplicationFileExtension>;
|
|
91
|
+
/**
|
|
92
|
+
* List of known file extensions supported by dbx-components.
|
|
93
|
+
*
|
|
94
|
+
* These types are known to work with most dbx-components features related to files.
|
|
95
|
+
*/
|
|
96
|
+
export type DbxComponentsKnownFileExtension = ImageFileExtension | DocumentFileExtension | ApplicationFileExtension;
|
|
97
|
+
/**
|
|
98
|
+
* Returns the mimetype for the given file extension, or undefined if the extension is not known/recognized.
|
|
99
|
+
*
|
|
100
|
+
* @param extension The file extension to get the mimetype for.
|
|
101
|
+
* @returns The mimetype for the given file extension, or undefined if the extension is not known.
|
|
102
|
+
*/
|
|
103
|
+
export declare function mimeTypeForFileExtension(extension: DbxComponentsKnownFileExtension): MimeTypeWithoutParameters;
|
|
104
|
+
export declare function mimeTypeForFileExtension(extension: SlashPathTypedFileExtension): Maybe<MimeTypeWithoutParameters>;
|
|
105
|
+
export declare function mimeTypeForFileExtension(extension: Maybe<DbxComponentsKnownFileExtension | SlashPathTypedFileExtension>): Maybe<MimeTypeWithoutParameters>;
|
|
106
|
+
export declare function fileExtensionForMimeType(mimeType: Maybe<MimeTypeWithoutParameters>): Maybe<DbxComponentsKnownFileExtension>;
|
|
43
107
|
/**
|
|
44
108
|
* A content disposition string, which is used to determine how the browser should show the target content.
|
|
45
109
|
*
|
|
46
110
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Disposition
|
|
47
111
|
*/
|
|
48
112
|
export type ContentDispositionString = 'inline' | 'attachment' | string;
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated Use ImageFileExtension instead.
|
|
115
|
+
*/
|
|
116
|
+
export type MimeTypeForImageTypeInputType = ImageFileExtension;
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Use mimeTypeForImageFileExtension instead.
|
|
119
|
+
*/
|
|
120
|
+
export declare const mimetypeForImageType: typeof mimeTypeForImageFileExtension;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A record where the keys and values are strings.
|
|
3
|
+
*/
|
|
4
|
+
export type StringRecord<K extends string, V extends string> = Record<K, V>;
|
|
5
|
+
/**
|
|
6
|
+
* Inverts a string record, inverting the key and value of each entry in the record.
|
|
7
|
+
*
|
|
8
|
+
* @param record
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
export declare function invertStringRecord<K extends string, V extends string>(record: StringRecord<K, V>): StringRecord<V, K>;
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [12.6.0](https://github.com/dereekb/dbx-components/compare/v12.5.10-dev...v12.6.0) (2025-12-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [12.5.10](https://github.com/dereekb/dbx-components/compare/v12.5.9-dev...v12.5.10) (2025-11-21)
|
|
6
10
|
|
|
7
11
|
|