@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.
Files changed (262) hide show
  1. package/.rush/temp/86c9c1ad46e237e0b957c2442bf0355cf39babba.tar.log +121 -0
  2. package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +40 -0
  3. package/.rush/temp/operation/build/all.log +40 -0
  4. package/.rush/temp/operation/build/log-chunks.jsonl +40 -0
  5. package/.rush/temp/operation/build/state.json +3 -0
  6. package/.rush/temp/shrinkwrap-deps.json +624 -0
  7. package/config/api-extractor.json +343 -0
  8. package/config/jest.config.json +16 -0
  9. package/config/rig.json +16 -0
  10. package/dist/ts-web-extras.d.ts +574 -0
  11. package/dist/tsdoc-metadata.json +11 -0
  12. package/docs/index.md +34 -0
  13. package/docs/ts-web-extras.browserhashprovider.hashparts.md +88 -0
  14. package/docs/ts-web-extras.browserhashprovider.hashstring.md +72 -0
  15. package/docs/ts-web-extras.browserhashprovider.md +66 -0
  16. package/docs/ts-web-extras.exportasjson.md +70 -0
  17. package/docs/ts-web-extras.exportusingfilesystemapi.md +104 -0
  18. package/docs/ts-web-extras.extractdirectorypath.md +52 -0
  19. package/docs/ts-web-extras.fileapitreeaccessors.create.md +72 -0
  20. package/docs/ts-web-extras.fileapitreeaccessors.extractfilemetadata.md +54 -0
  21. package/docs/ts-web-extras.fileapitreeaccessors.fromdirectoryupload.md +72 -0
  22. package/docs/ts-web-extras.fileapitreeaccessors.fromfilelist.md +72 -0
  23. package/docs/ts-web-extras.fileapitreeaccessors.getoriginalfile.md +72 -0
  24. package/docs/ts-web-extras.fileapitreeaccessors.md +114 -0
  25. package/docs/ts-web-extras.filepickeraccepttype.accept.md +11 -0
  26. package/docs/ts-web-extras.filepickeraccepttype.description.md +11 -0
  27. package/docs/ts-web-extras.filepickeraccepttype.md +75 -0
  28. package/docs/ts-web-extras.filesystemcreatewritableoptions_2.keepexistingdata.md +11 -0
  29. package/docs/ts-web-extras.filesystemcreatewritableoptions_2.md +58 -0
  30. package/docs/ts-web-extras.filesystemdirectoryhandle_2._symbol.asynciterator_.md +15 -0
  31. package/docs/ts-web-extras.filesystemdirectoryhandle_2.entries.md +15 -0
  32. package/docs/ts-web-extras.filesystemdirectoryhandle_2.getdirectoryhandle.md +66 -0
  33. package/docs/ts-web-extras.filesystemdirectoryhandle_2.getfilehandle.md +66 -0
  34. package/docs/ts-web-extras.filesystemdirectoryhandle_2.keys.md +15 -0
  35. package/docs/ts-web-extras.filesystemdirectoryhandle_2.kind.md +11 -0
  36. package/docs/ts-web-extras.filesystemdirectoryhandle_2.md +146 -0
  37. package/docs/ts-web-extras.filesystemdirectoryhandle_2.removeentry.md +66 -0
  38. package/docs/ts-web-extras.filesystemdirectoryhandle_2.resolve.md +50 -0
  39. package/docs/ts-web-extras.filesystemdirectoryhandle_2.values.md +15 -0
  40. package/docs/ts-web-extras.filesystemfilehandle_2.createwritable.md +52 -0
  41. package/docs/ts-web-extras.filesystemfilehandle_2.getfile.md +15 -0
  42. package/docs/ts-web-extras.filesystemfilehandle_2.kind.md +11 -0
  43. package/docs/ts-web-extras.filesystemfilehandle_2.md +92 -0
  44. package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.create.md +11 -0
  45. package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.md +58 -0
  46. package/docs/ts-web-extras.filesystemgetfileoptions_2.create.md +11 -0
  47. package/docs/ts-web-extras.filesystemgetfileoptions_2.md +58 -0
  48. package/docs/ts-web-extras.filesystemhandle_2.issameentry.md +50 -0
  49. package/docs/ts-web-extras.filesystemhandle_2.kind.md +11 -0
  50. package/docs/ts-web-extras.filesystemhandle_2.md +119 -0
  51. package/docs/ts-web-extras.filesystemhandle_2.name.md +11 -0
  52. package/docs/ts-web-extras.filesystemhandle_2.querypermission.md +52 -0
  53. package/docs/ts-web-extras.filesystemhandle_2.requestpermission.md +52 -0
  54. package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.md +58 -0
  55. package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.mode.md +11 -0
  56. package/docs/ts-web-extras.filesystemremoveoptions_2.md +58 -0
  57. package/docs/ts-web-extras.filesystemremoveoptions_2.recursive.md +11 -0
  58. package/docs/ts-web-extras.filesystemwritablefilestream_2.md +57 -0
  59. package/docs/ts-web-extras.filesystemwritablefilestream_2.seek.md +50 -0
  60. package/docs/ts-web-extras.filesystemwritablefilestream_2.truncate.md +50 -0
  61. package/docs/ts-web-extras.filesystemwritablefilestream_2.write.md +50 -0
  62. package/docs/ts-web-extras.filetreehelpers.defaultfileapitreeinitparams.md +13 -0
  63. package/docs/ts-web-extras.filetreehelpers.extractfilelistmetadata.md +56 -0
  64. package/docs/ts-web-extras.filetreehelpers.extractfilemetadata.md +56 -0
  65. package/docs/ts-web-extras.filetreehelpers.fromdirectoryupload.md +76 -0
  66. package/docs/ts-web-extras.filetreehelpers.fromfilelist.md +76 -0
  67. package/docs/ts-web-extras.filetreehelpers.getoriginalfile.md +72 -0
  68. package/docs/ts-web-extras.filetreehelpers.md +102 -0
  69. package/docs/ts-web-extras.idirectoryhandletreeinitializer.dirhandles.md +11 -0
  70. package/docs/ts-web-extras.idirectoryhandletreeinitializer.md +100 -0
  71. package/docs/ts-web-extras.idirectoryhandletreeinitializer.nonrecursive.md +11 -0
  72. package/docs/ts-web-extras.idirectoryhandletreeinitializer.prefix.md +11 -0
  73. package/docs/ts-web-extras.ifilehandletreeinitializer.filehandles.md +11 -0
  74. package/docs/ts-web-extras.ifilehandletreeinitializer.md +79 -0
  75. package/docs/ts-web-extras.ifilehandletreeinitializer.prefix.md +11 -0
  76. package/docs/ts-web-extras.ifilelisttreeinitializer.filelist.md +11 -0
  77. package/docs/ts-web-extras.ifilelisttreeinitializer.md +58 -0
  78. package/docs/ts-web-extras.ifilemetadata.lastmodified.md +11 -0
  79. package/docs/ts-web-extras.ifilemetadata.md +124 -0
  80. package/docs/ts-web-extras.ifilemetadata.name.md +11 -0
  81. package/docs/ts-web-extras.ifilemetadata.path.md +11 -0
  82. package/docs/ts-web-extras.ifilemetadata.size.md +11 -0
  83. package/docs/ts-web-extras.ifilemetadata.type.md +11 -0
  84. package/docs/ts-web-extras.ifsaccessapis.md +56 -0
  85. package/docs/ts-web-extras.ifsaccessapis.showdirectorypicker.md +52 -0
  86. package/docs/ts-web-extras.ifsaccessapis.showopenfilepicker.md +52 -0
  87. package/docs/ts-web-extras.ifsaccessapis.showsavefilepicker.md +52 -0
  88. package/docs/ts-web-extras.isdirectoryhandle.md +56 -0
  89. package/docs/ts-web-extras.isfilehandle.md +56 -0
  90. package/docs/ts-web-extras.isfilepath.md +52 -0
  91. package/docs/ts-web-extras.iurlconfigoptions.config.md +13 -0
  92. package/docs/ts-web-extras.iurlconfigoptions.configstartdir.md +13 -0
  93. package/docs/ts-web-extras.iurlconfigoptions.contextfilter.md +13 -0
  94. package/docs/ts-web-extras.iurlconfigoptions.input.md +13 -0
  95. package/docs/ts-web-extras.iurlconfigoptions.inputstartdir.md +13 -0
  96. package/docs/ts-web-extras.iurlconfigoptions.interactive.md +13 -0
  97. package/docs/ts-web-extras.iurlconfigoptions.loadzip.md +13 -0
  98. package/docs/ts-web-extras.iurlconfigoptions.maxdistance.md +13 -0
  99. package/docs/ts-web-extras.iurlconfigoptions.md +286 -0
  100. package/docs/ts-web-extras.iurlconfigoptions.qualifierdefaults.md +13 -0
  101. package/docs/ts-web-extras.iurlconfigoptions.reducequalifiers.md +13 -0
  102. package/docs/ts-web-extras.iurlconfigoptions.resourcetypes.md +13 -0
  103. package/docs/ts-web-extras.iurlconfigoptions.zipfile.md +13 -0
  104. package/docs/ts-web-extras.iurlconfigoptions.zippath.md +13 -0
  105. package/docs/ts-web-extras.md +512 -0
  106. package/docs/ts-web-extras.parsecontextfilter.md +52 -0
  107. package/docs/ts-web-extras.parsequalifierdefaults.md +52 -0
  108. package/docs/ts-web-extras.parseresourcetypes.md +52 -0
  109. package/docs/ts-web-extras.parseurlparameters.md +17 -0
  110. package/docs/ts-web-extras.safeshowdirectorypicker.md +72 -0
  111. package/docs/ts-web-extras.safeshowopenfilepicker.md +72 -0
  112. package/docs/ts-web-extras.safeshowsavefilepicker.md +72 -0
  113. package/docs/ts-web-extras.showdirectorypickeroptions.id.md +11 -0
  114. package/docs/ts-web-extras.showdirectorypickeroptions.md +96 -0
  115. package/docs/ts-web-extras.showdirectorypickeroptions.mode.md +11 -0
  116. package/docs/ts-web-extras.showdirectorypickeroptions.startin.md +11 -0
  117. package/docs/ts-web-extras.showopenfilepickeroptions.excludeacceptalloption.md +11 -0
  118. package/docs/ts-web-extras.showopenfilepickeroptions.id.md +11 -0
  119. package/docs/ts-web-extras.showopenfilepickeroptions.md +134 -0
  120. package/docs/ts-web-extras.showopenfilepickeroptions.multiple.md +11 -0
  121. package/docs/ts-web-extras.showopenfilepickeroptions.startin.md +11 -0
  122. package/docs/ts-web-extras.showopenfilepickeroptions.types.md +11 -0
  123. package/docs/ts-web-extras.showsavefilepickeroptions.excludeacceptalloption.md +11 -0
  124. package/docs/ts-web-extras.showsavefilepickeroptions.id.md +11 -0
  125. package/docs/ts-web-extras.showsavefilepickeroptions.md +134 -0
  126. package/docs/ts-web-extras.showsavefilepickeroptions.startin.md +11 -0
  127. package/docs/ts-web-extras.showsavefilepickeroptions.suggestedname.md +11 -0
  128. package/docs/ts-web-extras.showsavefilepickeroptions.types.md +11 -0
  129. package/docs/ts-web-extras.supportsfilesystemaccess.md +56 -0
  130. package/docs/ts-web-extras.treeinitializer.md +15 -0
  131. package/docs/ts-web-extras.wellknowndirectory.md +13 -0
  132. package/docs/ts-web-extras.windowwithfsaccess.md +15 -0
  133. package/etc/ts-web-extras.api.md +310 -0
  134. package/lib/index.d.ts +16 -0
  135. package/lib/index.d.ts.map +1 -0
  136. package/lib/index.js +58 -0
  137. package/lib/index.js.map +1 -0
  138. package/lib/packlets/crypto/browserHashProvider.d.ts +24 -0
  139. package/lib/packlets/crypto/browserHashProvider.d.ts.map +1 -0
  140. package/lib/packlets/crypto/browserHashProvider.js +70 -0
  141. package/lib/packlets/crypto/browserHashProvider.js.map +1 -0
  142. package/lib/packlets/crypto/index.d.ts +6 -0
  143. package/lib/packlets/crypto/index.d.ts.map +1 -0
  144. package/lib/packlets/crypto/index.js +43 -0
  145. package/lib/packlets/crypto/index.js.map +1 -0
  146. package/lib/packlets/file-api-types/index.d.ts +205 -0
  147. package/lib/packlets/file-api-types/index.d.ts.map +1 -0
  148. package/lib/packlets/file-api-types/index.js +166 -0
  149. package/lib/packlets/file-api-types/index.js.map +1 -0
  150. package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts +129 -0
  151. package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -0
  152. package/lib/packlets/file-tree/fileApiTreeAccessors.js +334 -0
  153. package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -0
  154. package/lib/packlets/file-tree/index.d.ts +6 -0
  155. package/lib/packlets/file-tree/index.d.ts.map +1 -0
  156. package/lib/packlets/file-tree/index.js +43 -0
  157. package/lib/packlets/file-tree/index.js.map +1 -0
  158. package/lib/packlets/helpers/fileTreeHelpers.d.ts +60 -0
  159. package/lib/packlets/helpers/fileTreeHelpers.d.ts.map +1 -0
  160. package/lib/packlets/helpers/fileTreeHelpers.js +102 -0
  161. package/lib/packlets/helpers/fileTreeHelpers.js.map +1 -0
  162. package/lib/packlets/helpers/index.d.ts +6 -0
  163. package/lib/packlets/helpers/index.d.ts.map +1 -0
  164. package/lib/packlets/helpers/index.js +63 -0
  165. package/lib/packlets/helpers/index.js.map +1 -0
  166. package/lib/packlets/url-utils/index.d.ts +6 -0
  167. package/lib/packlets/url-utils/index.d.ts.map +1 -0
  168. package/lib/packlets/url-utils/index.js +43 -0
  169. package/lib/packlets/url-utils/index.js.map +1 -0
  170. package/lib/packlets/url-utils/urlParams.d.ts +94 -0
  171. package/lib/packlets/url-utils/urlParams.d.ts.map +1 -0
  172. package/lib/packlets/url-utils/urlParams.js +165 -0
  173. package/lib/packlets/url-utils/urlParams.js.map +1 -0
  174. package/lib/test/setupTests.d.ts +2 -0
  175. package/lib/test/setupTests.d.ts.map +1 -0
  176. package/lib/test/setupTests.js +76 -0
  177. package/lib/test/setupTests.js.map +1 -0
  178. package/lib/test/unit/browserHashProvider.test.d.ts +2 -0
  179. package/lib/test/unit/browserHashProvider.test.d.ts.map +1 -0
  180. package/lib/test/unit/browserHashProvider.test.js +142 -0
  181. package/lib/test/unit/browserHashProvider.test.js.map +1 -0
  182. package/lib/test/unit/fileApiTreeAccessors.test.d.ts +2 -0
  183. package/lib/test/unit/fileApiTreeAccessors.test.d.ts.map +1 -0
  184. package/lib/test/unit/fileApiTreeAccessors.test.js +1139 -0
  185. package/lib/test/unit/fileApiTreeAccessors.test.js.map +1 -0
  186. package/lib/test/unit/fileApiTypes.test.d.ts +2 -0
  187. package/lib/test/unit/fileApiTypes.test.d.ts.map +1 -0
  188. package/lib/test/unit/fileApiTypes.test.js +444 -0
  189. package/lib/test/unit/fileApiTypes.test.js.map +1 -0
  190. package/lib/test/unit/fileTreeHelpers.test.d.ts +2 -0
  191. package/lib/test/unit/fileTreeHelpers.test.d.ts.map +1 -0
  192. package/lib/test/unit/fileTreeHelpers.test.js +592 -0
  193. package/lib/test/unit/fileTreeHelpers.test.js.map +1 -0
  194. package/lib/test/unit/urlParams.test.d.ts +2 -0
  195. package/lib/test/unit/urlParams.test.d.ts.map +1 -0
  196. package/lib/test/unit/urlParams.test.js +395 -0
  197. package/lib/test/unit/urlParams.test.js.map +1 -0
  198. package/lib/test/utils/testHelpers.d.ts +51 -0
  199. package/lib/test/utils/testHelpers.d.ts.map +1 -0
  200. package/lib/test/utils/testHelpers.js +133 -0
  201. package/lib/test/utils/testHelpers.js.map +1 -0
  202. package/package.json +68 -0
  203. package/rush-logs/ts-web-extras.build.cache.log +3 -0
  204. package/rush-logs/ts-web-extras.build.log +40 -0
  205. package/src/index.ts +47 -0
  206. package/src/packlets/crypto/browserHashProvider.ts +73 -0
  207. package/src/packlets/crypto/index.ts +28 -0
  208. package/src/packlets/file-api-types/index.ts +345 -0
  209. package/src/packlets/file-tree/fileApiTreeAccessors.ts +420 -0
  210. package/src/packlets/file-tree/index.ts +28 -0
  211. package/src/packlets/helpers/fileTreeHelpers.ts +107 -0
  212. package/src/packlets/helpers/index.ts +28 -0
  213. package/src/packlets/url-utils/index.ts +28 -0
  214. package/src/packlets/url-utils/urlParams.ts +245 -0
  215. package/src/test/setupTests.ts +87 -0
  216. package/src/test/unit/browserHashProvider.test.ts +155 -0
  217. package/src/test/unit/browserHashProvider.test.ts.bak +376 -0
  218. package/src/test/unit/fileApiTreeAccessors.test.ts +1318 -0
  219. package/src/test/unit/fileApiTypes.test.ts +551 -0
  220. package/src/test/unit/fileTreeHelpers.test.ts +694 -0
  221. package/src/test/unit/urlParams.test.ts +464 -0
  222. package/src/test/utils/testHelpers.ts +155 -0
  223. package/temp/build/typescript/ts_l9Fw4VUO.json +1 -0
  224. package/temp/coverage/base.css +224 -0
  225. package/temp/coverage/block-navigation.js +87 -0
  226. package/temp/coverage/crypto/browserHashProvider.ts.html +304 -0
  227. package/temp/coverage/crypto/index.html +116 -0
  228. package/temp/coverage/favicon.png +0 -0
  229. package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +1345 -0
  230. package/temp/coverage/file-tree/index.html +116 -0
  231. package/temp/coverage/helpers/fileTreeHelpers.ts.html +406 -0
  232. package/temp/coverage/helpers/index.html +116 -0
  233. package/temp/coverage/index.html +161 -0
  234. package/temp/coverage/lcov-report/base.css +224 -0
  235. package/temp/coverage/lcov-report/block-navigation.js +87 -0
  236. package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +304 -0
  237. package/temp/coverage/lcov-report/crypto/index.html +116 -0
  238. package/temp/coverage/lcov-report/favicon.png +0 -0
  239. package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +1345 -0
  240. package/temp/coverage/lcov-report/file-tree/index.html +116 -0
  241. package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +406 -0
  242. package/temp/coverage/lcov-report/helpers/index.html +116 -0
  243. package/temp/coverage/lcov-report/index.html +161 -0
  244. package/temp/coverage/lcov-report/prettify.css +1 -0
  245. package/temp/coverage/lcov-report/prettify.js +2 -0
  246. package/temp/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  247. package/temp/coverage/lcov-report/sorter.js +210 -0
  248. package/temp/coverage/lcov-report/url-utils/index.html +116 -0
  249. package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +820 -0
  250. package/temp/coverage/lcov.info +1096 -0
  251. package/temp/coverage/prettify.css +1 -0
  252. package/temp/coverage/prettify.js +2 -0
  253. package/temp/coverage/sort-arrow-sprite.png +0 -0
  254. package/temp/coverage/sorter.js +210 -0
  255. package/temp/coverage/url-utils/index.html +116 -0
  256. package/temp/coverage/url-utils/urlParams.ts.html +820 -0
  257. package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
  258. package/temp/test/jest/jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/63/package_63a8257b0e4d0e7ff33f927d75f27a75 +53 -0
  259. package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
  260. package/temp/ts-web-extras.api.json +5040 -0
  261. package/temp/ts-web-extras.api.md +310 -0
  262. package/tsconfig.json +7 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileTreeHelpers.test.js","sourceRoot":"","sources":["../../../src/test/unit/fileTreeHelpers.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAEH,8BAA4B;AAC5B,oDAAyD;AAEzD,sDAAuG;AAEvG,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,QAAQ,CAAC,cAAc,EAAE,GAA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,SAAS,EAAE,CAAC;gBAE5D,mBAAmB;gBACnB,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;gBAC7D,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;gBAC7D,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,gCAAgC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;gBACvE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;gBAClE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;gBAE1D,wBAAwB;gBACxB,MAAM,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;gBAC5E,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;YAC7D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,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 '@fgv/ts-utils-jest';\nimport { FileTreeHelpers } from '../../packlets/helpers';\nimport { FileApiTreeAccessors } from '../../packlets/file-tree';\nimport { createMockFile, createMockFileList, createMockDirectoryFileList } from '../utils/testHelpers';\n\ndescribe('FileTreeHelpers', () => {\n describe('fromFileList', () => {\n test('creates FileTree from simple FileList', async () => {\n const fileList = createMockFileList([\n { name: 'file1.txt', content: 'content1' },\n { name: 'file2.txt', content: 'content2' }\n ]);\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify files are accessible with proper paths\n expect(fileTree.getFile('/file1.txt')).toSucceed();\n expect(fileTree.getFile('/file2.txt')).toSucceed();\n\n // Verify content can be retrieved\n const content1 = fileTree.hal.getFileContents('/file1.txt');\n expect(content1).toSucceedWith('content1');\n\n const content2 = fileTree.hal.getFileContents('/file2.txt');\n expect(content2).toSucceedWith('content2');\n });\n });\n\n test('creates FileTree from FileList with prefix', async () => {\n const fileList = createMockFileList([{ name: 'test.txt', content: 'test content' }]);\n\n const result = await FileTreeHelpers.fromFileList(fileList, { prefix: '/upload' });\n expect(result).toSucceed();\n });\n\n test('handles empty FileList', async () => {\n const fileList = createMockFileList([]);\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceed();\n });\n\n test('handles various file types', async () => {\n const fileList = createMockFileList([\n { name: 'data.json', content: '{\"key\": \"value\"}', type: 'application/json' },\n { name: 'script.js', content: 'console.log(\"hello\");', type: 'application/javascript' },\n { name: 'style.css', content: 'body { margin: 0; }', type: 'text/css' },\n { name: 'readme.txt', content: 'This is a readme', type: 'text/plain' }\n ]);\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n expect(fileTree.getFile('/data.json')).toSucceed();\n expect(fileTree.getFile('/script.js')).toSucceed();\n expect(fileTree.getFile('/style.css')).toSucceed();\n expect(fileTree.getFile('/readme.txt')).toSucceed();\n });\n });\n\n test('automatically applies MIME types as contentType', async () => {\n const fileList = createMockFileList([\n { name: 'data.json', content: '{\"key\": \"value\"}', type: 'application/json' },\n { name: 'script.js', content: 'console.log(\"hello\");', type: 'application/javascript' },\n { name: 'style.css', content: 'body { margin: 0; }', type: 'text/css' },\n { name: 'readme.txt', content: 'This is a readme', type: 'text/plain' },\n { name: 'image.png', content: 'PNG data', type: 'image/png' },\n { name: 'document.pdf', content: 'PDF content', type: 'application/pdf' },\n { name: 'archive.zip', content: 'ZIP data', type: 'application/zip' }\n ]);\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify MIME types are automatically applied as contentType\n expect(fileTree.getFile('/data.json')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/json');\n });\n\n expect(fileTree.getFile('/script.js')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/javascript');\n });\n\n expect(fileTree.getFile('/style.css')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/css');\n });\n\n expect(fileTree.getFile('/readme.txt')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/plain');\n });\n\n expect(fileTree.getFile('/image.png')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('image/png');\n });\n\n expect(fileTree.getFile('/document.pdf')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/pdf');\n });\n\n expect(fileTree.getFile('/archive.zip')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/zip');\n });\n });\n });\n\n test('handles files without MIME types', async () => {\n const fileList = createMockFileList([\n { name: 'no-type.txt', content: 'content without type' },\n { name: 'empty-type.dat', content: 'empty type', type: '' },\n { name: 'unknown.ext', content: 'unknown extension' }\n ]);\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Files without MIME types should have undefined contentType\n expect(fileTree.getFile('/no-type.txt')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/plain'); // Default from createMockFile\n });\n\n expect(fileTree.getFile('/empty-type.dat')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/plain'); // Browser defaults empty type to text/plain\n });\n\n expect(fileTree.getFile('/unknown.ext')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/plain'); // Default from createMockFile\n });\n });\n });\n\n test('forces content type to string (not templated)', async () => {\n const fileList = createMockFileList([\n { name: 'test.json', content: '{\"test\": true}', type: 'application/json' }\n ]);\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify the return type is FileTree<string> not FileTree<T>\n expect(fileTree.getFile('/test.json')).toSucceedAndSatisfy((file) => {\n expect(typeof file.contentType).toBe('string');\n expect(file.contentType).toBe('application/json');\n });\n });\n });\n\n test('propagates file reading errors', async () => {\n const badFile = {\n name: 'bad.txt',\n size: 10,\n type: 'text/plain',\n lastModified: Date.now(),\n text: () => Promise.reject(new Error('Read failed'))\n } as unknown as File;\n\n const fileList = createMockFileList([{ name: 'good.txt', content: 'good content' }]);\n\n // Create a FileList with just the bad file\n const dt = new DataTransfer();\n dt.items.add(badFile);\n const badFileList = dt.files;\n\n const result = await FileTreeHelpers.fromFileList(badFileList);\n expect(result).toFailWith(/Failed to read file/);\n });\n\n test('maintains file accessibility through FileTree API', async () => {\n const fileList = createMockFileList([{ name: 'test.json', content: '{\"name\": \"test\", \"value\": 42}' }]);\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n const file = fileTree.getFile('/test.json');\n expect(file).toSucceedAndSatisfy((fileItem) => {\n // Test JSON parsing through FileTree\n const jsonResult = fileItem.getContents();\n expect(jsonResult).toSucceedAndSatisfy((parsed) => {\n expect(parsed).toEqual({ name: 'test', value: 42 });\n });\n\n // Test raw content access\n const rawResult = fileItem.getRawContents();\n expect(rawResult).toSucceedWith('{\"name\": \"test\", \"value\": 42}');\n\n // Test file properties\n expect(fileItem.name).toBe('test.json');\n expect(fileItem.extension).toBe('.json');\n expect(fileItem.baseName).toBe('test');\n });\n });\n });\n });\n\n describe('fromDirectoryUpload', () => {\n test('creates FileTree from directory structure', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'project/src/index.js', content: 'console.log(\"main\");' },\n { path: 'project/src/utils.js', content: 'export const helper = () => {};' },\n { path: 'project/package.json', content: '{\"name\": \"test-project\"}' },\n { path: 'project/README.md', content: '# Test Project' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify all files are accessible\n expect(fileTree.getFile('/project/src/index.js')).toSucceed();\n expect(fileTree.getFile('/project/src/utils.js')).toSucceed();\n expect(fileTree.getFile('/project/package.json')).toSucceed();\n expect(fileTree.getFile('/project/README.md')).toSucceed();\n\n // Verify directory structure\n expect(fileTree.getDirectory('/project')).toSucceed();\n expect(fileTree.getDirectory('/project/src')).toSucceed();\n\n // Verify content retrieval\n const packageContent = fileTree.hal.getFileContents('/project/package.json');\n expect(packageContent).toSucceedWith('{\"name\": \"test-project\"}');\n });\n });\n\n test('creates FileTree from directory with prefix', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'app/config.json', content: '{\"setting\": \"value\"}' },\n { path: 'app/main.js', content: 'console.log(\"app\");' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList, { prefix: '/upload' });\n expect(result).toSucceed();\n });\n\n test('preserves directory hierarchy', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'deep/nested/structure/file1.txt', content: 'content1' },\n { path: 'deep/nested/structure/file2.txt', content: 'content2' },\n { path: 'deep/other/branch/file3.txt', content: 'content3' },\n { path: 'deep/file4.txt', content: 'content4' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Test all directory levels\n expect(fileTree.getDirectory('/deep')).toSucceed();\n expect(fileTree.getDirectory('/deep/nested')).toSucceed();\n expect(fileTree.getDirectory('/deep/nested/structure')).toSucceed();\n expect(fileTree.getDirectory('/deep/other')).toSucceed();\n expect(fileTree.getDirectory('/deep/other/branch')).toSucceed();\n\n // Test directory traversal\n const deepDir = fileTree.getDirectory('/deep');\n expect(deepDir).toSucceedAndSatisfy((dir) => {\n const children = dir.getChildren();\n expect(children).toSucceedAndSatisfy((items) => {\n const names = items.map((item) => item.name).sort();\n expect(names).toContain('nested');\n expect(names).toContain('other');\n expect(names).toContain('file4.txt');\n });\n });\n });\n });\n\n test('handles webkitRelativePath correctly', async () => {\n // Create files with explicit webkitRelativePath\n const files = [\n createMockFile({\n name: 'index.html',\n content: '<html></html>',\n webkitRelativePath: 'website/index.html'\n }),\n createMockFile({\n name: 'style.css',\n content: 'body {}',\n webkitRelativePath: 'website/css/style.css'\n })\n ];\n\n // Create FileList manually to preserve webkitRelativePath\n const dt = new DataTransfer();\n files.forEach((file) => dt.items.add(file));\n const fileList = dt.files;\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n expect(fileTree.getFile('/website/index.html')).toSucceed();\n expect(fileTree.getFile('/website/css/style.css')).toSucceed();\n expect(fileTree.getDirectory('/website')).toSucceed();\n expect(fileTree.getDirectory('/website/css')).toSucceed();\n });\n });\n\n test('handles single file in directory', async () => {\n const fileList = createMockDirectoryFileList([{ path: 'single/file.txt', content: 'lone file' }]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n expect(fileTree.getFile('/single/file.txt')).toSucceed();\n expect(fileTree.getDirectory('/single')).toSucceed();\n });\n });\n\n test('handles empty directory upload', async () => {\n const fileList = createMockDirectoryFileList([]);\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceed();\n });\n\n test('automatically applies MIME types as contentType in directory upload', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'project/package.json', content: '{\"name\": \"test\"}', type: 'application/json' },\n { path: 'project/src/index.js', content: 'console.log(\"main\");', type: 'application/javascript' },\n { path: 'project/src/styles.css', content: 'body { color: red; }', type: 'text/css' },\n { path: 'project/README.md', content: '# Project', type: 'text/markdown' },\n { path: 'project/data.xml', content: '<root></root>', type: 'application/xml' },\n { path: 'project/assets/logo.svg', content: '<svg></svg>', type: 'image/svg+xml' },\n { path: 'project/docs/manual.pdf', content: 'PDF content', type: 'application/pdf' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify MIME types are automatically applied as contentType\n expect(fileTree.getFile('/project/package.json')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/json');\n });\n\n expect(fileTree.getFile('/project/src/index.js')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/javascript');\n });\n\n expect(fileTree.getFile('/project/src/styles.css')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/css');\n });\n\n expect(fileTree.getFile('/project/README.md')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/markdown');\n });\n\n expect(fileTree.getFile('/project/data.xml')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/xml');\n });\n\n expect(fileTree.getFile('/project/assets/logo.svg')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('image/svg+xml');\n });\n\n expect(fileTree.getFile('/project/docs/manual.pdf')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/pdf');\n });\n });\n });\n\n test('handles mixed MIME types and missing types in directory upload', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'mixed/typed.json', content: '{}', type: 'application/json' },\n { path: 'mixed/untyped.txt', content: 'plain text' }, // No type specified\n { path: 'mixed/empty-type.dat', content: 'data', type: '' }, // Empty type\n { path: 'mixed/binary.bin', content: 'binary data', type: 'application/octet-stream' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n expect(fileTree.getFile('/mixed/typed.json')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/json');\n });\n\n expect(fileTree.getFile('/mixed/untyped.txt')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/plain'); // Default from createMockFile\n });\n\n expect(fileTree.getFile('/mixed/empty-type.dat')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('text/plain'); // Browser defaults empty type to text/plain\n });\n\n expect(fileTree.getFile('/mixed/binary.bin')).toSucceedAndSatisfy((file) => {\n expect(file.contentType).toBe('application/octet-stream');\n });\n });\n });\n\n test('forces content type to string for directory upload (not templated)', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'app/config.json', content: '{\"app\": \"test\"}', type: 'application/json' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify the return type is FileTree<string> not FileTree<T>\n expect(fileTree.getFile('/app/config.json')).toSucceedAndSatisfy((file) => {\n expect(typeof file.contentType).toBe('string');\n expect(file.contentType).toBe('application/json');\n });\n });\n });\n });\n\n // Note: fromFileApiFiles method was deprecated and removed.\n // The functionality has been replaced by the create() method in FileApiTreeAccessors\n // which uses TreeInitializer[] instead of IFileApiFile[].\n\n describe('getOriginalFile', () => {\n test('retrieves original File object by path', () => {\n const fileList = createMockFileList([\n { name: 'target.txt', content: 'target content', type: 'text/plain' },\n { name: 'other.txt', content: 'other content', type: 'text/plain' }\n ]);\n\n const result = FileTreeHelpers.getOriginalFile(fileList, 'target.txt');\n expect(result).toSucceedAndSatisfy((file) => {\n expect(file.name).toBe('target.txt');\n expect(file.type).toBe('text/plain');\n expect(file.size).toBeGreaterThan(0);\n });\n });\n\n test('handles webkitRelativePath matching', () => {\n const fileList = createMockDirectoryFileList([\n { path: 'folder/subfolder/file.txt', content: 'content', type: 'text/plain' }\n ]);\n\n const result = FileTreeHelpers.getOriginalFile(fileList, 'folder/subfolder/file.txt');\n expect(result).toSucceedAndSatisfy((file) => {\n expect(file.name).toBe('file.txt');\n expect((file as any).webkitRelativePath).toBe('folder/subfolder/file.txt');\n });\n });\n\n test('fails gracefully for non-existent files', () => {\n const fileList = createMockFileList([{ name: 'exists.txt', content: 'content' }]);\n\n const result = FileTreeHelpers.getOriginalFile(fileList, 'missing.txt');\n expect(result).toFailWith(/File not found: missing\\.txt/);\n });\n\n test('handles empty FileList', () => {\n const fileList = createMockFileList([]);\n const result = FileTreeHelpers.getOriginalFile(fileList, 'any.txt');\n expect(result).toFailWith(/File not found/);\n });\n\n test('prioritizes exact name match over webkitRelativePath', () => {\n // Create files with both regular names and webkitRelativePath\n const files = [\n createMockFile({ name: 'file.txt', content: 'regular file' }),\n createMockFile({\n name: 'other.txt',\n content: 'directory file',\n webkitRelativePath: 'file.txt' // Same as first file's name\n })\n ];\n\n const dt = new DataTransfer();\n files.forEach((file) => dt.items.add(file));\n const fileList = dt.files;\n\n const result = FileTreeHelpers.getOriginalFile(fileList, 'file.txt');\n expect(result).toSucceedAndSatisfy((file) => {\n expect(file.name).toBe('file.txt');\n expect(file.size).toBeGreaterThan(0);\n });\n });\n });\n\n describe('extractFileListMetadata', () => {\n test('extracts complete metadata from FileList', () => {\n const testTime = Date.now();\n const fileList = createMockFileList([\n {\n name: 'document.pdf',\n content: 'PDF content here',\n type: 'application/pdf',\n lastModified: testTime\n },\n {\n name: 'image.png',\n content: 'PNG data',\n type: 'image/png',\n lastModified: testTime + 1000\n }\n ]);\n\n const metadata = FileTreeHelpers.extractFileListMetadata(fileList);\n expect(metadata).toHaveLength(2);\n\n const pdfMeta = metadata.find((m) => m.name === 'document.pdf');\n expect(pdfMeta).toEqual({\n path: 'document.pdf',\n name: 'document.pdf',\n size: expect.any(Number),\n type: 'application/pdf',\n lastModified: testTime\n });\n\n const pngMeta = metadata.find((m) => m.name === 'image.png');\n expect(pngMeta).toEqual({\n path: 'image.png',\n name: 'image.png',\n size: expect.any(Number),\n type: 'image/png',\n lastModified: testTime + 1000\n });\n });\n\n test('includes webkitRelativePath in path field', () => {\n const fileList = createMockDirectoryFileList([\n { path: 'project/src/main.js', content: 'main code', type: 'application/javascript' },\n { path: 'project/assets/logo.png', content: 'logo data', type: 'image/png' }\n ]);\n\n const metadata = FileTreeHelpers.extractFileListMetadata(fileList);\n expect(metadata).toHaveLength(2);\n\n expect(metadata.find((m) => m.name === 'main.js')?.path).toBe('project/src/main.js');\n expect(metadata.find((m) => m.name === 'logo.png')?.path).toBe('project/assets/logo.png');\n });\n\n test('handles various file sizes correctly', () => {\n const fileList = createMockFileList([\n { name: 'tiny.txt', content: '' },\n { name: 'small.txt', content: 'small' },\n { name: 'large.txt', content: 'x'.repeat(10000) }\n ]);\n\n const metadata = FileTreeHelpers.extractFileListMetadata(fileList);\n const sizes = metadata.map((m) => m.size);\n\n expect(sizes[0]).toBe(0); // empty file\n expect(sizes[1]).toBeGreaterThan(0); // small file\n expect(sizes[2]).toBeGreaterThan(sizes[1]); // large file\n });\n\n test('returns empty array for empty FileList', () => {\n const fileList = createMockFileList([]);\n const metadata = FileTreeHelpers.extractFileListMetadata(fileList);\n expect(metadata).toEqual([]);\n });\n\n test('preserves file order', () => {\n const expectedOrder = ['first.txt', 'second.txt', 'third.txt'];\n const fileList = createMockFileList(expectedOrder.map((name) => ({ name, content: 'content' })));\n\n const metadata = FileTreeHelpers.extractFileListMetadata(fileList);\n const actualOrder = metadata.map((m) => m.name);\n expect(actualOrder).toEqual(expectedOrder);\n });\n });\n\n describe('extractFileMetadata', () => {\n test('extracts metadata from single file', () => {\n const testTime = Date.now();\n const file = createMockFile({\n name: 'single.txt',\n content: 'single file content',\n type: 'text/plain',\n lastModified: testTime\n });\n\n const metadata = FileTreeHelpers.extractFileMetadata(file);\n expect(metadata).toEqual({\n path: 'single.txt',\n name: 'single.txt',\n size: expect.any(Number),\n type: 'text/plain',\n lastModified: testTime\n });\n });\n\n test('handles webkitRelativePath for single file', () => {\n const file = createMockFile({\n name: 'nested.txt',\n content: 'nested content',\n type: 'text/plain',\n webkitRelativePath: 'folder/nested.txt'\n });\n\n const metadata = FileTreeHelpers.extractFileMetadata(file);\n expect(metadata.path).toBe('folder/nested.txt');\n expect(metadata.name).toBe('nested.txt');\n });\n });\n\n describe('Error propagation', () => {\n test('propagates errors from FileApiTreeAccessors.fromFileList', async () => {\n const badFile = {\n name: 'bad.txt',\n size: 10,\n type: 'text/plain',\n lastModified: Date.now(),\n text: () => Promise.reject(new Error('File system error'))\n } as unknown as File;\n\n // Create a FileList with just the bad file\n const dt = new DataTransfer();\n dt.items.add(badFile);\n const badFileList = dt.files;\n\n const result = await FileTreeHelpers.fromFileList(badFileList);\n expect(result).toFailWith(/Failed to read file/);\n });\n\n test('propagates errors from FileApiTreeAccessors.fromDirectoryUpload', async () => {\n const badFile = {\n name: 'bad.txt',\n size: 10,\n type: 'text/plain',\n lastModified: Date.now(),\n webkitRelativePath: 'folder/bad.txt',\n text: () => Promise.reject(new Error('Directory read error'))\n } as unknown as File;\n\n const dt = new DataTransfer();\n dt.items.add(badFile);\n const fileList = dt.files;\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toFailWith(/Failed to read file/);\n });\n\n test('propagates errors from FileApiTreeAccessors.create via fromFileList', async () => {\n const badFile = {\n name: 'bad.txt',\n size: 10,\n type: 'text/plain',\n lastModified: Date.now(),\n text: () => Promise.reject(new Error('API error'))\n } as unknown as File;\n\n // Create FileList with the bad file\n const dt = new DataTransfer();\n dt.items.add(badFile);\n const fileList = dt.files;\n\n const result = await FileTreeHelpers.fromFileList(fileList);\n expect(result).toFailWith(/Failed to read file/);\n });\n });\n\n describe('Integration scenarios', () => {\n test('handles realistic file upload scenario', async () => {\n const fileList = createMockFileList([\n { name: 'photo1.jpg', content: 'JPEG data 1', type: 'image/jpeg' },\n { name: 'photo2.jpg', content: 'JPEG data 2', type: 'image/jpeg' },\n { name: 'metadata.txt', content: 'Photo metadata', type: 'text/plain' }\n ]);\n\n const result = await FileTreeHelpers.fromFileList(fileList, { prefix: '/uploads' });\n expect(result).toSucceed();\n });\n\n test('handles realistic project upload scenario', async () => {\n const fileList = createMockDirectoryFileList([\n { path: 'my-app/package.json', content: '{\"name\": \"my-app\"}' },\n { path: 'my-app/src/index.js', content: 'console.log(\"Hello\");' },\n { path: 'my-app/src/components/App.jsx', content: 'export default App;' },\n { path: 'my-app/public/index.html', content: '<html></html>' },\n { path: 'my-app/README.md', content: '# My App' }\n ]);\n\n const result = await FileTreeHelpers.fromDirectoryUpload(fileList);\n expect(result).toSucceedAndSatisfy((fileTree) => {\n // Verify complete project structure\n expect(fileTree.getDirectory('/my-app')).toSucceed();\n expect(fileTree.getDirectory('/my-app/src')).toSucceed();\n expect(fileTree.getDirectory('/my-app/src/components')).toSucceed();\n expect(fileTree.getDirectory('/my-app/public')).toSucceed();\n\n // Verify all files\n expect(fileTree.getFile('/my-app/package.json')).toSucceed();\n expect(fileTree.getFile('/my-app/src/index.js')).toSucceed();\n expect(fileTree.getFile('/my-app/src/components/App.jsx')).toSucceed();\n expect(fileTree.getFile('/my-app/public/index.html')).toSucceed();\n expect(fileTree.getFile('/my-app/README.md')).toSucceed();\n\n // Verify content access\n const packageContent = fileTree.hal.getFileContents('/my-app/package.json');\n expect(packageContent).toSucceedWith('{\"name\": \"my-app\"}');\n });\n });\n });\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import '@fgv/ts-utils-jest';
2
+ //# sourceMappingURL=urlParams.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlParams.test.d.ts","sourceRoot":"","sources":["../../../src/test/unit/urlParams.test.ts"],"names":[],"mappings":"AAsBA,OAAO,oBAAoB,CAAC"}
@@ -0,0 +1,395 @@
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
+ require("@fgv/ts-utils-jest");
25
+ const url_utils_1 = require("../../packlets/url-utils");
26
+ // Mock window.location.search for testing
27
+ const mockLocation = {
28
+ search: ''
29
+ };
30
+ Object.defineProperty(window, 'location', {
31
+ value: mockLocation,
32
+ writable: true
33
+ });
34
+ describe('URL Parameters', () => {
35
+ describe('parseUrlParameters', () => {
36
+ beforeEach(() => {
37
+ mockLocation.search = '';
38
+ });
39
+ test('returns empty object for empty URL parameters', () => {
40
+ mockLocation.search = '';
41
+ const result = (0, url_utils_1.parseUrlParameters)();
42
+ expect(result).toEqual({});
43
+ });
44
+ test('parses basic string parameters', () => {
45
+ mockLocation.search = '?input=test.json&config=config.json';
46
+ const result = (0, url_utils_1.parseUrlParameters)();
47
+ expect(result).toEqual({
48
+ input: 'test.json',
49
+ config: 'config.json',
50
+ inputStartDir: '/',
51
+ configStartDir: '/'
52
+ });
53
+ });
54
+ test('parses file paths and sets start directories', () => {
55
+ mockLocation.search = '?input=/path/to/file.json&config=/config/settings.json';
56
+ const result = (0, url_utils_1.parseUrlParameters)();
57
+ expect(result).toEqual({
58
+ input: '/path/to/file.json',
59
+ config: '/config/settings.json',
60
+ inputStartDir: '/path/to',
61
+ configStartDir: '/config'
62
+ });
63
+ });
64
+ test('handles directory paths without setting start directories', () => {
65
+ mockLocation.search = '?input=/path/to/directory&config=/config/folder';
66
+ const result = (0, url_utils_1.parseUrlParameters)();
67
+ expect(result).toEqual({
68
+ input: '/path/to/directory',
69
+ config: '/config/folder'
70
+ });
71
+ });
72
+ test('parses numeric parameters', () => {
73
+ mockLocation.search = '?maxDistance=5';
74
+ const result = (0, url_utils_1.parseUrlParameters)();
75
+ expect(result).toEqual({
76
+ maxDistance: 5
77
+ });
78
+ });
79
+ test('ignores invalid numeric parameters', () => {
80
+ mockLocation.search = '?maxDistance=invalid';
81
+ const result = (0, url_utils_1.parseUrlParameters)();
82
+ expect(result).toEqual({});
83
+ });
84
+ test('parses boolean parameters (true)', () => {
85
+ mockLocation.search = '?reduceQualifiers=true&interactive=true&loadZip=true';
86
+ const result = (0, url_utils_1.parseUrlParameters)();
87
+ expect(result).toEqual({
88
+ reduceQualifiers: true,
89
+ interactive: true,
90
+ loadZip: true
91
+ });
92
+ });
93
+ test('ignores boolean parameters that are not "true"', () => {
94
+ mockLocation.search = '?reduceQualifiers=false&interactive=1&loadZip=yes';
95
+ const result = (0, url_utils_1.parseUrlParameters)();
96
+ expect(result).toEqual({});
97
+ });
98
+ test('parses complex filter parameters', () => {
99
+ mockLocation.search =
100
+ '?contextFilter=lang%3Den%7Cregion%3DUS&qualifierDefaults=lang%3Den,fr%7Cregion%3DUS&resourceTypes=json,string';
101
+ const result = (0, url_utils_1.parseUrlParameters)();
102
+ expect(result).toEqual({
103
+ contextFilter: 'lang=en|region=US',
104
+ qualifierDefaults: 'lang=en,fr|region=US',
105
+ resourceTypes: 'json,string'
106
+ });
107
+ });
108
+ test('parses ZIP loading parameters', () => {
109
+ mockLocation.search = '?loadZip=true&zipPath=/path/to/archive.zip&zipFile=download.zip';
110
+ const result = (0, url_utils_1.parseUrlParameters)();
111
+ expect(result).toEqual({
112
+ loadZip: true,
113
+ zipPath: '/path/to/archive.zip',
114
+ zipFile: 'download.zip'
115
+ });
116
+ });
117
+ test('parses all parameters together', () => {
118
+ mockLocation.search =
119
+ '?input=data.json&config=settings.json&contextFilter=lang%3Den&qualifierDefaults=lang%3Den,fr&resourceTypes=json&maxDistance=3&reduceQualifiers=true&interactive=true&loadZip=true&zipPath=archive.zip&zipFile=download.zip';
120
+ const result = (0, url_utils_1.parseUrlParameters)();
121
+ expect(result).toEqual({
122
+ input: 'data.json',
123
+ config: 'settings.json',
124
+ contextFilter: 'lang=en',
125
+ qualifierDefaults: 'lang=en,fr',
126
+ resourceTypes: 'json',
127
+ maxDistance: 3,
128
+ reduceQualifiers: true,
129
+ interactive: true,
130
+ loadZip: true,
131
+ zipPath: 'archive.zip',
132
+ zipFile: 'download.zip',
133
+ inputStartDir: '/',
134
+ configStartDir: '/'
135
+ });
136
+ });
137
+ test('handles URL encoded parameters', () => {
138
+ mockLocation.search = '?input=test%20file.json&config=config%2Bsettings.json';
139
+ const result = (0, url_utils_1.parseUrlParameters)();
140
+ expect(result).toEqual({
141
+ input: 'test file.json',
142
+ config: 'config+settings.json',
143
+ inputStartDir: '/',
144
+ configStartDir: '/'
145
+ });
146
+ });
147
+ test('handles empty parameter values', () => {
148
+ mockLocation.search = '?input=&config=&maxDistance=';
149
+ const result = (0, url_utils_1.parseUrlParameters)();
150
+ expect(result).toEqual({});
151
+ });
152
+ });
153
+ describe('parseContextFilter', () => {
154
+ test('parses simple key-value pairs', () => {
155
+ const result = (0, url_utils_1.parseContextFilter)('language=en-US|territory=US');
156
+ expect(result).toEqual({
157
+ language: 'en-US',
158
+ territory: 'US'
159
+ });
160
+ });
161
+ test('handles single key-value pair', () => {
162
+ const result = (0, url_utils_1.parseContextFilter)('language=en-US');
163
+ expect(result).toEqual({
164
+ language: 'en-US'
165
+ });
166
+ });
167
+ test('trims whitespace from keys and values', () => {
168
+ const result = (0, url_utils_1.parseContextFilter)(' language = en-US | territory = US ');
169
+ expect(result).toEqual({
170
+ language: 'en-US',
171
+ territory: 'US'
172
+ });
173
+ });
174
+ test('handles empty string', () => {
175
+ const result = (0, url_utils_1.parseContextFilter)('');
176
+ expect(result).toEqual({});
177
+ });
178
+ test('ignores tokens without equals sign', () => {
179
+ const result = (0, url_utils_1.parseContextFilter)('language=en-US|invalidtoken|territory=US');
180
+ expect(result).toEqual({
181
+ language: 'en-US',
182
+ territory: 'US'
183
+ });
184
+ });
185
+ test('ignores tokens with missing key', () => {
186
+ const result = (0, url_utils_1.parseContextFilter)('=en-US|territory=US');
187
+ expect(result).toEqual({
188
+ territory: 'US'
189
+ });
190
+ });
191
+ test('ignores tokens with missing value', () => {
192
+ const result = (0, url_utils_1.parseContextFilter)('language=|territory=US');
193
+ expect(result).toEqual({
194
+ territory: 'US'
195
+ });
196
+ });
197
+ test('handles special characters in values', () => {
198
+ const result = (0, url_utils_1.parseContextFilter)('language=en-US|path=/some/path.json');
199
+ expect(result).toEqual({
200
+ language: 'en-US',
201
+ path: '/some/path.json'
202
+ });
203
+ });
204
+ test('handles complex nested values', () => {
205
+ const result = (0, url_utils_1.parseContextFilter)('filter=a=b,c=d|type=complex');
206
+ expect(result).toEqual({
207
+ filter: 'a',
208
+ type: 'complex'
209
+ });
210
+ });
211
+ });
212
+ describe('parseQualifierDefaults', () => {
213
+ test('parses simple qualifier defaults', () => {
214
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=en-US,en-CA|territory=US');
215
+ expect(result).toEqual({
216
+ language: ['en-US', 'en-CA'],
217
+ territory: ['US']
218
+ });
219
+ });
220
+ test('handles single qualifier with single value', () => {
221
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=en-US');
222
+ expect(result).toEqual({
223
+ language: ['en-US']
224
+ });
225
+ });
226
+ test('handles single qualifier with multiple values', () => {
227
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=en-US,en-CA,fr-CA');
228
+ expect(result).toEqual({
229
+ language: ['en-US', 'en-CA', 'fr-CA']
230
+ });
231
+ });
232
+ test('trims whitespace from keys and values', () => {
233
+ const result = (0, url_utils_1.parseQualifierDefaults)(' language = en-US , en-CA | territory = US ');
234
+ expect(result).toEqual({
235
+ language: ['en-US', 'en-CA'],
236
+ territory: ['US']
237
+ });
238
+ });
239
+ test('handles empty string', () => {
240
+ const result = (0, url_utils_1.parseQualifierDefaults)('');
241
+ expect(result).toEqual({});
242
+ });
243
+ test('ignores tokens without equals sign', () => {
244
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=en-US|invalidtoken|territory=US');
245
+ expect(result).toEqual({
246
+ language: ['en-US'],
247
+ territory: ['US']
248
+ });
249
+ });
250
+ test('ignores tokens with missing key', () => {
251
+ const result = (0, url_utils_1.parseQualifierDefaults)('=en-US,en-CA|territory=US');
252
+ expect(result).toEqual({
253
+ territory: ['US']
254
+ });
255
+ });
256
+ test('ignores tokens with missing value', () => {
257
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=|territory=US');
258
+ expect(result).toEqual({
259
+ territory: ['US']
260
+ });
261
+ });
262
+ test('handles complex qualifier combinations', () => {
263
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=en-US,en-CA,fr-CA|territory=US,CA|currency=USD,CAD');
264
+ expect(result).toEqual({
265
+ language: ['en-US', 'en-CA', 'fr-CA'],
266
+ territory: ['US', 'CA'],
267
+ currency: ['USD', 'CAD']
268
+ });
269
+ });
270
+ test('handles empty values in comma-separated lists', () => {
271
+ const result = (0, url_utils_1.parseQualifierDefaults)('language=en-US,,en-CA|territory=,US,');
272
+ expect(result).toEqual({
273
+ language: ['en-US', '', 'en-CA'],
274
+ territory: ['', 'US', '']
275
+ });
276
+ });
277
+ });
278
+ describe('parseResourceTypes', () => {
279
+ test('parses comma-separated resource types', () => {
280
+ const result = (0, url_utils_1.parseResourceTypes)('json,string');
281
+ expect(result).toEqual(['json', 'string']);
282
+ });
283
+ test('handles single resource type', () => {
284
+ const result = (0, url_utils_1.parseResourceTypes)('json');
285
+ expect(result).toEqual(['json']);
286
+ });
287
+ test('trims whitespace from types', () => {
288
+ const result = (0, url_utils_1.parseResourceTypes)(' json , string , object ');
289
+ expect(result).toEqual(['json', 'string', 'object']);
290
+ });
291
+ test('filters out empty types', () => {
292
+ const result = (0, url_utils_1.parseResourceTypes)('json,,string,');
293
+ expect(result).toEqual(['json', 'string']);
294
+ });
295
+ test('handles empty string', () => {
296
+ const result = (0, url_utils_1.parseResourceTypes)('');
297
+ expect(result).toEqual([]);
298
+ });
299
+ test('handles only commas and whitespace', () => {
300
+ const result = (0, url_utils_1.parseResourceTypes)(' , , ');
301
+ expect(result).toEqual([]);
302
+ });
303
+ test('handles multiple resource types with various spacing', () => {
304
+ const result = (0, url_utils_1.parseResourceTypes)('json, string,object , array, number');
305
+ expect(result).toEqual(['json', 'string', 'object', 'array', 'number']);
306
+ });
307
+ });
308
+ describe('extractDirectoryPath', () => {
309
+ test('extracts directory from file path', () => {
310
+ expect((0, url_utils_1.extractDirectoryPath)('/path/to/file.json')).toBe('/path/to');
311
+ });
312
+ test('returns directory path as-is', () => {
313
+ expect((0, url_utils_1.extractDirectoryPath)('/path/to/directory')).toBe('/path/to/directory');
314
+ });
315
+ test('handles root file path', () => {
316
+ expect((0, url_utils_1.extractDirectoryPath)('/file.json')).toBe('/');
317
+ });
318
+ test('handles root directory', () => {
319
+ expect((0, url_utils_1.extractDirectoryPath)('/')).toBe('/');
320
+ });
321
+ test('handles empty path', () => {
322
+ expect((0, url_utils_1.extractDirectoryPath)('')).toBe('');
323
+ });
324
+ test('handles relative file paths', () => {
325
+ expect((0, url_utils_1.extractDirectoryPath)('file.json')).toBe('/');
326
+ expect((0, url_utils_1.extractDirectoryPath)('dir/file.json')).toBe('dir');
327
+ });
328
+ test('handles relative directory paths', () => {
329
+ expect((0, url_utils_1.extractDirectoryPath)('directory')).toBe('directory');
330
+ expect((0, url_utils_1.extractDirectoryPath)('path/to/directory')).toBe('path/to/directory');
331
+ });
332
+ test('normalizes backslashes to forward slashes', () => {
333
+ expect((0, url_utils_1.extractDirectoryPath)('C:\\path\\to\\file.json')).toBe('C:/path/to');
334
+ expect((0, url_utils_1.extractDirectoryPath)('path\\file.json')).toBe('path');
335
+ });
336
+ test('handles mixed separators', () => {
337
+ expect((0, url_utils_1.extractDirectoryPath)('C:\\path/to\\file.json')).toBe('C:/path/to');
338
+ });
339
+ test('handles hidden files (starting with dot)', () => {
340
+ expect((0, url_utils_1.extractDirectoryPath)('/path/to/.hidden')).toBe('/path/to/.hidden');
341
+ expect((0, url_utils_1.extractDirectoryPath)('.hidden')).toBe('.hidden');
342
+ });
343
+ test('handles files with multiple dots', () => {
344
+ expect((0, url_utils_1.extractDirectoryPath)('/path/to/file.min.js')).toBe('/path/to');
345
+ expect((0, url_utils_1.extractDirectoryPath)('file.backup.json')).toBe('/');
346
+ });
347
+ test('handles directories with dots in name', () => {
348
+ expect((0, url_utils_1.extractDirectoryPath)('/path/to/version.1.0')).toBe('/path/to');
349
+ expect((0, url_utils_1.extractDirectoryPath)('node_modules')).toBe('node_modules');
350
+ });
351
+ });
352
+ describe('isFilePath', () => {
353
+ test('identifies file paths with extensions', () => {
354
+ expect((0, url_utils_1.isFilePath)('file.json')).toBe(true);
355
+ expect((0, url_utils_1.isFilePath)('/path/to/file.json')).toBe(true);
356
+ expect((0, url_utils_1.isFilePath)('C:\\path\\file.txt')).toBe(true);
357
+ });
358
+ test('identifies directory paths without extensions', () => {
359
+ expect((0, url_utils_1.isFilePath)('directory')).toBe(false);
360
+ expect((0, url_utils_1.isFilePath)('/path/to/directory')).toBe(false);
361
+ expect((0, url_utils_1.isFilePath)('C:\\path\\to\\directory')).toBe(false);
362
+ });
363
+ test('handles empty path', () => {
364
+ expect((0, url_utils_1.isFilePath)('')).toBe(false);
365
+ });
366
+ test('handles root path', () => {
367
+ expect((0, url_utils_1.isFilePath)('/')).toBe(false);
368
+ });
369
+ test('handles hidden files and directories', () => {
370
+ expect((0, url_utils_1.isFilePath)('.hidden')).toBe(false);
371
+ expect((0, url_utils_1.isFilePath)('.hiddendir')).toBe(false);
372
+ expect((0, url_utils_1.isFilePath)('/path/.hidden')).toBe(false);
373
+ });
374
+ test('handles files with multiple extensions', () => {
375
+ expect((0, url_utils_1.isFilePath)('file.min.js')).toBe(true);
376
+ expect((0, url_utils_1.isFilePath)('archive.tar.gz')).toBe(true);
377
+ });
378
+ test('handles special file names', () => {
379
+ expect((0, url_utils_1.isFilePath)('Makefile')).toBe(false);
380
+ expect((0, url_utils_1.isFilePath)('README')).toBe(false);
381
+ expect((0, url_utils_1.isFilePath)('package.json')).toBe(true);
382
+ });
383
+ test('handles paths with mixed separators', () => {
384
+ expect((0, url_utils_1.isFilePath)('C:\\path/file.json')).toBe(true);
385
+ expect((0, url_utils_1.isFilePath)('path\\to/directory')).toBe(false);
386
+ });
387
+ test('handles edge cases with dots', () => {
388
+ expect((0, url_utils_1.isFilePath)('.')).toBe(false);
389
+ expect((0, url_utils_1.isFilePath)('..')).toBe(false);
390
+ expect((0, url_utils_1.isFilePath)('/path/.')).toBe(false);
391
+ expect((0, url_utils_1.isFilePath)('/path/..')).toBe(false);
392
+ });
393
+ });
394
+ });
395
+ //# sourceMappingURL=urlParams.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urlParams.test.js","sourceRoot":"","sources":["../../../src/test/unit/urlParams.test.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAEH,8BAA4B;AAC5B,wDAQkC;AAElC,0CAA0C;AAC1C,MAAM,YAAY,GAAG;IACn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AAI,CAAC,KAAK,CAAC,CAAC;YACrC,MAAM,CAAC,IAAA,sBAAU,EAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,CAAC,IAAA,sBAAU,EAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,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 '@fgv/ts-utils-jest';\nimport {\n parseUrlParameters,\n parseContextFilter,\n parseQualifierDefaults,\n parseResourceTypes,\n extractDirectoryPath,\n isFilePath,\n type IUrlConfigOptions\n} from '../../packlets/url-utils';\n\n// Mock window.location.search for testing\nconst mockLocation = {\n search: ''\n};\n\nObject.defineProperty(window, 'location', {\n value: mockLocation,\n writable: true\n});\n\ndescribe('URL Parameters', () => {\n describe('parseUrlParameters', () => {\n beforeEach(() => {\n mockLocation.search = '';\n });\n\n test('returns empty object for empty URL parameters', () => {\n mockLocation.search = '';\n const result = parseUrlParameters();\n expect(result).toEqual({});\n });\n\n test('parses basic string parameters', () => {\n mockLocation.search = '?input=test.json&config=config.json';\n const result = parseUrlParameters();\n expect(result).toEqual({\n input: 'test.json',\n config: 'config.json',\n inputStartDir: '/',\n configStartDir: '/'\n });\n });\n\n test('parses file paths and sets start directories', () => {\n mockLocation.search = '?input=/path/to/file.json&config=/config/settings.json';\n const result = parseUrlParameters();\n expect(result).toEqual({\n input: '/path/to/file.json',\n config: '/config/settings.json',\n inputStartDir: '/path/to',\n configStartDir: '/config'\n });\n });\n\n test('handles directory paths without setting start directories', () => {\n mockLocation.search = '?input=/path/to/directory&config=/config/folder';\n const result = parseUrlParameters();\n expect(result).toEqual({\n input: '/path/to/directory',\n config: '/config/folder'\n });\n });\n\n test('parses numeric parameters', () => {\n mockLocation.search = '?maxDistance=5';\n const result = parseUrlParameters();\n expect(result).toEqual({\n maxDistance: 5\n });\n });\n\n test('ignores invalid numeric parameters', () => {\n mockLocation.search = '?maxDistance=invalid';\n const result = parseUrlParameters();\n expect(result).toEqual({});\n });\n\n test('parses boolean parameters (true)', () => {\n mockLocation.search = '?reduceQualifiers=true&interactive=true&loadZip=true';\n const result = parseUrlParameters();\n expect(result).toEqual({\n reduceQualifiers: true,\n interactive: true,\n loadZip: true\n });\n });\n\n test('ignores boolean parameters that are not \"true\"', () => {\n mockLocation.search = '?reduceQualifiers=false&interactive=1&loadZip=yes';\n const result = parseUrlParameters();\n expect(result).toEqual({});\n });\n\n test('parses complex filter parameters', () => {\n mockLocation.search =\n '?contextFilter=lang%3Den%7Cregion%3DUS&qualifierDefaults=lang%3Den,fr%7Cregion%3DUS&resourceTypes=json,string';\n const result = parseUrlParameters();\n expect(result).toEqual({\n contextFilter: 'lang=en|region=US',\n qualifierDefaults: 'lang=en,fr|region=US',\n resourceTypes: 'json,string'\n });\n });\n\n test('parses ZIP loading parameters', () => {\n mockLocation.search = '?loadZip=true&zipPath=/path/to/archive.zip&zipFile=download.zip';\n const result = parseUrlParameters();\n expect(result).toEqual({\n loadZip: true,\n zipPath: '/path/to/archive.zip',\n zipFile: 'download.zip'\n });\n });\n\n test('parses all parameters together', () => {\n mockLocation.search =\n '?input=data.json&config=settings.json&contextFilter=lang%3Den&qualifierDefaults=lang%3Den,fr&resourceTypes=json&maxDistance=3&reduceQualifiers=true&interactive=true&loadZip=true&zipPath=archive.zip&zipFile=download.zip';\n const result = parseUrlParameters();\n expect(result).toEqual({\n input: 'data.json',\n config: 'settings.json',\n contextFilter: 'lang=en',\n qualifierDefaults: 'lang=en,fr',\n resourceTypes: 'json',\n maxDistance: 3,\n reduceQualifiers: true,\n interactive: true,\n loadZip: true,\n zipPath: 'archive.zip',\n zipFile: 'download.zip',\n inputStartDir: '/',\n configStartDir: '/'\n });\n });\n\n test('handles URL encoded parameters', () => {\n mockLocation.search = '?input=test%20file.json&config=config%2Bsettings.json';\n const result = parseUrlParameters();\n expect(result).toEqual({\n input: 'test file.json',\n config: 'config+settings.json',\n inputStartDir: '/',\n configStartDir: '/'\n });\n });\n\n test('handles empty parameter values', () => {\n mockLocation.search = '?input=&config=&maxDistance=';\n const result = parseUrlParameters();\n expect(result).toEqual({});\n });\n });\n\n describe('parseContextFilter', () => {\n test('parses simple key-value pairs', () => {\n const result = parseContextFilter('language=en-US|territory=US');\n expect(result).toEqual({\n language: 'en-US',\n territory: 'US'\n });\n });\n\n test('handles single key-value pair', () => {\n const result = parseContextFilter('language=en-US');\n expect(result).toEqual({\n language: 'en-US'\n });\n });\n\n test('trims whitespace from keys and values', () => {\n const result = parseContextFilter(' language = en-US | territory = US ');\n expect(result).toEqual({\n language: 'en-US',\n territory: 'US'\n });\n });\n\n test('handles empty string', () => {\n const result = parseContextFilter('');\n expect(result).toEqual({});\n });\n\n test('ignores tokens without equals sign', () => {\n const result = parseContextFilter('language=en-US|invalidtoken|territory=US');\n expect(result).toEqual({\n language: 'en-US',\n territory: 'US'\n });\n });\n\n test('ignores tokens with missing key', () => {\n const result = parseContextFilter('=en-US|territory=US');\n expect(result).toEqual({\n territory: 'US'\n });\n });\n\n test('ignores tokens with missing value', () => {\n const result = parseContextFilter('language=|territory=US');\n expect(result).toEqual({\n territory: 'US'\n });\n });\n\n test('handles special characters in values', () => {\n const result = parseContextFilter('language=en-US|path=/some/path.json');\n expect(result).toEqual({\n language: 'en-US',\n path: '/some/path.json'\n });\n });\n\n test('handles complex nested values', () => {\n const result = parseContextFilter('filter=a=b,c=d|type=complex');\n expect(result).toEqual({\n filter: 'a',\n type: 'complex'\n });\n });\n });\n\n describe('parseQualifierDefaults', () => {\n test('parses simple qualifier defaults', () => {\n const result = parseQualifierDefaults('language=en-US,en-CA|territory=US');\n expect(result).toEqual({\n language: ['en-US', 'en-CA'],\n territory: ['US']\n });\n });\n\n test('handles single qualifier with single value', () => {\n const result = parseQualifierDefaults('language=en-US');\n expect(result).toEqual({\n language: ['en-US']\n });\n });\n\n test('handles single qualifier with multiple values', () => {\n const result = parseQualifierDefaults('language=en-US,en-CA,fr-CA');\n expect(result).toEqual({\n language: ['en-US', 'en-CA', 'fr-CA']\n });\n });\n\n test('trims whitespace from keys and values', () => {\n const result = parseQualifierDefaults(' language = en-US , en-CA | territory = US ');\n expect(result).toEqual({\n language: ['en-US', 'en-CA'],\n territory: ['US']\n });\n });\n\n test('handles empty string', () => {\n const result = parseQualifierDefaults('');\n expect(result).toEqual({});\n });\n\n test('ignores tokens without equals sign', () => {\n const result = parseQualifierDefaults('language=en-US|invalidtoken|territory=US');\n expect(result).toEqual({\n language: ['en-US'],\n territory: ['US']\n });\n });\n\n test('ignores tokens with missing key', () => {\n const result = parseQualifierDefaults('=en-US,en-CA|territory=US');\n expect(result).toEqual({\n territory: ['US']\n });\n });\n\n test('ignores tokens with missing value', () => {\n const result = parseQualifierDefaults('language=|territory=US');\n expect(result).toEqual({\n territory: ['US']\n });\n });\n\n test('handles complex qualifier combinations', () => {\n const result = parseQualifierDefaults('language=en-US,en-CA,fr-CA|territory=US,CA|currency=USD,CAD');\n expect(result).toEqual({\n language: ['en-US', 'en-CA', 'fr-CA'],\n territory: ['US', 'CA'],\n currency: ['USD', 'CAD']\n });\n });\n\n test('handles empty values in comma-separated lists', () => {\n const result = parseQualifierDefaults('language=en-US,,en-CA|territory=,US,');\n expect(result).toEqual({\n language: ['en-US', '', 'en-CA'],\n territory: ['', 'US', '']\n });\n });\n });\n\n describe('parseResourceTypes', () => {\n test('parses comma-separated resource types', () => {\n const result = parseResourceTypes('json,string');\n expect(result).toEqual(['json', 'string']);\n });\n\n test('handles single resource type', () => {\n const result = parseResourceTypes('json');\n expect(result).toEqual(['json']);\n });\n\n test('trims whitespace from types', () => {\n const result = parseResourceTypes(' json , string , object ');\n expect(result).toEqual(['json', 'string', 'object']);\n });\n\n test('filters out empty types', () => {\n const result = parseResourceTypes('json,,string,');\n expect(result).toEqual(['json', 'string']);\n });\n\n test('handles empty string', () => {\n const result = parseResourceTypes('');\n expect(result).toEqual([]);\n });\n\n test('handles only commas and whitespace', () => {\n const result = parseResourceTypes(' , , ');\n expect(result).toEqual([]);\n });\n\n test('handles multiple resource types with various spacing', () => {\n const result = parseResourceTypes('json, string,object , array, number');\n expect(result).toEqual(['json', 'string', 'object', 'array', 'number']);\n });\n });\n\n describe('extractDirectoryPath', () => {\n test('extracts directory from file path', () => {\n expect(extractDirectoryPath('/path/to/file.json')).toBe('/path/to');\n });\n\n test('returns directory path as-is', () => {\n expect(extractDirectoryPath('/path/to/directory')).toBe('/path/to/directory');\n });\n\n test('handles root file path', () => {\n expect(extractDirectoryPath('/file.json')).toBe('/');\n });\n\n test('handles root directory', () => {\n expect(extractDirectoryPath('/')).toBe('/');\n });\n\n test('handles empty path', () => {\n expect(extractDirectoryPath('')).toBe('');\n });\n\n test('handles relative file paths', () => {\n expect(extractDirectoryPath('file.json')).toBe('/');\n expect(extractDirectoryPath('dir/file.json')).toBe('dir');\n });\n\n test('handles relative directory paths', () => {\n expect(extractDirectoryPath('directory')).toBe('directory');\n expect(extractDirectoryPath('path/to/directory')).toBe('path/to/directory');\n });\n\n test('normalizes backslashes to forward slashes', () => {\n expect(extractDirectoryPath('C:\\\\path\\\\to\\\\file.json')).toBe('C:/path/to');\n expect(extractDirectoryPath('path\\\\file.json')).toBe('path');\n });\n\n test('handles mixed separators', () => {\n expect(extractDirectoryPath('C:\\\\path/to\\\\file.json')).toBe('C:/path/to');\n });\n\n test('handles hidden files (starting with dot)', () => {\n expect(extractDirectoryPath('/path/to/.hidden')).toBe('/path/to/.hidden');\n expect(extractDirectoryPath('.hidden')).toBe('.hidden');\n });\n\n test('handles files with multiple dots', () => {\n expect(extractDirectoryPath('/path/to/file.min.js')).toBe('/path/to');\n expect(extractDirectoryPath('file.backup.json')).toBe('/');\n });\n\n test('handles directories with dots in name', () => {\n expect(extractDirectoryPath('/path/to/version.1.0')).toBe('/path/to');\n expect(extractDirectoryPath('node_modules')).toBe('node_modules');\n });\n });\n\n describe('isFilePath', () => {\n test('identifies file paths with extensions', () => {\n expect(isFilePath('file.json')).toBe(true);\n expect(isFilePath('/path/to/file.json')).toBe(true);\n expect(isFilePath('C:\\\\path\\\\file.txt')).toBe(true);\n });\n\n test('identifies directory paths without extensions', () => {\n expect(isFilePath('directory')).toBe(false);\n expect(isFilePath('/path/to/directory')).toBe(false);\n expect(isFilePath('C:\\\\path\\\\to\\\\directory')).toBe(false);\n });\n\n test('handles empty path', () => {\n expect(isFilePath('')).toBe(false);\n });\n\n test('handles root path', () => {\n expect(isFilePath('/')).toBe(false);\n });\n\n test('handles hidden files and directories', () => {\n expect(isFilePath('.hidden')).toBe(false);\n expect(isFilePath('.hiddendir')).toBe(false);\n expect(isFilePath('/path/.hidden')).toBe(false);\n });\n\n test('handles files with multiple extensions', () => {\n expect(isFilePath('file.min.js')).toBe(true);\n expect(isFilePath('archive.tar.gz')).toBe(true);\n });\n\n test('handles special file names', () => {\n expect(isFilePath('Makefile')).toBe(false);\n expect(isFilePath('README')).toBe(false);\n expect(isFilePath('package.json')).toBe(true);\n });\n\n test('handles paths with mixed separators', () => {\n expect(isFilePath('C:\\\\path/file.json')).toBe(true);\n expect(isFilePath('path\\\\to/directory')).toBe(false);\n });\n\n test('handles edge cases with dots', () => {\n expect(isFilePath('.')).toBe(false);\n expect(isFilePath('..')).toBe(false);\n expect(isFilePath('/path/.')).toBe(false);\n expect(isFilePath('/path/..')).toBe(false);\n });\n });\n});\n"]}