@fgv/ts-web-extras 5.0.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/.rush/temp/86c9c1ad46e237e0b957c2442bf0355cf39babba.tar.log +121 -0
- package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +40 -0
- package/.rush/temp/operation/build/all.log +40 -0
- package/.rush/temp/operation/build/log-chunks.jsonl +40 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +624 -0
- package/config/api-extractor.json +343 -0
- package/config/jest.config.json +16 -0
- package/config/rig.json +16 -0
- package/dist/ts-web-extras.d.ts +574 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/docs/index.md +34 -0
- package/docs/ts-web-extras.browserhashprovider.hashparts.md +88 -0
- package/docs/ts-web-extras.browserhashprovider.hashstring.md +72 -0
- package/docs/ts-web-extras.browserhashprovider.md +66 -0
- package/docs/ts-web-extras.exportasjson.md +70 -0
- package/docs/ts-web-extras.exportusingfilesystemapi.md +104 -0
- package/docs/ts-web-extras.extractdirectorypath.md +52 -0
- package/docs/ts-web-extras.fileapitreeaccessors.create.md +72 -0
- package/docs/ts-web-extras.fileapitreeaccessors.extractfilemetadata.md +54 -0
- package/docs/ts-web-extras.fileapitreeaccessors.fromdirectoryupload.md +72 -0
- package/docs/ts-web-extras.fileapitreeaccessors.fromfilelist.md +72 -0
- package/docs/ts-web-extras.fileapitreeaccessors.getoriginalfile.md +72 -0
- package/docs/ts-web-extras.fileapitreeaccessors.md +114 -0
- package/docs/ts-web-extras.filepickeraccepttype.accept.md +11 -0
- package/docs/ts-web-extras.filepickeraccepttype.description.md +11 -0
- package/docs/ts-web-extras.filepickeraccepttype.md +75 -0
- package/docs/ts-web-extras.filesystemcreatewritableoptions_2.keepexistingdata.md +11 -0
- package/docs/ts-web-extras.filesystemcreatewritableoptions_2.md +58 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2._symbol.asynciterator_.md +15 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.entries.md +15 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.getdirectoryhandle.md +66 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.getfilehandle.md +66 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.keys.md +15 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.kind.md +11 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.md +146 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.removeentry.md +66 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.resolve.md +50 -0
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.values.md +15 -0
- package/docs/ts-web-extras.filesystemfilehandle_2.createwritable.md +52 -0
- package/docs/ts-web-extras.filesystemfilehandle_2.getfile.md +15 -0
- package/docs/ts-web-extras.filesystemfilehandle_2.kind.md +11 -0
- package/docs/ts-web-extras.filesystemfilehandle_2.md +92 -0
- package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.create.md +11 -0
- package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.md +58 -0
- package/docs/ts-web-extras.filesystemgetfileoptions_2.create.md +11 -0
- package/docs/ts-web-extras.filesystemgetfileoptions_2.md +58 -0
- package/docs/ts-web-extras.filesystemhandle_2.issameentry.md +50 -0
- package/docs/ts-web-extras.filesystemhandle_2.kind.md +11 -0
- package/docs/ts-web-extras.filesystemhandle_2.md +119 -0
- package/docs/ts-web-extras.filesystemhandle_2.name.md +11 -0
- package/docs/ts-web-extras.filesystemhandle_2.querypermission.md +52 -0
- package/docs/ts-web-extras.filesystemhandle_2.requestpermission.md +52 -0
- package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.md +58 -0
- package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.mode.md +11 -0
- package/docs/ts-web-extras.filesystemremoveoptions_2.md +58 -0
- package/docs/ts-web-extras.filesystemremoveoptions_2.recursive.md +11 -0
- package/docs/ts-web-extras.filesystemwritablefilestream_2.md +57 -0
- package/docs/ts-web-extras.filesystemwritablefilestream_2.seek.md +50 -0
- package/docs/ts-web-extras.filesystemwritablefilestream_2.truncate.md +50 -0
- package/docs/ts-web-extras.filesystemwritablefilestream_2.write.md +50 -0
- package/docs/ts-web-extras.filetreehelpers.defaultfileapitreeinitparams.md +13 -0
- package/docs/ts-web-extras.filetreehelpers.extractfilelistmetadata.md +56 -0
- package/docs/ts-web-extras.filetreehelpers.extractfilemetadata.md +56 -0
- package/docs/ts-web-extras.filetreehelpers.fromdirectoryupload.md +76 -0
- package/docs/ts-web-extras.filetreehelpers.fromfilelist.md +76 -0
- package/docs/ts-web-extras.filetreehelpers.getoriginalfile.md +72 -0
- package/docs/ts-web-extras.filetreehelpers.md +102 -0
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.dirhandles.md +11 -0
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.md +100 -0
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.nonrecursive.md +11 -0
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.prefix.md +11 -0
- package/docs/ts-web-extras.ifilehandletreeinitializer.filehandles.md +11 -0
- package/docs/ts-web-extras.ifilehandletreeinitializer.md +79 -0
- package/docs/ts-web-extras.ifilehandletreeinitializer.prefix.md +11 -0
- package/docs/ts-web-extras.ifilelisttreeinitializer.filelist.md +11 -0
- package/docs/ts-web-extras.ifilelisttreeinitializer.md +58 -0
- package/docs/ts-web-extras.ifilemetadata.lastmodified.md +11 -0
- package/docs/ts-web-extras.ifilemetadata.md +124 -0
- package/docs/ts-web-extras.ifilemetadata.name.md +11 -0
- package/docs/ts-web-extras.ifilemetadata.path.md +11 -0
- package/docs/ts-web-extras.ifilemetadata.size.md +11 -0
- package/docs/ts-web-extras.ifilemetadata.type.md +11 -0
- package/docs/ts-web-extras.ifsaccessapis.md +56 -0
- package/docs/ts-web-extras.ifsaccessapis.showdirectorypicker.md +52 -0
- package/docs/ts-web-extras.ifsaccessapis.showopenfilepicker.md +52 -0
- package/docs/ts-web-extras.ifsaccessapis.showsavefilepicker.md +52 -0
- package/docs/ts-web-extras.isdirectoryhandle.md +56 -0
- package/docs/ts-web-extras.isfilehandle.md +56 -0
- package/docs/ts-web-extras.isfilepath.md +52 -0
- package/docs/ts-web-extras.iurlconfigoptions.config.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.configstartdir.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.contextfilter.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.input.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.inputstartdir.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.interactive.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.loadzip.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.maxdistance.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.md +286 -0
- package/docs/ts-web-extras.iurlconfigoptions.qualifierdefaults.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.reducequalifiers.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.resourcetypes.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.zipfile.md +13 -0
- package/docs/ts-web-extras.iurlconfigoptions.zippath.md +13 -0
- package/docs/ts-web-extras.md +512 -0
- package/docs/ts-web-extras.parsecontextfilter.md +52 -0
- package/docs/ts-web-extras.parsequalifierdefaults.md +52 -0
- package/docs/ts-web-extras.parseresourcetypes.md +52 -0
- package/docs/ts-web-extras.parseurlparameters.md +17 -0
- package/docs/ts-web-extras.safeshowdirectorypicker.md +72 -0
- package/docs/ts-web-extras.safeshowopenfilepicker.md +72 -0
- package/docs/ts-web-extras.safeshowsavefilepicker.md +72 -0
- package/docs/ts-web-extras.showdirectorypickeroptions.id.md +11 -0
- package/docs/ts-web-extras.showdirectorypickeroptions.md +96 -0
- package/docs/ts-web-extras.showdirectorypickeroptions.mode.md +11 -0
- package/docs/ts-web-extras.showdirectorypickeroptions.startin.md +11 -0
- package/docs/ts-web-extras.showopenfilepickeroptions.excludeacceptalloption.md +11 -0
- package/docs/ts-web-extras.showopenfilepickeroptions.id.md +11 -0
- package/docs/ts-web-extras.showopenfilepickeroptions.md +134 -0
- package/docs/ts-web-extras.showopenfilepickeroptions.multiple.md +11 -0
- package/docs/ts-web-extras.showopenfilepickeroptions.startin.md +11 -0
- package/docs/ts-web-extras.showopenfilepickeroptions.types.md +11 -0
- package/docs/ts-web-extras.showsavefilepickeroptions.excludeacceptalloption.md +11 -0
- package/docs/ts-web-extras.showsavefilepickeroptions.id.md +11 -0
- package/docs/ts-web-extras.showsavefilepickeroptions.md +134 -0
- package/docs/ts-web-extras.showsavefilepickeroptions.startin.md +11 -0
- package/docs/ts-web-extras.showsavefilepickeroptions.suggestedname.md +11 -0
- package/docs/ts-web-extras.showsavefilepickeroptions.types.md +11 -0
- package/docs/ts-web-extras.supportsfilesystemaccess.md +56 -0
- package/docs/ts-web-extras.treeinitializer.md +15 -0
- package/docs/ts-web-extras.wellknowndirectory.md +13 -0
- package/docs/ts-web-extras.windowwithfsaccess.md +15 -0
- package/etc/ts-web-extras.api.md +310 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +58 -0
- package/lib/index.js.map +1 -0
- package/lib/packlets/crypto/browserHashProvider.d.ts +24 -0
- package/lib/packlets/crypto/browserHashProvider.d.ts.map +1 -0
- package/lib/packlets/crypto/browserHashProvider.js +70 -0
- package/lib/packlets/crypto/browserHashProvider.js.map +1 -0
- package/lib/packlets/crypto/index.d.ts +6 -0
- package/lib/packlets/crypto/index.d.ts.map +1 -0
- package/lib/packlets/crypto/index.js +43 -0
- package/lib/packlets/crypto/index.js.map +1 -0
- package/lib/packlets/file-api-types/index.d.ts +205 -0
- package/lib/packlets/file-api-types/index.d.ts.map +1 -0
- package/lib/packlets/file-api-types/index.js +166 -0
- package/lib/packlets/file-api-types/index.js.map +1 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts +129 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.js +334 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -0
- package/lib/packlets/file-tree/index.d.ts +6 -0
- package/lib/packlets/file-tree/index.d.ts.map +1 -0
- package/lib/packlets/file-tree/index.js +43 -0
- package/lib/packlets/file-tree/index.js.map +1 -0
- package/lib/packlets/helpers/fileTreeHelpers.d.ts +60 -0
- package/lib/packlets/helpers/fileTreeHelpers.d.ts.map +1 -0
- package/lib/packlets/helpers/fileTreeHelpers.js +102 -0
- package/lib/packlets/helpers/fileTreeHelpers.js.map +1 -0
- package/lib/packlets/helpers/index.d.ts +6 -0
- package/lib/packlets/helpers/index.d.ts.map +1 -0
- package/lib/packlets/helpers/index.js +63 -0
- package/lib/packlets/helpers/index.js.map +1 -0
- package/lib/packlets/url-utils/index.d.ts +6 -0
- package/lib/packlets/url-utils/index.d.ts.map +1 -0
- package/lib/packlets/url-utils/index.js +43 -0
- package/lib/packlets/url-utils/index.js.map +1 -0
- package/lib/packlets/url-utils/urlParams.d.ts +94 -0
- package/lib/packlets/url-utils/urlParams.d.ts.map +1 -0
- package/lib/packlets/url-utils/urlParams.js +165 -0
- package/lib/packlets/url-utils/urlParams.js.map +1 -0
- package/lib/test/setupTests.d.ts +2 -0
- package/lib/test/setupTests.d.ts.map +1 -0
- package/lib/test/setupTests.js +76 -0
- package/lib/test/setupTests.js.map +1 -0
- package/lib/test/unit/browserHashProvider.test.d.ts +2 -0
- package/lib/test/unit/browserHashProvider.test.d.ts.map +1 -0
- package/lib/test/unit/browserHashProvider.test.js +142 -0
- package/lib/test/unit/browserHashProvider.test.js.map +1 -0
- package/lib/test/unit/fileApiTreeAccessors.test.d.ts +2 -0
- package/lib/test/unit/fileApiTreeAccessors.test.d.ts.map +1 -0
- package/lib/test/unit/fileApiTreeAccessors.test.js +1139 -0
- package/lib/test/unit/fileApiTreeAccessors.test.js.map +1 -0
- package/lib/test/unit/fileApiTypes.test.d.ts +2 -0
- package/lib/test/unit/fileApiTypes.test.d.ts.map +1 -0
- package/lib/test/unit/fileApiTypes.test.js +444 -0
- package/lib/test/unit/fileApiTypes.test.js.map +1 -0
- package/lib/test/unit/fileTreeHelpers.test.d.ts +2 -0
- package/lib/test/unit/fileTreeHelpers.test.d.ts.map +1 -0
- package/lib/test/unit/fileTreeHelpers.test.js +592 -0
- package/lib/test/unit/fileTreeHelpers.test.js.map +1 -0
- package/lib/test/unit/urlParams.test.d.ts +2 -0
- package/lib/test/unit/urlParams.test.d.ts.map +1 -0
- package/lib/test/unit/urlParams.test.js +395 -0
- package/lib/test/unit/urlParams.test.js.map +1 -0
- package/lib/test/utils/testHelpers.d.ts +51 -0
- package/lib/test/utils/testHelpers.d.ts.map +1 -0
- package/lib/test/utils/testHelpers.js +133 -0
- package/lib/test/utils/testHelpers.js.map +1 -0
- package/package.json +68 -0
- package/rush-logs/ts-web-extras.build.cache.log +3 -0
- package/rush-logs/ts-web-extras.build.log +40 -0
- package/src/index.ts +47 -0
- package/src/packlets/crypto/browserHashProvider.ts +73 -0
- package/src/packlets/crypto/index.ts +28 -0
- package/src/packlets/file-api-types/index.ts +345 -0
- package/src/packlets/file-tree/fileApiTreeAccessors.ts +420 -0
- package/src/packlets/file-tree/index.ts +28 -0
- package/src/packlets/helpers/fileTreeHelpers.ts +107 -0
- package/src/packlets/helpers/index.ts +28 -0
- package/src/packlets/url-utils/index.ts +28 -0
- package/src/packlets/url-utils/urlParams.ts +245 -0
- package/src/test/setupTests.ts +87 -0
- package/src/test/unit/browserHashProvider.test.ts +155 -0
- package/src/test/unit/browserHashProvider.test.ts.bak +376 -0
- package/src/test/unit/fileApiTreeAccessors.test.ts +1318 -0
- package/src/test/unit/fileApiTypes.test.ts +551 -0
- package/src/test/unit/fileTreeHelpers.test.ts +694 -0
- package/src/test/unit/urlParams.test.ts +464 -0
- package/src/test/utils/testHelpers.ts +155 -0
- package/temp/build/typescript/ts_l9Fw4VUO.json +1 -0
- package/temp/coverage/base.css +224 -0
- package/temp/coverage/block-navigation.js +87 -0
- package/temp/coverage/crypto/browserHashProvider.ts.html +304 -0
- package/temp/coverage/crypto/index.html +116 -0
- package/temp/coverage/favicon.png +0 -0
- package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +1345 -0
- package/temp/coverage/file-tree/index.html +116 -0
- package/temp/coverage/helpers/fileTreeHelpers.ts.html +406 -0
- package/temp/coverage/helpers/index.html +116 -0
- package/temp/coverage/index.html +161 -0
- package/temp/coverage/lcov-report/base.css +224 -0
- package/temp/coverage/lcov-report/block-navigation.js +87 -0
- package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +304 -0
- package/temp/coverage/lcov-report/crypto/index.html +116 -0
- package/temp/coverage/lcov-report/favicon.png +0 -0
- package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +1345 -0
- package/temp/coverage/lcov-report/file-tree/index.html +116 -0
- package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +406 -0
- package/temp/coverage/lcov-report/helpers/index.html +116 -0
- package/temp/coverage/lcov-report/index.html +161 -0
- package/temp/coverage/lcov-report/prettify.css +1 -0
- package/temp/coverage/lcov-report/prettify.js +2 -0
- package/temp/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/temp/coverage/lcov-report/sorter.js +210 -0
- package/temp/coverage/lcov-report/url-utils/index.html +116 -0
- package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +820 -0
- package/temp/coverage/lcov.info +1096 -0
- package/temp/coverage/prettify.css +1 -0
- package/temp/coverage/prettify.js +2 -0
- package/temp/coverage/sort-arrow-sprite.png +0 -0
- package/temp/coverage/sorter.js +210 -0
- package/temp/coverage/url-utils/index.html +116 -0
- package/temp/coverage/url-utils/urlParams.ts.html +820 -0
- package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
- package/temp/test/jest/jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/63/package_63a8257b0e4d0e7ff33f927d75f27a75 +53 -0
- package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
- package/temp/ts-web-extras.api.json +5040 -0
- package/temp/ts-web-extras.api.md +310 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
35
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
36
|
+
}) : function(o, v) {
|
|
37
|
+
o["default"] = v;
|
|
38
|
+
});
|
|
39
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
40
|
+
var ownKeys = function(o) {
|
|
41
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
42
|
+
var ar = [];
|
|
43
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
44
|
+
return ar;
|
|
45
|
+
};
|
|
46
|
+
return ownKeys(o);
|
|
47
|
+
};
|
|
48
|
+
return function (mod) {
|
|
49
|
+
if (mod && mod.__esModule) return mod;
|
|
50
|
+
var result = {};
|
|
51
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
52
|
+
__setModuleDefault(result, mod);
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
})();
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.FileTreeHelpers = void 0;
|
|
58
|
+
/**
|
|
59
|
+
* Tree-shakeable helper functions for browser-compatible file operations.
|
|
60
|
+
* @packageDocumentation
|
|
61
|
+
*/
|
|
62
|
+
exports.FileTreeHelpers = __importStar(require("./fileTreeHelpers"));
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/helpers/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;;GAGG;AAEH,qEAAqD","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Tree-shakeable helper functions for browser-compatible file operations.\n * @packageDocumentation\n */\n\nexport * as FileTreeHelpers from './fileTreeHelpers';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packlets/url-utils/index.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AAEH,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
|
+
}
|
|
29
|
+
Object.defineProperty(o, k2, desc);
|
|
30
|
+
}) : (function(o, m, k, k2) {
|
|
31
|
+
if (k2 === undefined) k2 = k;
|
|
32
|
+
o[k2] = m[k];
|
|
33
|
+
}));
|
|
34
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
35
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
/**
|
|
39
|
+
* URL parameter parsing utilities for web applications.
|
|
40
|
+
* @packageDocumentation
|
|
41
|
+
*/
|
|
42
|
+
__exportStar(require("./urlParams"), exports);
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/packlets/url-utils/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;AAEH;;;GAGG;AAEH,8CAA4B","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * URL parameter parsing utilities for web applications.\n * @packageDocumentation\n */\n\nexport * from './urlParams';\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options that can be passed via URL parameters
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export interface IUrlConfigOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Input file path
|
|
8
|
+
*/
|
|
9
|
+
input?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Configuration name or path
|
|
12
|
+
*/
|
|
13
|
+
config?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Context filter token (pipe-separated)
|
|
16
|
+
*/
|
|
17
|
+
contextFilter?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Qualifier defaults token (pipe-separated)
|
|
20
|
+
*/
|
|
21
|
+
qualifierDefaults?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Resource types filter (comma-separated)
|
|
24
|
+
*/
|
|
25
|
+
resourceTypes?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Maximum distance for language matching
|
|
28
|
+
*/
|
|
29
|
+
maxDistance?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to reduce qualifiers
|
|
32
|
+
*/
|
|
33
|
+
reduceQualifiers?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to launch in interactive mode
|
|
36
|
+
*/
|
|
37
|
+
interactive?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Starting directory for input file picker (derived from input path)
|
|
40
|
+
*/
|
|
41
|
+
inputStartDir?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Starting directory for config file picker (derived from config path)
|
|
44
|
+
*/
|
|
45
|
+
configStartDir?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to use ZIP loading mode
|
|
48
|
+
*/
|
|
49
|
+
loadZip?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Path to ZIP file to load (for CLI-generated ZIPs)
|
|
52
|
+
*/
|
|
53
|
+
zipPath?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Name of ZIP file to load from Downloads (filename only)
|
|
56
|
+
*/
|
|
57
|
+
zipFile?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Parses URL parameters and extracts configuration options
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseUrlParameters(): IUrlConfigOptions;
|
|
64
|
+
/**
|
|
65
|
+
* Converts context filter token to context object
|
|
66
|
+
* Example: "language=en-US|territory=US" -\> \{ language: "en-US", territory: "US" \}
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export declare function parseContextFilter(contextFilter: string): Record<string, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Converts qualifier defaults token to structured format
|
|
72
|
+
* Example: "language=en-US,en-CA|territory=US" -\> \{ language: ["en-US", "en-CA"], territory: ["US"] \}
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseQualifierDefaults(qualifierDefaults: string): Record<string, string[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Converts resource types string to array
|
|
78
|
+
* Example: "json,string" -\> ["json", "string"]
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export declare function parseResourceTypes(resourceTypes: string): string[];
|
|
82
|
+
/**
|
|
83
|
+
* Extracts the directory path from a file or directory path
|
|
84
|
+
* If the path appears to be a directory (no extension), returns it as-is
|
|
85
|
+
* If the path appears to be a file, returns the parent directory
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
export declare function extractDirectoryPath(path: string): string;
|
|
89
|
+
/**
|
|
90
|
+
* Determines if a path appears to be a file (has extension) or directory
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
export declare function isFilePath(path: string): boolean;
|
|
94
|
+
//# sourceMappingURL=urlParams.d.ts.map
|
|
@@ -0,0 +1 @@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zD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQhD"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.parseUrlParameters = parseUrlParameters;
|
|
25
|
+
exports.parseContextFilter = parseContextFilter;
|
|
26
|
+
exports.parseQualifierDefaults = parseQualifierDefaults;
|
|
27
|
+
exports.parseResourceTypes = parseResourceTypes;
|
|
28
|
+
exports.extractDirectoryPath = extractDirectoryPath;
|
|
29
|
+
exports.isFilePath = isFilePath;
|
|
30
|
+
/**
|
|
31
|
+
* Parses URL parameters and extracts configuration options
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
function parseUrlParameters() {
|
|
35
|
+
const params = new URLSearchParams(window.location.search);
|
|
36
|
+
const options = {};
|
|
37
|
+
// Parse string parameters
|
|
38
|
+
const input = params.get('input');
|
|
39
|
+
if (input) {
|
|
40
|
+
options.input = input;
|
|
41
|
+
// Set starting directory for input file picker
|
|
42
|
+
if (isFilePath(input)) {
|
|
43
|
+
options.inputStartDir = extractDirectoryPath(input);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const config = params.get('config');
|
|
47
|
+
if (config) {
|
|
48
|
+
options.config = config;
|
|
49
|
+
// Set starting directory for config file picker
|
|
50
|
+
if (isFilePath(config)) {
|
|
51
|
+
options.configStartDir = extractDirectoryPath(config);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const contextFilter = params.get('contextFilter');
|
|
55
|
+
if (contextFilter)
|
|
56
|
+
options.contextFilter = contextFilter;
|
|
57
|
+
const qualifierDefaults = params.get('qualifierDefaults');
|
|
58
|
+
if (qualifierDefaults)
|
|
59
|
+
options.qualifierDefaults = qualifierDefaults;
|
|
60
|
+
const resourceTypes = params.get('resourceTypes');
|
|
61
|
+
if (resourceTypes)
|
|
62
|
+
options.resourceTypes = resourceTypes;
|
|
63
|
+
// Parse numeric parameters
|
|
64
|
+
const maxDistance = params.get('maxDistance');
|
|
65
|
+
if (maxDistance) {
|
|
66
|
+
const parsed = parseInt(maxDistance, 10);
|
|
67
|
+
if (!isNaN(parsed))
|
|
68
|
+
options.maxDistance = parsed;
|
|
69
|
+
}
|
|
70
|
+
// Parse boolean parameters
|
|
71
|
+
const reduceQualifiers = params.get('reduceQualifiers');
|
|
72
|
+
if (reduceQualifiers === 'true')
|
|
73
|
+
options.reduceQualifiers = true;
|
|
74
|
+
const interactive = params.get('interactive');
|
|
75
|
+
if (interactive === 'true')
|
|
76
|
+
options.interactive = true;
|
|
77
|
+
// Parse ZIP loading parameters
|
|
78
|
+
const loadZip = params.get('loadZip');
|
|
79
|
+
if (loadZip === 'true')
|
|
80
|
+
options.loadZip = true;
|
|
81
|
+
const zipPath = params.get('zipPath');
|
|
82
|
+
if (zipPath)
|
|
83
|
+
options.zipPath = zipPath;
|
|
84
|
+
const zipFile = params.get('zipFile');
|
|
85
|
+
if (zipFile)
|
|
86
|
+
options.zipFile = zipFile;
|
|
87
|
+
return options;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Converts context filter token to context object
|
|
91
|
+
* Example: "language=en-US|territory=US" -\> \{ language: "en-US", territory: "US" \}
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
function parseContextFilter(contextFilter) {
|
|
95
|
+
const context = {};
|
|
96
|
+
const tokens = contextFilter.split('|');
|
|
97
|
+
for (const token of tokens) {
|
|
98
|
+
const [key, value] = token.split('=');
|
|
99
|
+
if (key && value) {
|
|
100
|
+
context[key.trim()] = value.trim();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return context;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Converts qualifier defaults token to structured format
|
|
107
|
+
* Example: "language=en-US,en-CA|territory=US" -\> \{ language: ["en-US", "en-CA"], territory: ["US"] \}
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
function parseQualifierDefaults(qualifierDefaults) {
|
|
111
|
+
const defaults = {};
|
|
112
|
+
const tokens = qualifierDefaults.split('|');
|
|
113
|
+
for (const token of tokens) {
|
|
114
|
+
const [key, values] = token.split('=');
|
|
115
|
+
if (key && values) {
|
|
116
|
+
defaults[key.trim()] = values.split(',').map((v) => v.trim());
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return defaults;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Converts resource types string to array
|
|
123
|
+
* Example: "json,string" -\> ["json", "string"]
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
function parseResourceTypes(resourceTypes) {
|
|
127
|
+
return resourceTypes
|
|
128
|
+
.split(',')
|
|
129
|
+
.map((t) => t.trim())
|
|
130
|
+
.filter((t) => t.length > 0);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Extracts the directory path from a file or directory path
|
|
134
|
+
* If the path appears to be a directory (no extension), returns it as-is
|
|
135
|
+
* If the path appears to be a file, returns the parent directory
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
function extractDirectoryPath(path) {
|
|
139
|
+
if (!path)
|
|
140
|
+
return '';
|
|
141
|
+
// Normalize path separators
|
|
142
|
+
const normalizedPath = path.replace(/\\/g, '/');
|
|
143
|
+
// Check if it looks like a file (has an extension)
|
|
144
|
+
const parts = normalizedPath.split('/');
|
|
145
|
+
const lastPart = parts[parts.length - 1];
|
|
146
|
+
// If the last part has an extension, treat as file and return directory
|
|
147
|
+
if (lastPart.includes('.') && !lastPart.startsWith('.')) {
|
|
148
|
+
return parts.slice(0, -1).join('/') || '/';
|
|
149
|
+
}
|
|
150
|
+
// Otherwise, treat as directory
|
|
151
|
+
return normalizedPath;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Determines if a path appears to be a file (has extension) or directory
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
function isFilePath(path) {
|
|
158
|
+
if (!path)
|
|
159
|
+
return false;
|
|
160
|
+
const parts = path.split('/');
|
|
161
|
+
const lastPart = parts[parts.length - 1];
|
|
162
|
+
// Has extension and doesn't start with dot (hidden files)
|
|
163
|
+
return lastPart.includes('.') && !lastPart.startsWith('.');
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=urlParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urlParams.js","sourceRoot":"","sources":["../../../src/packlets/url-utils/urlParams.ts"],"names":[],"mapp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AAE,OAAO,EAAE,CAAC;IAErB,4BAA4B;IAC5B,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEhD,mDAAmD;IACnD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEzC,wEAAwE;IACxE,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IAExB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEzC,0DAA0D;IAC1D,OAAO,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n/**\n * Configuration options that can be passed via URL parameters\n * @public\n */\nexport interface IUrlConfigOptions {\n /**\n * Input file path\n */\n input?: string;\n\n /**\n * Configuration name or path\n */\n config?: string;\n\n /**\n * Context filter token (pipe-separated)\n */\n contextFilter?: string;\n\n /**\n * Qualifier defaults token (pipe-separated)\n */\n qualifierDefaults?: string;\n\n /**\n * Resource types filter (comma-separated)\n */\n resourceTypes?: string;\n\n /**\n * Maximum distance for language matching\n */\n maxDistance?: number;\n\n /**\n * Whether to reduce qualifiers\n */\n reduceQualifiers?: boolean;\n\n /**\n * Whether to launch in interactive mode\n */\n interactive?: boolean;\n\n /**\n * Starting directory for input file picker (derived from input path)\n */\n inputStartDir?: string;\n\n /**\n * Starting directory for config file picker (derived from config path)\n */\n configStartDir?: string;\n\n /**\n * Whether to use ZIP loading mode\n */\n loadZip?: boolean;\n\n /**\n * Path to ZIP file to load (for CLI-generated ZIPs)\n */\n zipPath?: string;\n\n /**\n * Name of ZIP file to load from Downloads (filename only)\n */\n zipFile?: string;\n}\n\n/**\n * Parses URL parameters and extracts configuration options\n * @public\n */\nexport function parseUrlParameters(): IUrlConfigOptions {\n const params = new URLSearchParams(window.location.search);\n\n const options: IUrlConfigOptions = {};\n\n // Parse string parameters\n const input = params.get('input');\n if (input) {\n options.input = input;\n // Set starting directory for input file picker\n if (isFilePath(input)) {\n options.inputStartDir = extractDirectoryPath(input);\n }\n }\n\n const config = params.get('config');\n if (config) {\n options.config = config;\n // Set starting directory for config file picker\n if (isFilePath(config)) {\n options.configStartDir = extractDirectoryPath(config);\n }\n }\n\n const contextFilter = params.get('contextFilter');\n if (contextFilter) options.contextFilter = contextFilter;\n\n const qualifierDefaults = params.get('qualifierDefaults');\n if (qualifierDefaults) options.qualifierDefaults = qualifierDefaults;\n\n const resourceTypes = params.get('resourceTypes');\n if (resourceTypes) options.resourceTypes = resourceTypes;\n\n // Parse numeric parameters\n const maxDistance = params.get('maxDistance');\n if (maxDistance) {\n const parsed = parseInt(maxDistance, 10);\n if (!isNaN(parsed)) options.maxDistance = parsed;\n }\n\n // Parse boolean parameters\n const reduceQualifiers = params.get('reduceQualifiers');\n if (reduceQualifiers === 'true') options.reduceQualifiers = true;\n\n const interactive = params.get('interactive');\n if (interactive === 'true') options.interactive = true;\n\n // Parse ZIP loading parameters\n const loadZip = params.get('loadZip');\n if (loadZip === 'true') options.loadZip = true;\n\n const zipPath = params.get('zipPath');\n if (zipPath) options.zipPath = zipPath;\n\n const zipFile = params.get('zipFile');\n if (zipFile) options.zipFile = zipFile;\n\n return options;\n}\n\n/**\n * Converts context filter token to context object\n * Example: \"language=en-US|territory=US\" -\\> \\{ language: \"en-US\", territory: \"US\" \\}\n * @public\n */\nexport function parseContextFilter(contextFilter: string): Record<string, string> {\n const context: Record<string, string> = {};\n\n const tokens = contextFilter.split('|');\n for (const token of tokens) {\n const [key, value] = token.split('=');\n if (key && value) {\n context[key.trim()] = value.trim();\n }\n }\n\n return context;\n}\n\n/**\n * Converts qualifier defaults token to structured format\n * Example: \"language=en-US,en-CA|territory=US\" -\\> \\{ language: [\"en-US\", \"en-CA\"], territory: [\"US\"] \\}\n * @public\n */\nexport function parseQualifierDefaults(qualifierDefaults: string): Record<string, string[]> {\n const defaults: Record<string, string[]> = {};\n\n const tokens = qualifierDefaults.split('|');\n for (const token of tokens) {\n const [key, values] = token.split('=');\n if (key && values) {\n defaults[key.trim()] = values.split(',').map((v) => v.trim());\n }\n }\n\n return defaults;\n}\n\n/**\n * Converts resource types string to array\n * Example: \"json,string\" -\\> [\"json\", \"string\"]\n * @public\n */\nexport function parseResourceTypes(resourceTypes: string): string[] {\n return resourceTypes\n .split(',')\n .map((t) => t.trim())\n .filter((t) => t.length > 0);\n}\n\n/**\n * Extracts the directory path from a file or directory path\n * If the path appears to be a directory (no extension), returns it as-is\n * If the path appears to be a file, returns the parent directory\n * @public\n */\nexport function extractDirectoryPath(path: string): string {\n if (!path) return '';\n\n // Normalize path separators\n const normalizedPath = path.replace(/\\\\/g, '/');\n\n // Check if it looks like a file (has an extension)\n const parts = normalizedPath.split('/');\n const lastPart = parts[parts.length - 1];\n\n // If the last part has an extension, treat as file and return directory\n if (lastPart.includes('.') && !lastPart.startsWith('.')) {\n return parts.slice(0, -1).join('/') || '/';\n }\n\n // Otherwise, treat as directory\n return normalizedPath;\n}\n\n/**\n * Determines if a path appears to be a file (has extension) or directory\n * @public\n */\nexport function isFilePath(path: string): boolean {\n if (!path) return false;\n\n const parts = path.split('/');\n const lastPart = parts[parts.length - 1];\n\n // Has extension and doesn't start with dot (hidden files)\n return lastPart.includes('.') && !lastPart.startsWith('.');\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.d.ts","sourceRoot":"","sources":["../../src/test/setupTests.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Erik Fortune
|
|
4
|
+
*
|
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
* in the Software without restriction, including without limitation the rights
|
|
8
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
* furnished to do so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
* copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const crypto_1 = require("crypto");
|
|
25
|
+
const util_1 = require("util");
|
|
26
|
+
// Setup Web Crypto API using Node.js webcrypto
|
|
27
|
+
Object.defineProperty(global, 'crypto', {
|
|
28
|
+
value: crypto_1.webcrypto,
|
|
29
|
+
writable: true,
|
|
30
|
+
configurable: true
|
|
31
|
+
});
|
|
32
|
+
// Setup TextEncoder/TextDecoder for Node environment
|
|
33
|
+
Object.defineProperty(global, 'TextEncoder', {
|
|
34
|
+
value: util_1.TextEncoder,
|
|
35
|
+
writable: true,
|
|
36
|
+
configurable: true
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(global, 'TextDecoder', {
|
|
39
|
+
value: util_1.TextDecoder,
|
|
40
|
+
writable: true,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
// Mock DataTransfer for File API testing
|
|
44
|
+
class MockDataTransfer {
|
|
45
|
+
constructor() {
|
|
46
|
+
const fileArray = [];
|
|
47
|
+
this.items = {
|
|
48
|
+
add: (file) => {
|
|
49
|
+
fileArray.push(file);
|
|
50
|
+
this.files = createFileList(fileArray);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
this.files = createFileList([]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function createFileList(files) {
|
|
57
|
+
const fileList = {
|
|
58
|
+
length: files.length,
|
|
59
|
+
item: (index) => files[index] || null,
|
|
60
|
+
[Symbol.iterator]: function* () {
|
|
61
|
+
for (const file of files) {
|
|
62
|
+
yield file;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
for (let i = 0; i < files.length; i++) {
|
|
67
|
+
fileList[i] = files[i];
|
|
68
|
+
}
|
|
69
|
+
return fileList;
|
|
70
|
+
}
|
|
71
|
+
Object.defineProperty(global, 'DataTransfer', {
|
|
72
|
+
value: MockDataTransfer,
|
|
73
|
+
writable: true,
|
|
74
|
+
configurable: true
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=setupTests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupTests.js","sourceRoot":"","sources":["../../src/test/setupTests.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAEH,mCAAmC;AACnC,+BAAgD;AAEhD,+CAA+C;AAC/C,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE;IACtC,KAAK,EAAE,kBAAS;IAChB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,qDAAqD;AACrD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE;IAC3C,KAAK,EAAE,kBAAW;IAClB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE;IAC3C,KAAK,EAAE,kBAAW;IAClB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,yCAAyC;AACzC,MAAM,gBAAgB;IAIpB;QACE,MAAM,SAAS,GAAW,EAAE,CAAC;QAE7B,IAAI,CAAC,KAAK,GAAG;YACX,GAAG,EAAE,CAAC,IAAU,EAAE,EAAE;gBAClB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrB,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC;SACF,CAAC;QAEF,IAAI,CAAC,KAAK,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;CACF;AAED,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,QAAQ,GAAG;QACf,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI;QAC7C,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;YAC1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,IAAI,CAAC;YACb,CAAC;QACH,CAAC;KACF,CAAC;IAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,QAA4C,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,QAA+B,CAAC;AACzC,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE;IAC5C,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2025 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport { webcrypto } from 'crypto';\nimport { TextEncoder, TextDecoder } from 'util';\n\n// Setup Web Crypto API using Node.js webcrypto\nObject.defineProperty(global, 'crypto', {\n value: webcrypto,\n writable: true,\n configurable: true\n});\n\n// Setup TextEncoder/TextDecoder for Node environment\nObject.defineProperty(global, 'TextEncoder', {\n value: TextEncoder,\n writable: true,\n configurable: true\n});\n\nObject.defineProperty(global, 'TextDecoder', {\n value: TextDecoder,\n writable: true,\n configurable: true\n});\n\n// Mock DataTransfer for File API testing\nclass MockDataTransfer {\n items: { add: (file: File) => void };\n files: FileList;\n\n constructor() {\n const fileArray: File[] = [];\n\n this.items = {\n add: (file: File) => {\n fileArray.push(file);\n this.files = createFileList(fileArray);\n }\n };\n\n this.files = createFileList([]);\n }\n}\n\nfunction createFileList(files: File[]): FileList {\n const fileList = {\n length: files.length,\n item: (index: number) => files[index] || null,\n [Symbol.iterator]: function* () {\n for (const file of files) {\n yield file;\n }\n }\n };\n\n for (let i = 0; i < files.length; i++) {\n (fileList as unknown as Record<number, File>)[i] = files[i];\n }\n\n return fileList as unknown as FileList;\n}\n\nObject.defineProperty(global, 'DataTransfer', {\n value: MockDataTransfer,\n writable: true,\n configurable: true\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserHashProvider.test.d.ts","sourceRoot":"","sources":["../../../src/test/unit/browserHashProvider.test.ts"],"names":[],"mappings":"AAsBA,OAAO,oBAAoB,CAAC"}
|