@intlayer/chokidar 8.4.4 → 8.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  3. package/dist/cjs/build.cjs +58 -1
  4. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +62 -1
  5. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  6. package/dist/cjs/buildIntlayerDictionary/index.cjs +6 -1
  7. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +26 -1
  8. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  9. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +107 -5
  10. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  11. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +80 -3
  12. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  13. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +46 -1
  14. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  15. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +50 -1
  16. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  17. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +59 -1
  18. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  19. package/dist/cjs/cleanOutputDir.cjs +30 -1
  20. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  21. package/dist/cjs/cleanRemovedContentDeclaration.cjs +97 -1
  22. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  23. package/dist/cjs/cli.cjs +35 -1
  24. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +70 -1
  25. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  26. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +42 -7
  27. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  28. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +23 -1
  29. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  30. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +24 -1
  31. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  32. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +24 -1
  33. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +23 -1
  35. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  36. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +23 -1
  37. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/index.cjs +16 -1
  39. package/dist/cjs/createType/createModuleAugmentation.cjs +112 -9
  40. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  41. package/dist/cjs/createType/createType.cjs +29 -1
  42. package/dist/cjs/createType/createType.cjs.map +1 -1
  43. package/dist/cjs/createType/index.cjs +8 -1
  44. package/dist/cjs/detectFormatCommand.cjs +32 -1
  45. package/dist/cjs/detectFormatCommand.cjs.map +1 -1
  46. package/dist/cjs/fetchDistantDictionaries.cjs +51 -1
  47. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  48. package/dist/cjs/filterInvalidDictionaries.cjs +52 -1
  49. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  50. package/dist/cjs/formatDictionary.cjs +49 -1
  51. package/dist/cjs/formatDictionary.cjs.map +1 -1
  52. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +61 -7
  53. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  54. package/dist/cjs/getContentDeclarationFileTemplate/index.cjs +4 -1
  55. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +34 -1
  56. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  57. package/dist/cjs/handleContentDeclarationFileChange.cjs +49 -1
  58. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  59. package/dist/cjs/handleContentDeclarationFileMoved.cjs +24 -1
  60. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  61. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +37 -1
  62. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  63. package/dist/cjs/init/index.cjs +284 -1
  64. package/dist/cjs/init/index.cjs.map +1 -1
  65. package/dist/cjs/init/utils/configManipulation.cjs +111 -1
  66. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
  67. package/dist/cjs/init/utils/fileSystem.cjs +39 -1
  68. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  69. package/dist/cjs/init/utils/index.cjs +14 -1
  70. package/dist/cjs/init/utils/jsonParser.cjs +42 -3
  71. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  72. package/dist/cjs/init/utils/tsConfig.cjs +18 -1
  73. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  74. package/dist/cjs/initConfig/index.cjs +39 -1
  75. package/dist/cjs/initConfig/index.cjs.map +1 -1
  76. package/dist/cjs/installMCP/installMCP.cjs +50 -1
  77. package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
  78. package/dist/cjs/installSkills/index.cjs +303 -1
  79. package/dist/cjs/installSkills/index.cjs.map +1 -1
  80. package/dist/cjs/listDictionariesPath.cjs +42 -1
  81. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  82. package/dist/cjs/listGitFiles.cjs +105 -5
  83. package/dist/cjs/listGitFiles.cjs.map +1 -1
  84. package/dist/cjs/listProjects.cjs +47 -1
  85. package/dist/cjs/listProjects.cjs.map +1 -1
  86. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +68 -1
  87. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  88. package/dist/cjs/loadDictionaries/index.cjs +14 -1
  89. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +93 -2
  90. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  91. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +127 -1
  92. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  93. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +27 -1
  94. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  95. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +61 -1
  96. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  97. package/dist/cjs/loadDictionaries/log.cjs +138 -3
  98. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +63 -2
  100. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
  101. package/dist/cjs/logConfigDetails.cjs +39 -2
  102. package/dist/cjs/logConfigDetails.cjs.map +1 -1
  103. package/dist/cjs/prepareIntlayer.cjs +103 -1
  104. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  105. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +30 -1
  106. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  107. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +12 -1
  108. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  109. package/dist/cjs/utils/autoDecorateContent.cjs +89 -1
  110. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  111. package/dist/cjs/utils/buildComponentFilesList.cjs +67 -1
  112. package/dist/cjs/utils/buildComponentFilesList.cjs.map +1 -1
  113. package/dist/cjs/utils/buildFilesList.cjs +83 -1
  114. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  115. package/dist/cjs/utils/chunkJSON.cjs +336 -1
  116. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  117. package/dist/cjs/utils/formatter.cjs +18 -1
  118. package/dist/cjs/utils/formatter.cjs.map +1 -1
  119. package/dist/cjs/utils/getChunk.cjs +34 -1
  120. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  121. package/dist/cjs/utils/getContentExtension.cjs +29 -1
  122. package/dist/cjs/utils/getContentExtension.cjs.map +1 -1
  123. package/dist/cjs/utils/getFormatFromExtension.cjs +34 -1
  124. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  125. package/dist/cjs/utils/getPathHash.cjs +10 -1
  126. package/dist/cjs/utils/getPathHash.cjs.map +1 -1
  127. package/dist/cjs/utils/index.cjs +49 -1
  128. package/dist/cjs/utils/mergeChunks.cjs +28 -1
  129. package/dist/cjs/utils/mergeChunks.cjs.map +1 -1
  130. package/dist/cjs/utils/pLimit.cjs +128 -1
  131. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  132. package/dist/cjs/utils/parallelize.cjs +11 -1
  133. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  134. package/dist/cjs/utils/parallelizeGlobal.cjs +29 -1
  135. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  136. package/dist/cjs/utils/reduceObjectFormat.cjs +31 -1
  137. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  138. package/dist/cjs/utils/resolveObjectPromises.cjs +21 -1
  139. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  140. package/dist/cjs/utils/resolveRelativePath.cjs +21 -1
  141. package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -1
  142. package/dist/cjs/utils/runOnce.cjs +95 -1
  143. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  144. package/dist/cjs/utils/runParallel/bin.cjs +54 -1
  145. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  146. package/dist/cjs/utils/runParallel/bootstrap.cjs +24 -1
  147. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  148. package/dist/cjs/utils/runParallel/index.cjs +115 -1
  149. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  150. package/dist/cjs/utils/runParallel/pidTree.cjs +145 -1
  151. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  152. package/dist/cjs/utils/runParallel/ps.cjs +49 -1
  153. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  154. package/dist/cjs/utils/runParallel/runTask.cjs +154 -1
  155. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  156. package/dist/cjs/utils/runParallel/spawnPosix.cjs +59 -1
  157. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  158. package/dist/cjs/utils/runParallel/spawnWin32.cjs +43 -1
  159. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  160. package/dist/cjs/utils/runParallel/wmic.cjs +52 -1
  161. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  162. package/dist/cjs/utils/sortAlphabetically.cjs +7 -1
  163. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  164. package/dist/cjs/utils/splitTextByLine.cjs +11 -1
  165. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  166. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +60 -1
  167. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  168. package/dist/cjs/watcher.cjs +120 -1
  169. package/dist/cjs/watcher.cjs.map +1 -1
  170. package/dist/cjs/writeConfiguration/index.cjs +42 -1
  171. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  172. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +28 -1
  173. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  174. package/dist/cjs/writeContentDeclaration/index.cjs +10 -1
  175. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +94 -1
  176. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  177. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +412 -3
  178. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +127 -2
  180. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  181. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +148 -1
  182. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  183. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +92 -1
  184. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  185. package/dist/cjs/writeFileIfChanged.cjs +50 -1
  186. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  187. package/dist/cjs/writeJsonIfChanged.cjs +17 -1
  188. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  189. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  190. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  191. package/dist/esm/build.mjs +25 -1
  192. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +60 -1
  193. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  194. package/dist/esm/buildIntlayerDictionary/index.mjs +4 -1
  195. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +24 -1
  196. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  197. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +102 -5
  198. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  199. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +76 -3
  200. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  201. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +44 -1
  202. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  203. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +48 -1
  204. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  205. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +56 -1
  206. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  207. package/dist/esm/cleanOutputDir.mjs +28 -1
  208. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  209. package/dist/esm/cleanRemovedContentDeclaration.mjs +94 -1
  210. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
  211. package/dist/esm/cli.mjs +15 -1
  212. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +68 -1
  213. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  214. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +40 -7
  215. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  216. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +20 -1
  217. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  218. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +21 -1
  219. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  220. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +21 -1
  221. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  222. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +20 -1
  223. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  224. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +20 -1
  225. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  226. package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -1
  227. package/dist/esm/createType/createModuleAugmentation.mjs +108 -9
  228. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  229. package/dist/esm/createType/createType.mjs +26 -1
  230. package/dist/esm/createType/createType.mjs.map +1 -1
  231. package/dist/esm/createType/index.mjs +4 -1
  232. package/dist/esm/detectFormatCommand.mjs +30 -1
  233. package/dist/esm/detectFormatCommand.mjs.map +1 -1
  234. package/dist/esm/fetchDistantDictionaries.mjs +49 -1
  235. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  236. package/dist/esm/filterInvalidDictionaries.mjs +48 -1
  237. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  238. package/dist/esm/formatDictionary.mjs +44 -1
  239. package/dist/esm/formatDictionary.mjs.map +1 -1
  240. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +59 -7
  241. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  242. package/dist/esm/getContentDeclarationFileTemplate/index.mjs +3 -1
  243. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +32 -1
  244. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  245. package/dist/esm/handleContentDeclarationFileChange.mjs +47 -1
  246. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  247. package/dist/esm/handleContentDeclarationFileMoved.mjs +22 -1
  248. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
  249. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +35 -1
  250. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
  251. package/dist/esm/init/index.mjs +281 -1
  252. package/dist/esm/init/index.mjs.map +1 -1
  253. package/dist/esm/init/utils/configManipulation.mjs +108 -1
  254. package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
  255. package/dist/esm/init/utils/fileSystem.mjs +34 -1
  256. package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
  257. package/dist/esm/init/utils/index.mjs +6 -1
  258. package/dist/esm/init/utils/jsonParser.mjs +40 -3
  259. package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
  260. package/dist/esm/init/utils/tsConfig.mjs +16 -1
  261. package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
  262. package/dist/esm/initConfig/index.mjs +37 -1
  263. package/dist/esm/initConfig/index.mjs.map +1 -1
  264. package/dist/esm/installMCP/installMCP.mjs +46 -1
  265. package/dist/esm/installMCP/installMCP.mjs.map +1 -1
  266. package/dist/esm/installSkills/index.mjs +295 -1
  267. package/dist/esm/installSkills/index.mjs.map +1 -1
  268. package/dist/esm/listDictionariesPath.mjs +38 -1
  269. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  270. package/dist/esm/listGitFiles.mjs +100 -5
  271. package/dist/esm/listGitFiles.mjs.map +1 -1
  272. package/dist/esm/listProjects.mjs +43 -1
  273. package/dist/esm/listProjects.mjs.map +1 -1
  274. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +67 -1
  275. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
  276. package/dist/esm/loadDictionaries/index.mjs +6 -1
  277. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +88 -2
  278. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  279. package/dist/esm/loadDictionaries/loadDictionaries.mjs +124 -1
  280. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  281. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +25 -1
  282. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  283. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +58 -1
  284. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  285. package/dist/esm/loadDictionaries/log.mjs +134 -3
  286. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  287. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +61 -2
  288. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
  289. package/dist/esm/logConfigDetails.mjs +36 -2
  290. package/dist/esm/logConfigDetails.mjs.map +1 -1
  291. package/dist/esm/prepareIntlayer.mjs +99 -1
  292. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  293. package/dist/esm/reduceDictionaryContent/applyMask.mjs +28 -1
  294. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  295. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +10 -1
  296. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  297. package/dist/esm/utils/autoDecorateContent.mjs +86 -1
  298. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
  299. package/dist/esm/utils/buildComponentFilesList.mjs +64 -1
  300. package/dist/esm/utils/buildComponentFilesList.mjs.map +1 -1
  301. package/dist/esm/utils/buildFilesList.mjs +79 -1
  302. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  303. package/dist/esm/utils/chunkJSON.mjs +333 -1
  304. package/dist/esm/utils/chunkJSON.mjs.map +1 -1
  305. package/dist/esm/utils/formatter.mjs +13 -1
  306. package/dist/esm/utils/formatter.mjs.map +1 -1
  307. package/dist/esm/utils/getChunk.mjs +33 -1
  308. package/dist/esm/utils/getChunk.mjs.map +1 -1
  309. package/dist/esm/utils/getContentExtension.mjs +27 -1
  310. package/dist/esm/utils/getContentExtension.mjs.map +1 -1
  311. package/dist/esm/utils/getFormatFromExtension.mjs +31 -1
  312. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  313. package/dist/esm/utils/getPathHash.mjs +7 -1
  314. package/dist/esm/utils/getPathHash.mjs.map +1 -1
  315. package/dist/esm/utils/index.mjs +22 -1
  316. package/dist/esm/utils/mergeChunks.mjs +26 -1
  317. package/dist/esm/utils/mergeChunks.mjs.map +1 -1
  318. package/dist/esm/utils/pLimit.mjs +125 -1
  319. package/dist/esm/utils/pLimit.mjs.map +1 -1
  320. package/dist/esm/utils/parallelize.mjs +10 -1
  321. package/dist/esm/utils/parallelize.mjs.map +1 -1
  322. package/dist/esm/utils/parallelizeGlobal.mjs +26 -1
  323. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
  324. package/dist/esm/utils/reduceObjectFormat.mjs +29 -1
  325. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
  326. package/dist/esm/utils/resolveObjectPromises.mjs +19 -1
  327. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  328. package/dist/esm/utils/resolveRelativePath.mjs +19 -1
  329. package/dist/esm/utils/resolveRelativePath.mjs.map +1 -1
  330. package/dist/esm/utils/runOnce.mjs +92 -1
  331. package/dist/esm/utils/runOnce.mjs.map +1 -1
  332. package/dist/esm/utils/runParallel/bin.mjs +52 -1
  333. package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
  334. package/dist/esm/utils/runParallel/bootstrap.mjs +22 -1
  335. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
  336. package/dist/esm/utils/runParallel/index.mjs +113 -1
  337. package/dist/esm/utils/runParallel/index.mjs.map +1 -1
  338. package/dist/esm/utils/runParallel/pidTree.mjs +142 -1
  339. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
  340. package/dist/esm/utils/runParallel/ps.mjs +46 -1
  341. package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
  342. package/dist/esm/utils/runParallel/runTask.mjs +152 -1
  343. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
  344. package/dist/esm/utils/runParallel/spawnPosix.mjs +57 -1
  345. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
  346. package/dist/esm/utils/runParallel/spawnWin32.mjs +41 -1
  347. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
  348. package/dist/esm/utils/runParallel/wmic.mjs +49 -1
  349. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
  350. package/dist/esm/utils/sortAlphabetically.mjs +5 -1
  351. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  352. package/dist/esm/utils/splitTextByLine.mjs +9 -1
  353. package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
  354. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +58 -1
  355. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
  356. package/dist/esm/watcher.mjs +117 -1
  357. package/dist/esm/watcher.mjs.map +1 -1
  358. package/dist/esm/writeConfiguration/index.mjs +39 -1
  359. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  360. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +26 -1
  361. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  362. package/dist/esm/writeContentDeclaration/index.mjs +6 -1
  363. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +91 -1
  364. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  365. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +407 -3
  366. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  367. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +124 -2
  368. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
  369. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +146 -1
  370. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  371. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +90 -1
  372. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  373. package/dist/esm/writeFileIfChanged.mjs +48 -1
  374. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  375. package/dist/esm/writeJsonIfChanged.mjs +16 -1
  376. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  377. package/dist/types/build.d.ts +20 -20
  378. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +25 -2
  379. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
  380. package/dist/types/buildIntlayerDictionary/index.d.ts +2 -2
  381. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +11 -2
  382. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
  383. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +49 -2
  384. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
  385. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +1 -1
  386. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  387. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +30 -2
  388. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
  389. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +34 -2
  390. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
  391. package/dist/types/cli.d.ts +6 -6
  392. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +14 -2
  393. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
  394. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +10 -2
  395. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
  396. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +10 -2
  397. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
  398. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +10 -2
  399. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
  400. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +10 -2
  401. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  402. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +10 -2
  403. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  404. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +10 -2
  405. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  406. package/dist/types/createDictionaryEntryPoint/index.d.ts +7 -7
  407. package/dist/types/createType/createModuleAugmentation.d.ts +9 -2
  408. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
  409. package/dist/types/createType/createType.d.ts +12 -2
  410. package/dist/types/createType/createType.d.ts.map +1 -0
  411. package/dist/types/createType/index.d.ts +2 -2
  412. package/dist/types/fetchDistantDictionaries.d.ts +1 -1
  413. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  414. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +7 -2
  415. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
  416. package/dist/types/getContentDeclarationFileTemplate/index.d.ts +1 -1
  417. package/dist/types/loadDictionaries/index.d.ts +4 -4
  418. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +12 -2
  419. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
  420. package/dist/types/loadDictionaries/loadDictionaries.d.ts +23 -2
  421. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
  422. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +8 -2
  423. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
  424. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +15 -2
  425. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
  426. package/dist/types/loadDictionaries/log.d.ts +1 -1
  427. package/dist/types/utils/getFormatFromExtension.d.ts +8 -2
  428. package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -0
  429. package/dist/types/utils/index.d.ts +1 -1
  430. package/dist/types/writeConfiguration/index.d.ts.map +1 -1
  431. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +12 -2
  432. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -0
  433. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +5 -2
  434. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
  435. package/dist/types/writeContentDeclaration/index.d.ts +5 -5
  436. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
  437. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +11 -2
  438. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
  439. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +19 -2
  440. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -0
  441. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +14 -2
  442. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
  443. package/package.json +8 -8
  444. package/dist/cjs/_utils_asset-SJVy1xMD.cjs +0 -2
  445. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  446. package/dist/esm/_utils_asset-4w8dPH9r.mjs +0 -2
  447. package/dist/esm/chunk-DDgYwkfe.mjs +0 -1
  448. package/dist/types/buildIntlayerDictionary-C-LWgPIL.d.ts +0 -25
  449. package/dist/types/buildIntlayerDictionary-C-LWgPIL.d.ts.map +0 -1
  450. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts +0 -14
  451. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts.map +0 -1
  452. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts +0 -9
  453. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts.map +0 -1
  454. package/dist/types/createType--rDwdg2t.d.ts +0 -12
  455. package/dist/types/createType--rDwdg2t.d.ts.map +0 -1
  456. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts +0 -12
  457. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts.map +0 -1
  458. package/dist/types/dictionaryStatus-DPVO37qe.d.ts +0 -5
  459. package/dist/types/dictionaryStatus-DPVO37qe.d.ts.map +0 -1
  460. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts +0 -10
  461. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts.map +0 -1
  462. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts +0 -10
  463. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts.map +0 -1
  464. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts +0 -10
  465. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts.map +0 -1
  466. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts +0 -10
  467. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts.map +0 -1
  468. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts +0 -10
  469. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts.map +0 -1
  470. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts +0 -10
  471. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts.map +0 -1
  472. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts +0 -7
  473. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts.map +0 -1
  474. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts +0 -8
  475. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts.map +0 -1
  476. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts +0 -12
  477. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts.map +0 -1
  478. package/dist/types/loadDictionaries-BIqHwtYE.d.ts +0 -23
  479. package/dist/types/loadDictionaries-BIqHwtYE.d.ts.map +0 -1
  480. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts +0 -8
  481. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts.map +0 -1
  482. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts +0 -15
  483. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts.map +0 -1
  484. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts +0 -11
  485. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts.map +0 -1
  486. package/dist/types/transformJSFile-Cg0LkeLb.d.ts +0 -11
  487. package/dist/types/transformJSFile-Cg0LkeLb.d.ts.map +0 -1
  488. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts +0 -19
  489. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts.map +0 -1
  490. package/dist/types/writeDynamicDictionary-BE0mF2zZ.d.ts +0 -49
  491. package/dist/types/writeDynamicDictionary-BE0mF2zZ.d.ts.map +0 -1
  492. package/dist/types/writeJSFile-kK95jzg_.d.ts +0 -14
  493. package/dist/types/writeJSFile-kK95jzg_.d.ts.map +0 -1
  494. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts +0 -30
  495. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts.map +0 -1
  496. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts +0 -34
  497. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts.map +0 -1
@@ -1,2 +1,35 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>{switch(e){case`.ts`:case`.tsx`:return`ts`;case`.cjs`:case`.cjsx`:return`cjs`;case`.js`:case`.jsx`:case`.mjs`:case`.mjsx`:return`esm`;case`.json`:case`.jsonc`:case`.json5`:return`json`}return`ts`},t=e=>{switch(e){case`ts`:return`.ts`;case`cjs`:return`.cjs`;case`json`:return`.json`;case`jsonc`:return`.jsonc`;case`json5`:return`.json5`;case`esm`:return`.mjs`}return`.ts`};exports.getExtensionFromFormat=t,exports.getFormatFromExtension=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/getFormatFromExtension.ts
4
+ const getFormatFromExtension = (extension) => {
5
+ switch (extension) {
6
+ case ".ts":
7
+ case ".tsx": return "ts";
8
+ case ".cjs":
9
+ case ".cjsx": return "cjs";
10
+ case ".js":
11
+ case ".jsx":
12
+ case ".mjs":
13
+ case ".mjsx": return "esm";
14
+ case ".json":
15
+ case ".jsonc":
16
+ case ".json5": return "json";
17
+ }
18
+ return "ts";
19
+ };
20
+ const getExtensionFromFormat = (format) => {
21
+ switch (format) {
22
+ case "ts": return ".ts";
23
+ case "cjs": return ".cjs";
24
+ case "json": return ".json";
25
+ case "jsonc": return ".jsonc";
26
+ case "json5": return ".json5";
27
+ case "esm": return ".mjs";
28
+ }
29
+ return ".ts";
30
+ };
31
+
32
+ //#endregion
33
+ exports.getExtensionFromFormat = getExtensionFromFormat;
34
+ exports.getFormatFromExtension = getFormatFromExtension;
2
35
  //# sourceMappingURL=getFormatFromExtension.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFormatFromExtension.cjs","names":[],"sources":["../../../src/utils/getFormatFromExtension.ts"],"sourcesContent":["export type Format = 'ts' | 'cjs' | 'esm' | 'json' | 'jsonc' | 'json5';\nexport type Extension =\n | '.ts'\n | '.tsx'\n | '.js'\n | '.jsx'\n | '.cjs'\n | '.cjsx'\n | '.mjs'\n | '.mjsx'\n | '.json'\n | '.jsonc'\n | '.json5';\n\nexport const getFormatFromExtension = (\n extension: Extension | (string & {})\n): Format => {\n switch (extension) {\n case '.ts':\n case '.tsx':\n return 'ts';\n case '.cjs':\n case '.cjsx':\n return 'cjs';\n case '.js':\n case '.jsx':\n case '.mjs':\n case '.mjsx':\n return 'esm';\n case '.json':\n case '.jsonc':\n case '.json5':\n return 'json';\n }\n\n return 'ts';\n};\n\nexport const getExtensionFromFormat = (\n format: Format | (string & {})\n): Extension => {\n switch (format) {\n case 'ts':\n return '.ts';\n case 'cjs':\n return '.cjs';\n case 'json':\n return '.json';\n case 'jsonc':\n return '.jsonc';\n case 'json5':\n return '.json5';\n case 'esm':\n return '.mjs';\n }\n\n return '.ts';\n};\n"],"mappings":"mEAcA,MAAa,EACX,GACW,CACX,OAAQ,EAAR,CACE,IAAK,MACL,IAAK,OACH,MAAO,KACT,IAAK,OACL,IAAK,QACH,MAAO,MACT,IAAK,MACL,IAAK,OACL,IAAK,OACL,IAAK,QACH,MAAO,MACT,IAAK,QACL,IAAK,SACL,IAAK,SACH,MAAO,OAGX,MAAO,MAGI,EACX,GACc,CACd,OAAQ,EAAR,CACE,IAAK,KACH,MAAO,MACT,IAAK,MACH,MAAO,OACT,IAAK,OACH,MAAO,QACT,IAAK,QACH,MAAO,SACT,IAAK,QACH,MAAO,SACT,IAAK,MACH,MAAO,OAGX,MAAO"}
1
+ {"version":3,"file":"getFormatFromExtension.cjs","names":[],"sources":["../../../src/utils/getFormatFromExtension.ts"],"sourcesContent":["export type Format = 'ts' | 'cjs' | 'esm' | 'json' | 'jsonc' | 'json5';\nexport type Extension =\n | '.ts'\n | '.tsx'\n | '.js'\n | '.jsx'\n | '.cjs'\n | '.cjsx'\n | '.mjs'\n | '.mjsx'\n | '.json'\n | '.jsonc'\n | '.json5';\n\nexport const getFormatFromExtension = (\n extension: Extension | (string & {})\n): Format => {\n switch (extension) {\n case '.ts':\n case '.tsx':\n return 'ts';\n case '.cjs':\n case '.cjsx':\n return 'cjs';\n case '.js':\n case '.jsx':\n case '.mjs':\n case '.mjsx':\n return 'esm';\n case '.json':\n case '.jsonc':\n case '.json5':\n return 'json';\n }\n\n return 'ts';\n};\n\nexport const getExtensionFromFormat = (\n format: Format | (string & {})\n): Extension => {\n switch (format) {\n case 'ts':\n return '.ts';\n case 'cjs':\n return '.cjs';\n case 'json':\n return '.json';\n case 'jsonc':\n return '.jsonc';\n case 'json5':\n return '.json5';\n case 'esm':\n return '.mjs';\n }\n\n return '.ts';\n};\n"],"mappings":";;;AAcA,MAAa,0BACX,cACW;AACX,SAAQ,WAAR;EACE,KAAK;EACL,KAAK,OACH,QAAO;EACT,KAAK;EACL,KAAK,QACH,QAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,QACH,QAAO;EACT,KAAK;EACL,KAAK;EACL,KAAK,SACH,QAAO;;AAGX,QAAO;;AAGT,MAAa,0BACX,WACc;AACd,SAAQ,QAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,KAAK,MACH,QAAO;;AAGX,QAAO"}
@@ -1,2 +1,11 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`node:crypto`);t=e.t(t);const n=e=>t.default.createHash(`sha3-256`).update(e).digest(`base64`).replace(/[^A-Z\d]/gi,``).substring(0,20);exports.getPathHash=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let node_crypto = require("node:crypto");
4
+ node_crypto = require_runtime.__toESM(node_crypto);
5
+
6
+ //#region src/utils/getPathHash.ts
7
+ const getPathHash = (filePath) => node_crypto.default.createHash("sha3-256").update(filePath).digest("base64").replace(/[^A-Z\d]/gi, "").substring(0, 20);
8
+
9
+ //#endregion
10
+ exports.getPathHash = getPathHash;
2
11
  //# sourceMappingURL=getPathHash.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPathHash.cjs","names":["crypto"],"sources":["../../../src/utils/getPathHash.ts"],"sourcesContent":["import crypto from 'node:crypto';\n\nexport const getPathHash = (filePath: string) =>\n crypto\n .createHash('sha3-256')\n .update(filePath)\n .digest('base64')\n .replace(/[^A-Z\\d]/gi, '')\n .substring(0, 20);\n"],"mappings":"kJAEA,MAAa,EAAe,GAC1BA,EAAAA,QACG,WAAW,WAAW,CACtB,OAAO,EAAS,CAChB,OAAO,SAAS,CAChB,QAAQ,aAAc,GAAG,CACzB,UAAU,EAAG,GAAG"}
1
+ {"version":3,"file":"getPathHash.cjs","names":["crypto"],"sources":["../../../src/utils/getPathHash.ts"],"sourcesContent":["import crypto from 'node:crypto';\n\nexport const getPathHash = (filePath: string) =>\n crypto\n .createHash('sha3-256')\n .update(filePath)\n .digest('base64')\n .replace(/[^A-Z\\d]/gi, '')\n .substring(0, 20);\n"],"mappings":";;;;;;AAEA,MAAa,eAAe,aAC1BA,oBACG,WAAW,WAAW,CACtB,OAAO,SAAS,CAChB,OAAO,SAAS,CAChB,QAAQ,cAAc,GAAG,CACzB,UAAU,GAAG,GAAG"}
@@ -1 +1,49 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./pLimit.cjs`),t=require(`./parallelize.cjs`),n=require(`./getPathHash.cjs`),r=require(`./formatter.cjs`),i=require(`./autoDecorateContent.cjs`),a=require(`./buildComponentFilesList.cjs`),o=require(`./splitTextByLine.cjs`),s=require(`./getChunk.cjs`),c=require(`./chunkJSON.cjs`),l=require(`./getContentExtension.cjs`),u=require(`./getFormatFromExtension.cjs`),d=require(`./mergeChunks.cjs`),f=require(`./parallelizeGlobal.cjs`),p=require(`./reduceObjectFormat.cjs`),m=require(`./resolveObjectPromises.cjs`),h=require(`./resolveRelativePath.cjs`),g=require(`./runOnce.cjs`),_=require(`./runParallel/index.cjs`),v=require(`./sortAlphabetically.cjs`),y=require(`./verifyIdenticObjectFormat.cjs`);exports.Queue=e.Queue,exports.assembleJSON=c.assembleJSON,exports.autoDecorateContent=i.autoDecorateContent,exports.buildComponentFilesList=a.buildComponentFilesList,exports.chunkJSON=c.chunkJSON,exports.formatLocale=r.formatLocale,exports.formatPath=r.formatPath,exports.getChunk=s.getChunk,exports.getContentExtension=l.getContentExtension,exports.getExtensionFromFormat=u.getExtensionFromFormat,exports.getFormatFromExtension=u.getFormatFromExtension,exports.getGlobalLimiter=f.getGlobalLimiter,exports.getPathHash=n.getPathHash,exports.getTaskLimiter=f.getTaskLimiter,exports.mergeChunks=d.mergeChunks,exports.pLimit=e.pLimit,exports.parallelize=t.parallelize,exports.parallelizeGlobal=f.parallelizeGlobal,exports.reconstructFromSingleChunk=c.reconstructFromSingleChunk,exports.reduceObjectFormat=p.reduceObjectFormat,exports.resolveObjectPromises=m.resolveObjectPromises,exports.resolveRelativePath=h.resolveRelativePath,exports.runOnce=g.runOnce,exports.runParallel=_.runParallel,exports.sortAlphabetically=v.sortAlphabetically,exports.splitTextByLines=o.splitTextByLines,exports.verifyIdenticObjectFormat=y.verifyIdenticObjectFormat;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_pLimit = require('./pLimit.cjs');
3
+ const require_utils_parallelize = require('./parallelize.cjs');
4
+ const require_utils_getPathHash = require('./getPathHash.cjs');
5
+ const require_utils_formatter = require('./formatter.cjs');
6
+ const require_utils_autoDecorateContent = require('./autoDecorateContent.cjs');
7
+ const require_utils_buildComponentFilesList = require('./buildComponentFilesList.cjs');
8
+ const require_utils_splitTextByLine = require('./splitTextByLine.cjs');
9
+ const require_utils_getChunk = require('./getChunk.cjs');
10
+ const require_utils_chunkJSON = require('./chunkJSON.cjs');
11
+ const require_utils_getContentExtension = require('./getContentExtension.cjs');
12
+ const require_utils_getFormatFromExtension = require('./getFormatFromExtension.cjs');
13
+ const require_utils_mergeChunks = require('./mergeChunks.cjs');
14
+ const require_utils_parallelizeGlobal = require('./parallelizeGlobal.cjs');
15
+ const require_utils_reduceObjectFormat = require('./reduceObjectFormat.cjs');
16
+ const require_utils_resolveObjectPromises = require('./resolveObjectPromises.cjs');
17
+ const require_utils_resolveRelativePath = require('./resolveRelativePath.cjs');
18
+ const require_utils_runOnce = require('./runOnce.cjs');
19
+ const require_utils_runParallel_index = require('./runParallel/index.cjs');
20
+ const require_utils_sortAlphabetically = require('./sortAlphabetically.cjs');
21
+ const require_utils_verifyIdenticObjectFormat = require('./verifyIdenticObjectFormat.cjs');
22
+
23
+ exports.Queue = require_utils_pLimit.Queue;
24
+ exports.assembleJSON = require_utils_chunkJSON.assembleJSON;
25
+ exports.autoDecorateContent = require_utils_autoDecorateContent.autoDecorateContent;
26
+ exports.buildComponentFilesList = require_utils_buildComponentFilesList.buildComponentFilesList;
27
+ exports.chunkJSON = require_utils_chunkJSON.chunkJSON;
28
+ exports.formatLocale = require_utils_formatter.formatLocale;
29
+ exports.formatPath = require_utils_formatter.formatPath;
30
+ exports.getChunk = require_utils_getChunk.getChunk;
31
+ exports.getContentExtension = require_utils_getContentExtension.getContentExtension;
32
+ exports.getExtensionFromFormat = require_utils_getFormatFromExtension.getExtensionFromFormat;
33
+ exports.getFormatFromExtension = require_utils_getFormatFromExtension.getFormatFromExtension;
34
+ exports.getGlobalLimiter = require_utils_parallelizeGlobal.getGlobalLimiter;
35
+ exports.getPathHash = require_utils_getPathHash.getPathHash;
36
+ exports.getTaskLimiter = require_utils_parallelizeGlobal.getTaskLimiter;
37
+ exports.mergeChunks = require_utils_mergeChunks.mergeChunks;
38
+ exports.pLimit = require_utils_pLimit.pLimit;
39
+ exports.parallelize = require_utils_parallelize.parallelize;
40
+ exports.parallelizeGlobal = require_utils_parallelizeGlobal.parallelizeGlobal;
41
+ exports.reconstructFromSingleChunk = require_utils_chunkJSON.reconstructFromSingleChunk;
42
+ exports.reduceObjectFormat = require_utils_reduceObjectFormat.reduceObjectFormat;
43
+ exports.resolveObjectPromises = require_utils_resolveObjectPromises.resolveObjectPromises;
44
+ exports.resolveRelativePath = require_utils_resolveRelativePath.resolveRelativePath;
45
+ exports.runOnce = require_utils_runOnce.runOnce;
46
+ exports.runParallel = require_utils_runParallel_index.runParallel;
47
+ exports.sortAlphabetically = require_utils_sortAlphabetically.sortAlphabetically;
48
+ exports.splitTextByLines = require_utils_splitTextByLine.splitTextByLines;
49
+ exports.verifyIdenticObjectFormat = require_utils_verifyIdenticObjectFormat.verifyIdenticObjectFormat;
@@ -1,2 +1,29 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>{if(e.length===0)return{};let n=e[0];for(let r=1;r<e.length;r++)n=t(n,e[r]);return n},t=(e,n)=>{if(e==null)return n;if(n==null)return e;if(Array.isArray(e)&&Array.isArray(n)){let r=Math.max(e.length,n.length),i=[];for(let a=0;a<r;a++)i[a]=t(e[a],n[a]);return i}if(typeof e==`object`&&typeof n==`object`){let r={...e};for(let e of Object.keys(n))r[e]=t(r[e],n[e]);return r}return e};exports.mergeChunks=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/mergeChunks.ts
4
+ const mergeChunks = (chunks) => {
5
+ if (chunks.length === 0) return {};
6
+ let result = chunks[0];
7
+ for (let i = 1; i < chunks.length; i++) result = customChunkMerge(result, chunks[i]);
8
+ return result;
9
+ };
10
+ const customChunkMerge = (dest, source) => {
11
+ if (dest === void 0 || dest === null) return source;
12
+ if (source === void 0 || source === null) return dest;
13
+ if (Array.isArray(dest) && Array.isArray(source)) {
14
+ const maxLength = Math.max(dest.length, source.length);
15
+ const result = [];
16
+ for (let i = 0; i < maxLength; i++) result[i] = customChunkMerge(dest[i], source[i]);
17
+ return result;
18
+ }
19
+ if (typeof dest === "object" && typeof source === "object") {
20
+ const result = { ...dest };
21
+ for (const key of Object.keys(source)) result[key] = customChunkMerge(result[key], source[key]);
22
+ return result;
23
+ }
24
+ return dest;
25
+ };
26
+
27
+ //#endregion
28
+ exports.mergeChunks = mergeChunks;
2
29
  //# sourceMappingURL=mergeChunks.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeChunks.cjs","names":[],"sources":["../../../src/utils/mergeChunks.ts"],"sourcesContent":["export const mergeChunks = (chunks: any[]): any => {\n if (chunks.length === 0) return {};\n\n let result = chunks[0];\n\n for (let i = 1; i < chunks.length; i++) {\n result = customChunkMerge(result, chunks[i]);\n }\n\n return result;\n};\n\nconst customChunkMerge = (dest: any, source: any): any => {\n if (dest === undefined || dest === null) return source;\n if (source === undefined || source === null) return dest;\n\n if (Array.isArray(dest) && Array.isArray(source)) {\n const maxLength = Math.max(dest.length, source.length);\n const result = [];\n for (let i = 0; i < maxLength; i++) {\n result[i] = customChunkMerge(dest[i], source[i]);\n }\n return result;\n }\n\n if (typeof dest === 'object' && typeof source === 'object') {\n const result: any = { ...dest };\n for (const key of Object.keys(source)) {\n result[key] = customChunkMerge(result[key], source[key]);\n }\n return result;\n }\n\n // Primitives: if we are here, both are not null.\n // Since chunks shouldn't overlap, we can return dest.\n return dest;\n};\n"],"mappings":"mEAAA,MAAa,EAAe,GAAuB,CACjD,GAAI,EAAO,SAAW,EAAG,MAAO,EAAE,CAElC,IAAI,EAAS,EAAO,GAEpB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IACjC,EAAS,EAAiB,EAAQ,EAAO,GAAG,CAG9C,OAAO,GAGH,GAAoB,EAAW,IAAqB,CACxD,GAAI,GAA+B,KAAM,OAAO,EAChD,GAAI,GAAmC,KAAM,OAAO,EAEpD,GAAI,MAAM,QAAQ,EAAK,EAAI,MAAM,QAAQ,EAAO,CAAE,CAChD,IAAM,EAAY,KAAK,IAAI,EAAK,OAAQ,EAAO,OAAO,CAChD,EAAS,EAAE,CACjB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAW,IAC7B,EAAO,GAAK,EAAiB,EAAK,GAAI,EAAO,GAAG,CAElD,OAAO,EAGT,GAAI,OAAO,GAAS,UAAY,OAAO,GAAW,SAAU,CAC1D,IAAM,EAAc,CAAE,GAAG,EAAM,CAC/B,IAAK,IAAM,KAAO,OAAO,KAAK,EAAO,CACnC,EAAO,GAAO,EAAiB,EAAO,GAAM,EAAO,GAAK,CAE1D,OAAO,EAKT,OAAO"}
1
+ {"version":3,"file":"mergeChunks.cjs","names":[],"sources":["../../../src/utils/mergeChunks.ts"],"sourcesContent":["export const mergeChunks = (chunks: any[]): any => {\n if (chunks.length === 0) return {};\n\n let result = chunks[0];\n\n for (let i = 1; i < chunks.length; i++) {\n result = customChunkMerge(result, chunks[i]);\n }\n\n return result;\n};\n\nconst customChunkMerge = (dest: any, source: any): any => {\n if (dest === undefined || dest === null) return source;\n if (source === undefined || source === null) return dest;\n\n if (Array.isArray(dest) && Array.isArray(source)) {\n const maxLength = Math.max(dest.length, source.length);\n const result = [];\n for (let i = 0; i < maxLength; i++) {\n result[i] = customChunkMerge(dest[i], source[i]);\n }\n return result;\n }\n\n if (typeof dest === 'object' && typeof source === 'object') {\n const result: any = { ...dest };\n for (const key of Object.keys(source)) {\n result[key] = customChunkMerge(result[key], source[key]);\n }\n return result;\n }\n\n // Primitives: if we are here, both are not null.\n // Since chunks shouldn't overlap, we can return dest.\n return dest;\n};\n"],"mappings":";;;AAAA,MAAa,eAAe,WAAuB;AACjD,KAAI,OAAO,WAAW,EAAG,QAAO,EAAE;CAElC,IAAI,SAAS,OAAO;AAEpB,MAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,IACjC,UAAS,iBAAiB,QAAQ,OAAO,GAAG;AAG9C,QAAO;;AAGT,MAAM,oBAAoB,MAAW,WAAqB;AACxD,KAAI,SAAS,UAAa,SAAS,KAAM,QAAO;AAChD,KAAI,WAAW,UAAa,WAAW,KAAM,QAAO;AAEpD,KAAI,MAAM,QAAQ,KAAK,IAAI,MAAM,QAAQ,OAAO,EAAE;EAChD,MAAM,YAAY,KAAK,IAAI,KAAK,QAAQ,OAAO,OAAO;EACtD,MAAM,SAAS,EAAE;AACjB,OAAK,IAAI,IAAI,GAAG,IAAI,WAAW,IAC7B,QAAO,KAAK,iBAAiB,KAAK,IAAI,OAAO,GAAG;AAElD,SAAO;;AAGT,KAAI,OAAO,SAAS,YAAY,OAAO,WAAW,UAAU;EAC1D,MAAM,SAAc,EAAE,GAAG,MAAM;AAC/B,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,CACnC,QAAO,OAAO,iBAAiB,OAAO,MAAM,OAAO,KAAK;AAE1D,SAAO;;AAKT,QAAO"}
@@ -1,2 +1,129 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=class{value;next;constructor(e){this.value=e}},t=class{#e;#t;#n;constructor(){this.clear()}enqueue(t){let n=new e(t);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){let e=this.#e;if(e)return this.#e=e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};const n=e=>{r(e);let n=new t,i=0,a=[],o=()=>{if(i===0&&n.size===0)for(;a.length;)a.pop()?.()},s=()=>{i<e&&n.size>0&&(i++,n.dequeue()?.())},c=()=>{i--,s()},l=async(e,t,n)=>{let r=(async()=>e(...n))();t(r);try{await r}catch{}c()},u=(t,r,a)=>{new Promise(e=>{n.enqueue(e)}).then(l.bind(void 0,t,r,a)),i<e&&s()},d=(e,...t)=>new Promise(n=>{u(e,n,t)});return Object.defineProperties(d,{activeCount:{get:()=>i},pendingCount:{get:()=>n.size},clearQueue:{value(){n.clear(),o()}},concurrency:{get:()=>e,set(t){r(t),e=t,queueMicrotask(()=>{for(;i<e&&n.size>0;)s()})}},map:{async value(e,t){let n=e.map((e,n)=>this(t,e,n));return Promise.all(n)}},onIdle:{value(){return i===0&&n.size===0?Promise.resolve():new Promise(e=>a.push(e))}}}),d},r=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up")};exports.Queue=t,exports.pLimit=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/pLimit.ts
4
+ var Node = class {
5
+ value;
6
+ next;
7
+ constructor(value) {
8
+ this.value = value;
9
+ }
10
+ };
11
+ var Queue = class {
12
+ #head;
13
+ #tail;
14
+ #size;
15
+ constructor() {
16
+ this.clear();
17
+ }
18
+ enqueue(value) {
19
+ const node = new Node(value);
20
+ if (this.#head) {
21
+ this.#tail.next = node;
22
+ this.#tail = node;
23
+ } else {
24
+ this.#head = node;
25
+ this.#tail = node;
26
+ }
27
+ this.#size++;
28
+ }
29
+ dequeue() {
30
+ const current = this.#head;
31
+ if (!current) return;
32
+ this.#head = current.next;
33
+ this.#size--;
34
+ return current.value;
35
+ }
36
+ peek() {
37
+ if (!this.#head) return;
38
+ return this.#head.value;
39
+ }
40
+ clear() {
41
+ this.#head = void 0;
42
+ this.#tail = void 0;
43
+ this.#size = 0;
44
+ }
45
+ get size() {
46
+ return this.#size;
47
+ }
48
+ *[Symbol.iterator]() {
49
+ let current = this.#head;
50
+ while (current) {
51
+ yield current.value;
52
+ current = current.next;
53
+ }
54
+ }
55
+ *drain() {
56
+ while (this.#head) yield this.dequeue();
57
+ }
58
+ };
59
+ const pLimit = (concurrency) => {
60
+ validateConcurrency(concurrency);
61
+ const queue = new Queue();
62
+ let activeCount = 0;
63
+ const idleWaiters = [];
64
+ const notifyIdleIfNeeded = () => {
65
+ if (activeCount === 0 && queue.size === 0) while (idleWaiters.length) idleWaiters.pop()?.();
66
+ };
67
+ const resumeNext = () => {
68
+ if (activeCount < concurrency && queue.size > 0) {
69
+ activeCount++;
70
+ queue.dequeue()?.();
71
+ }
72
+ };
73
+ const next = () => {
74
+ activeCount--;
75
+ resumeNext();
76
+ };
77
+ const run = async (fn, resolve, arguments_) => {
78
+ const result = (async () => fn(...arguments_))();
79
+ resolve(result);
80
+ try {
81
+ await result;
82
+ } catch {}
83
+ next();
84
+ };
85
+ const enqueue = (fn, resolve, arguments_) => {
86
+ new Promise((internalResolve) => {
87
+ queue.enqueue(internalResolve);
88
+ }).then(run.bind(void 0, fn, resolve, arguments_));
89
+ if (activeCount < concurrency) resumeNext();
90
+ };
91
+ const generator = (fn, ...arguments_) => new Promise((resolve) => {
92
+ enqueue(fn, resolve, arguments_);
93
+ });
94
+ Object.defineProperties(generator, {
95
+ activeCount: { get: () => activeCount },
96
+ pendingCount: { get: () => queue.size },
97
+ clearQueue: { value() {
98
+ queue.clear();
99
+ notifyIdleIfNeeded();
100
+ } },
101
+ concurrency: {
102
+ get: () => concurrency,
103
+ set(newConcurrency) {
104
+ validateConcurrency(newConcurrency);
105
+ concurrency = newConcurrency;
106
+ queueMicrotask(() => {
107
+ while (activeCount < concurrency && queue.size > 0) resumeNext();
108
+ });
109
+ }
110
+ },
111
+ map: { async value(array, fn) {
112
+ const promises = array.map((value, index) => this(fn, value, index));
113
+ return Promise.all(promises);
114
+ } },
115
+ onIdle: { value() {
116
+ if (activeCount === 0 && queue.size === 0) return Promise.resolve();
117
+ return new Promise((resolve) => idleWaiters.push(resolve));
118
+ } }
119
+ });
120
+ return generator;
121
+ };
122
+ const validateConcurrency = (concurrency) => {
123
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) throw new TypeError("Expected `concurrency` to be a number from 1 and up");
124
+ };
125
+
126
+ //#endregion
127
+ exports.Queue = Queue;
128
+ exports.pLimit = pLimit;
2
129
  //# sourceMappingURL=pLimit.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pLimit.cjs","names":["#head","#tail","#size"],"sources":["../../../src/utils/pLimit.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node<T> {\n value: T;\n next: Node<T> | undefined;\n\n constructor(value: T) {\n this.value = value;\n }\n}\n\nexport class Queue<T> {\n #head: Node<T> | undefined;\n #tail: Node<T> | undefined;\n #size!: number;\n\n constructor() {\n this.clear();\n }\n\n enqueue(value: T): void {\n const node = new Node(value);\n\n if (this.#head) {\n this.#tail!.next = node;\n this.#tail = node;\n } else {\n this.#head = node;\n this.#tail = node;\n }\n\n this.#size++;\n }\n\n dequeue(): T | undefined {\n const current = this.#head;\n if (!current) {\n return;\n }\n\n this.#head = current.next;\n this.#size--;\n return current.value;\n }\n\n peek(): T | undefined {\n if (!this.#head) {\n return;\n }\n\n return this.#head.value;\n\n // TODO: Node.js 18.\n // return this.#head?.value;\n }\n\n clear(): void {\n this.#head = undefined;\n this.#tail = undefined;\n this.#size = 0;\n }\n\n get size(): number {\n return this.#size;\n }\n\n *[Symbol.iterator](): Generator<T, void, unknown> {\n let current = this.#head;\n\n while (current) {\n yield current.value;\n current = current.next;\n }\n }\n\n *drain(): Generator<T | undefined, void, unknown> {\n while (this.#head) {\n yield this.dequeue();\n }\n }\n}\n\nexport const pLimit = (concurrency: number) => {\n validateConcurrency(concurrency);\n\n const queue = new Queue<() => void>();\n let activeCount = 0;\n\n const idleWaiters: Array<() => void> = [];\n const notifyIdleIfNeeded = (): void => {\n if (activeCount === 0 && queue.size === 0) {\n while (idleWaiters.length) idleWaiters.pop()?.();\n }\n };\n\n const resumeNext = (): void => {\n // Process the next queued function if we're under the concurrency limit\n if (activeCount < concurrency && queue.size > 0) {\n activeCount++;\n queue.dequeue()?.();\n }\n };\n\n const next = (): void => {\n activeCount--;\n resumeNext();\n };\n\n const run = async (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): Promise<void> => {\n // Execute the function and capture the result promise\n const result = (async () => fn(...arguments_))();\n\n // Resolve immediately with the promise (don't wait for completion)\n resolve(result);\n\n // Wait for the function to complete (success or failure)\n // We catch errors here to prevent unhandled rejections,\n // but the original promise rejection is preserved for the caller\n try {\n await result;\n } catch {}\n\n // Decrement active count and process next queued function\n next();\n };\n\n const enqueue = (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): void => {\n // Queue the internal resolve function instead of the run function\n // to preserve the asynchronous execution context.\n new Promise<void>((internalResolve) => {\n queue.enqueue(internalResolve);\n }).then(run.bind(undefined, fn, resolve, arguments_));\n\n // Start processing immediately if we haven't reached the concurrency limit\n if (activeCount < concurrency) {\n resumeNext();\n }\n };\n\n const generator = (\n fn: (...args: any[]) => Promise<any>,\n ...arguments_: any[]\n ): Promise<any> =>\n new Promise<any>((resolve) => {\n enqueue(fn, resolve, arguments_);\n });\n\n Object.defineProperties(generator, {\n activeCount: {\n get: () => activeCount,\n },\n pendingCount: {\n get: () => queue.size,\n },\n clearQueue: {\n value() {\n queue.clear();\n notifyIdleIfNeeded();\n },\n },\n concurrency: {\n get: () => concurrency,\n\n set(newConcurrency: number) {\n validateConcurrency(newConcurrency);\n concurrency = newConcurrency;\n\n queueMicrotask(() => {\n while (activeCount < concurrency && queue.size > 0) {\n resumeNext();\n }\n });\n },\n },\n map: {\n async value<T, R>(\n array: T[],\n fn: (value: T, index: number) => Promise<R>\n ): Promise<R[]> {\n const promises = array.map((value, index) => this(fn, value, index));\n return Promise.all(promises);\n },\n },\n onIdle: {\n /**\n * Resolves when `activeCount === 0` and the queue is empty.\n * Use this to wait for completion without holding a list of Promises.\n */\n value(): Promise<void> {\n if (activeCount === 0 && queue.size === 0) return Promise.resolve();\n return new Promise<void>((resolve) => idleWaiters.push(resolve));\n },\n },\n });\n\n return generator;\n};\n\nconst validateConcurrency = (concurrency: number): void => {\n if (\n !(\n (Number.isInteger(concurrency) ||\n concurrency === Number.POSITIVE_INFINITY) &&\n concurrency > 0\n )\n ) {\n throw new TypeError('Expected `concurrency` to be a number from 1 and up');\n }\n};\n"],"mappings":"mEAKA,IAAM,EAAN,KAAc,CACZ,MACA,KAEA,YAAY,EAAU,CACpB,KAAK,MAAQ,IAIJ,EAAb,KAAsB,CACpB,GACA,GACA,GAEA,aAAc,CACZ,KAAK,OAAO,CAGd,QAAQ,EAAgB,CACtB,IAAM,EAAO,IAAI,EAAK,EAAM,CAExB,MAAA,GACF,MAAA,EAAY,KAAO,EACnB,MAAA,EAAa,IAEb,MAAA,EAAa,EACb,MAAA,EAAa,GAGf,MAAA,IAGF,SAAyB,CACvB,IAAM,EAAU,MAAA,EACX,KAML,MAFA,OAAA,EAAa,EAAQ,KACrB,MAAA,IACO,EAAQ,MAGjB,MAAsB,CACf,SAAA,EAIL,OAAO,MAAA,EAAW,MAMpB,OAAc,CACZ,MAAA,EAAa,IAAA,GACb,MAAA,EAAa,IAAA,GACb,MAAA,EAAa,EAGf,IAAI,MAAe,CACjB,OAAO,MAAA,EAGT,EAAE,OAAO,WAAyC,CAChD,IAAI,EAAU,MAAA,EAEd,KAAO,GACL,MAAM,EAAQ,MACd,EAAU,EAAQ,KAItB,CAAC,OAAiD,CAChD,KAAO,MAAA,GACL,MAAM,KAAK,SAAS,GAK1B,MAAa,EAAU,GAAwB,CAC7C,EAAoB,EAAY,CAEhC,IAAM,EAAQ,IAAI,EACd,EAAc,EAEZ,EAAiC,EAAE,CACnC,MAAiC,CACrC,GAAI,IAAgB,GAAK,EAAM,OAAS,EACtC,KAAO,EAAY,QAAQ,EAAY,KAAK,IAAI,EAI9C,MAAyB,CAEzB,EAAc,GAAe,EAAM,KAAO,IAC5C,IACA,EAAM,SAAS,IAAI,GAIjB,MAAmB,CACvB,IACA,GAAY,EAGR,EAAM,MACV,EACA,EACA,IACkB,CAElB,IAAM,GAAU,SAAY,EAAG,GAAG,EAAW,GAAG,CAGhD,EAAQ,EAAO,CAKf,GAAI,CACF,MAAM,OACA,EAGR,GAAM,EAGF,GACJ,EACA,EACA,IACS,CAGT,IAAI,QAAe,GAAoB,CACrC,EAAM,QAAQ,EAAgB,EAC9B,CAAC,KAAK,EAAI,KAAK,IAAA,GAAW,EAAI,EAAS,EAAW,CAAC,CAGjD,EAAc,GAChB,GAAY,EAIV,GACJ,EACA,GAAG,IAEH,IAAI,QAAc,GAAY,CAC5B,EAAQ,EAAI,EAAS,EAAW,EAChC,CAkDJ,OAhDA,OAAO,iBAAiB,EAAW,CACjC,YAAa,CACX,QAAW,EACZ,CACD,aAAc,CACZ,QAAW,EAAM,KAClB,CACD,WAAY,CACV,OAAQ,CACN,EAAM,OAAO,CACb,GAAoB,EAEvB,CACD,YAAa,CACX,QAAW,EAEX,IAAI,EAAwB,CAC1B,EAAoB,EAAe,CACnC,EAAc,EAEd,mBAAqB,CACnB,KAAO,EAAc,GAAe,EAAM,KAAO,GAC/C,GAAY,EAEd,EAEL,CACD,IAAK,CACH,MAAM,MACJ,EACA,EACc,CACd,IAAM,EAAW,EAAM,KAAK,EAAO,IAAU,KAAK,EAAI,EAAO,EAAM,CAAC,CACpE,OAAO,QAAQ,IAAI,EAAS,EAE/B,CACD,OAAQ,CAKN,OAAuB,CAErB,OADI,IAAgB,GAAK,EAAM,OAAS,EAAU,QAAQ,SAAS,CAC5D,IAAI,QAAe,GAAY,EAAY,KAAK,EAAQ,CAAC,EAEnE,CACF,CAAC,CAEK,GAGH,EAAuB,GAA8B,CACzD,GACE,GACG,OAAO,UAAU,EAAY,EAC5B,IAAgB,MAClB,EAAc,GAGhB,MAAU,UAAU,sDAAsD"}
1
+ {"version":3,"file":"pLimit.cjs","names":["#head","#tail","#size"],"sources":["../../../src/utils/pLimit.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node<T> {\n value: T;\n next: Node<T> | undefined;\n\n constructor(value: T) {\n this.value = value;\n }\n}\n\nexport class Queue<T> {\n #head: Node<T> | undefined;\n #tail: Node<T> | undefined;\n #size!: number;\n\n constructor() {\n this.clear();\n }\n\n enqueue(value: T): void {\n const node = new Node(value);\n\n if (this.#head) {\n this.#tail!.next = node;\n this.#tail = node;\n } else {\n this.#head = node;\n this.#tail = node;\n }\n\n this.#size++;\n }\n\n dequeue(): T | undefined {\n const current = this.#head;\n if (!current) {\n return;\n }\n\n this.#head = current.next;\n this.#size--;\n return current.value;\n }\n\n peek(): T | undefined {\n if (!this.#head) {\n return;\n }\n\n return this.#head.value;\n\n // TODO: Node.js 18.\n // return this.#head?.value;\n }\n\n clear(): void {\n this.#head = undefined;\n this.#tail = undefined;\n this.#size = 0;\n }\n\n get size(): number {\n return this.#size;\n }\n\n *[Symbol.iterator](): Generator<T, void, unknown> {\n let current = this.#head;\n\n while (current) {\n yield current.value;\n current = current.next;\n }\n }\n\n *drain(): Generator<T | undefined, void, unknown> {\n while (this.#head) {\n yield this.dequeue();\n }\n }\n}\n\nexport const pLimit = (concurrency: number) => {\n validateConcurrency(concurrency);\n\n const queue = new Queue<() => void>();\n let activeCount = 0;\n\n const idleWaiters: Array<() => void> = [];\n const notifyIdleIfNeeded = (): void => {\n if (activeCount === 0 && queue.size === 0) {\n while (idleWaiters.length) idleWaiters.pop()?.();\n }\n };\n\n const resumeNext = (): void => {\n // Process the next queued function if we're under the concurrency limit\n if (activeCount < concurrency && queue.size > 0) {\n activeCount++;\n queue.dequeue()?.();\n }\n };\n\n const next = (): void => {\n activeCount--;\n resumeNext();\n };\n\n const run = async (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): Promise<void> => {\n // Execute the function and capture the result promise\n const result = (async () => fn(...arguments_))();\n\n // Resolve immediately with the promise (don't wait for completion)\n resolve(result);\n\n // Wait for the function to complete (success or failure)\n // We catch errors here to prevent unhandled rejections,\n // but the original promise rejection is preserved for the caller\n try {\n await result;\n } catch {}\n\n // Decrement active count and process next queued function\n next();\n };\n\n const enqueue = (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): void => {\n // Queue the internal resolve function instead of the run function\n // to preserve the asynchronous execution context.\n new Promise<void>((internalResolve) => {\n queue.enqueue(internalResolve);\n }).then(run.bind(undefined, fn, resolve, arguments_));\n\n // Start processing immediately if we haven't reached the concurrency limit\n if (activeCount < concurrency) {\n resumeNext();\n }\n };\n\n const generator = (\n fn: (...args: any[]) => Promise<any>,\n ...arguments_: any[]\n ): Promise<any> =>\n new Promise<any>((resolve) => {\n enqueue(fn, resolve, arguments_);\n });\n\n Object.defineProperties(generator, {\n activeCount: {\n get: () => activeCount,\n },\n pendingCount: {\n get: () => queue.size,\n },\n clearQueue: {\n value() {\n queue.clear();\n notifyIdleIfNeeded();\n },\n },\n concurrency: {\n get: () => concurrency,\n\n set(newConcurrency: number) {\n validateConcurrency(newConcurrency);\n concurrency = newConcurrency;\n\n queueMicrotask(() => {\n while (activeCount < concurrency && queue.size > 0) {\n resumeNext();\n }\n });\n },\n },\n map: {\n async value<T, R>(\n array: T[],\n fn: (value: T, index: number) => Promise<R>\n ): Promise<R[]> {\n const promises = array.map((value, index) => this(fn, value, index));\n return Promise.all(promises);\n },\n },\n onIdle: {\n /**\n * Resolves when `activeCount === 0` and the queue is empty.\n * Use this to wait for completion without holding a list of Promises.\n */\n value(): Promise<void> {\n if (activeCount === 0 && queue.size === 0) return Promise.resolve();\n return new Promise<void>((resolve) => idleWaiters.push(resolve));\n },\n },\n });\n\n return generator;\n};\n\nconst validateConcurrency = (concurrency: number): void => {\n if (\n !(\n (Number.isInteger(concurrency) ||\n concurrency === Number.POSITIVE_INFINITY) &&\n concurrency > 0\n )\n ) {\n throw new TypeError('Expected `concurrency` to be a number from 1 and up');\n }\n};\n"],"mappings":";;;AAKA,IAAM,OAAN,MAAc;CACZ;CACA;CAEA,YAAY,OAAU;AACpB,OAAK,QAAQ;;;AAIjB,IAAa,QAAb,MAAsB;CACpB;CACA;CACA;CAEA,cAAc;AACZ,OAAK,OAAO;;CAGd,QAAQ,OAAgB;EACtB,MAAM,OAAO,IAAI,KAAK,MAAM;AAE5B,MAAI,MAAKA,MAAO;AACd,SAAKC,KAAO,OAAO;AACnB,SAAKA,OAAQ;SACR;AACL,SAAKD,OAAQ;AACb,SAAKC,OAAQ;;AAGf,QAAKC;;CAGP,UAAyB;EACvB,MAAM,UAAU,MAAKF;AACrB,MAAI,CAAC,QACH;AAGF,QAAKA,OAAQ,QAAQ;AACrB,QAAKE;AACL,SAAO,QAAQ;;CAGjB,OAAsB;AACpB,MAAI,CAAC,MAAKF,KACR;AAGF,SAAO,MAAKA,KAAM;;CAMpB,QAAc;AACZ,QAAKA,OAAQ;AACb,QAAKC,OAAQ;AACb,QAAKC,OAAQ;;CAGf,IAAI,OAAe;AACjB,SAAO,MAAKA;;CAGd,EAAE,OAAO,YAAyC;EAChD,IAAI,UAAU,MAAKF;AAEnB,SAAO,SAAS;AACd,SAAM,QAAQ;AACd,aAAU,QAAQ;;;CAItB,CAAC,QAAiD;AAChD,SAAO,MAAKA,KACV,OAAM,KAAK,SAAS;;;AAK1B,MAAa,UAAU,gBAAwB;AAC7C,qBAAoB,YAAY;CAEhC,MAAM,QAAQ,IAAI,OAAmB;CACrC,IAAI,cAAc;CAElB,MAAM,cAAiC,EAAE;CACzC,MAAM,2BAAiC;AACrC,MAAI,gBAAgB,KAAK,MAAM,SAAS,EACtC,QAAO,YAAY,OAAQ,aAAY,KAAK,IAAI;;CAIpD,MAAM,mBAAyB;AAE7B,MAAI,cAAc,eAAe,MAAM,OAAO,GAAG;AAC/C;AACA,SAAM,SAAS,IAAI;;;CAIvB,MAAM,aAAmB;AACvB;AACA,cAAY;;CAGd,MAAM,MAAM,OACV,IACA,SACA,eACkB;EAElB,MAAM,UAAU,YAAY,GAAG,GAAG,WAAW,GAAG;AAGhD,UAAQ,OAAO;AAKf,MAAI;AACF,SAAM;UACA;AAGR,QAAM;;CAGR,MAAM,WACJ,IACA,SACA,eACS;AAGT,MAAI,SAAe,oBAAoB;AACrC,SAAM,QAAQ,gBAAgB;IAC9B,CAAC,KAAK,IAAI,KAAK,QAAW,IAAI,SAAS,WAAW,CAAC;AAGrD,MAAI,cAAc,YAChB,aAAY;;CAIhB,MAAM,aACJ,IACA,GAAG,eAEH,IAAI,SAAc,YAAY;AAC5B,UAAQ,IAAI,SAAS,WAAW;GAChC;AAEJ,QAAO,iBAAiB,WAAW;EACjC,aAAa,EACX,WAAW,aACZ;EACD,cAAc,EACZ,WAAW,MAAM,MAClB;EACD,YAAY,EACV,QAAQ;AACN,SAAM,OAAO;AACb,uBAAoB;KAEvB;EACD,aAAa;GACX,WAAW;GAEX,IAAI,gBAAwB;AAC1B,wBAAoB,eAAe;AACnC,kBAAc;AAEd,yBAAqB;AACnB,YAAO,cAAc,eAAe,MAAM,OAAO,EAC/C,aAAY;MAEd;;GAEL;EACD,KAAK,EACH,MAAM,MACJ,OACA,IACc;GACd,MAAM,WAAW,MAAM,KAAK,OAAO,UAAU,KAAK,IAAI,OAAO,MAAM,CAAC;AACpE,UAAO,QAAQ,IAAI,SAAS;KAE/B;EACD,QAAQ,EAKN,QAAuB;AACrB,OAAI,gBAAgB,KAAK,MAAM,SAAS,EAAG,QAAO,QAAQ,SAAS;AACnE,UAAO,IAAI,SAAe,YAAY,YAAY,KAAK,QAAQ,CAAC;KAEnE;EACF,CAAC;AAEF,QAAO;;AAGT,MAAM,uBAAuB,gBAA8B;AACzD,KACE,GACG,OAAO,UAAU,YAAY,IAC5B,gBAAgB,OAAO,sBACzB,cAAc,GAGhB,OAAM,IAAI,UAAU,sDAAsD"}
@@ -1,2 +1,12 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./pLimit.cjs`),t=async(t,n=async e=>e,r=10)=>{let i=e.pLimit(r);return Promise.all(t.map(e=>i(()=>n(e))))};exports.parallelize=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_pLimit = require('./pLimit.cjs');
3
+
4
+ //#region src/utils/parallelize.ts
5
+ const parallelize = async (items, callback = async (item) => item, parallelLimit = 10) => {
6
+ const limit = require_utils_pLimit.pLimit(parallelLimit);
7
+ return Promise.all(items.map((item) => limit(() => callback(item))));
8
+ };
9
+
10
+ //#endregion
11
+ exports.parallelize = parallelize;
2
12
  //# sourceMappingURL=parallelize.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parallelize.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelize.ts"],"sourcesContent":["import { pLimit } from './pLimit';\n\nexport const parallelize = async <T, R>(\n items: T[],\n callback: (item: T) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n parallelLimit: number = 10\n): Promise<R[]> => {\n const limit = pLimit(parallelLimit);\n return Promise.all(items.map((item) => limit(() => callback(item))));\n};\n"],"mappings":"mGAEa,EAAc,MACzB,EACA,EAAoC,KAAO,IACzC,EACF,EAAwB,KACP,CACjB,IAAM,EAAQA,EAAAA,OAAO,EAAc,CACnC,OAAO,QAAQ,IAAI,EAAM,IAAK,GAAS,MAAY,EAAS,EAAK,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"parallelize.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelize.ts"],"sourcesContent":["import { pLimit } from './pLimit';\n\nexport const parallelize = async <T, R>(\n items: T[],\n callback: (item: T) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n parallelLimit: number = 10\n): Promise<R[]> => {\n const limit = pLimit(parallelLimit);\n return Promise.all(items.map((item) => limit(() => callback(item))));\n};\n"],"mappings":";;;;AAEA,MAAa,cAAc,OACzB,OACA,WAAoC,OAAO,SACzC,MACF,gBAAwB,OACP;CACjB,MAAM,QAAQA,4BAAO,cAAc;AACnC,QAAO,QAAQ,IAAI,MAAM,KAAK,SAAS,YAAY,SAAS,KAAK,CAAC,CAAC,CAAC"}
@@ -1,2 +1,30 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./pLimit.cjs`);let t=null;const n=n=>(t?typeof n==`number`&&(t.concurrency=n):t=e.pLimit(n??10),t);let r=null;const i=t=>(r?typeof t==`number`&&(r.concurrency=t):r=e.pLimit(t??5),r),a=async(e,t=async e=>e,r)=>{let i=r?.limiter??n(r?.concurrency),a=r?.wrapInLimiter??!0?e=>i(e):e=>e(),o=e.map((e,n)=>a(()=>t(e,n)));return Promise.all(o)};exports.getGlobalLimiter=n,exports.getTaskLimiter=i,exports.parallelizeGlobal=a;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_utils_pLimit = require('./pLimit.cjs');
3
+
4
+ //#region src/utils/parallelizeGlobal.ts
5
+ let _globalLimiter = null;
6
+ /** Get (and optionally configure) the single, shared limiter. */
7
+ const getGlobalLimiter = (concurrency) => {
8
+ if (!_globalLimiter) _globalLimiter = require_utils_pLimit.pLimit(concurrency ?? 10);
9
+ else if (typeof concurrency === "number") _globalLimiter.concurrency = concurrency;
10
+ return _globalLimiter;
11
+ };
12
+ let _taskLimiter = null;
13
+ /** Limits how many *tasks* run concurrently (independent from AI calls). */
14
+ const getTaskLimiter = (concurrency) => {
15
+ if (!_taskLimiter) _taskLimiter = require_utils_pLimit.pLimit(concurrency ?? 5);
16
+ else if (typeof concurrency === "number") _taskLimiter.concurrency = concurrency;
17
+ return _taskLimiter;
18
+ };
19
+ const parallelizeGlobal = async (items, callback = async (item) => item, options) => {
20
+ const limiter = options?.limiter ?? getGlobalLimiter(options?.concurrency);
21
+ const run = options?.wrapInLimiter ?? true ? (fn) => limiter(fn) : (fn) => fn();
22
+ const promises = items.map((item, index) => run(() => callback(item, index)));
23
+ return Promise.all(promises);
24
+ };
25
+
26
+ //#endregion
27
+ exports.getGlobalLimiter = getGlobalLimiter;
28
+ exports.getTaskLimiter = getTaskLimiter;
29
+ exports.parallelizeGlobal = parallelizeGlobal;
2
30
  //# sourceMappingURL=parallelizeGlobal.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parallelizeGlobal.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelizeGlobal.ts"],"sourcesContent":["// === keep your Queue, Node, pLimit, validateConcurrency exactly as-is ===\n\nimport { pLimit } from './pLimit';\n\n// --- NEW: single, shared limiter for the whole process ---\nlet _globalLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Get (and optionally configure) the single, shared limiter. */\nexport const getGlobalLimiter = (concurrency?: number) => {\n if (!_globalLimiter) {\n _globalLimiter = pLimit(concurrency ?? 10);\n } else if (typeof concurrency === 'number') {\n (_globalLimiter as any).concurrency = concurrency;\n }\n return _globalLimiter!;\n};\n\n// --- NEW: task limiter for gating task starts ---\nlet _taskLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Limits how many *tasks* run concurrently (independent from AI calls). */\nexport const getTaskLimiter = (concurrency?: number) => {\n if (!_taskLimiter) {\n _taskLimiter = pLimit(concurrency ?? 5);\n } else if (typeof concurrency === 'number') {\n (_taskLimiter as any).concurrency = concurrency;\n }\n return _taskLimiter!;\n};\n\n// --- REPLACE your existing `parallelize` with this version ---\nexport const parallelizeGlobal = async <T, R>(\n items: T[],\n callback: (item: T, index: number) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n options?: {\n /** Share a single limiter across the app. If omitted, uses global limiter. */\n limiter?: ReturnType<typeof pLimit>;\n /** If provided and no limiter is passed, configure the global limiter. */\n concurrency?: number;\n /**\n * Whether to wrap *each* callback run in the limiter.\n * - For orchestration (outer loops): set `false` (don't burn limiter slots).\n * - For atomic work (AI calls, writes): leave `true` (default).\n */\n wrapInLimiter?: boolean;\n }\n): Promise<R[]> => {\n const limiter = options?.limiter ?? getGlobalLimiter(options?.concurrency);\n const wrap = options?.wrapInLimiter ?? true;\n\n const run = wrap\n ? <U>(fn: () => Promise<U>) => limiter(fn)\n : <U>(fn: () => Promise<U>) => fn();\n\n const promises = items.map((item, index) => run(() => callback(item, index)));\n return Promise.all(promises);\n};\n"],"mappings":"mGAKA,IAAI,EAAmD,KAGvD,MAAa,EAAoB,IAC1B,EAEM,OAAO,GAAgB,WAC/B,EAAuB,YAAc,GAFtC,EAAiBA,EAAAA,OAAO,GAAe,GAAG,CAIrC,GAIT,IAAI,EAAiD,KAGrD,MAAa,EAAkB,IACxB,EAEM,OAAO,GAAgB,WAC/B,EAAqB,YAAc,GAFpC,EAAeA,EAAAA,OAAO,GAAe,EAAE,CAIlC,GAII,EAAoB,MAC/B,EACA,EAAmD,KAAO,IACxD,EACF,IAYiB,CACjB,IAAM,EAAU,GAAS,SAAW,EAAiB,GAAS,YAAY,CAGpE,EAFO,GAAS,eAAiB,GAG/B,GAAyB,EAAQ,EAAG,CACpC,GAAyB,GAAI,CAE/B,EAAW,EAAM,KAAK,EAAM,IAAU,MAAU,EAAS,EAAM,EAAM,CAAC,CAAC,CAC7E,OAAO,QAAQ,IAAI,EAAS"}
1
+ {"version":3,"file":"parallelizeGlobal.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelizeGlobal.ts"],"sourcesContent":["// === keep your Queue, Node, pLimit, validateConcurrency exactly as-is ===\n\nimport { pLimit } from './pLimit';\n\n// --- NEW: single, shared limiter for the whole process ---\nlet _globalLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Get (and optionally configure) the single, shared limiter. */\nexport const getGlobalLimiter = (concurrency?: number) => {\n if (!_globalLimiter) {\n _globalLimiter = pLimit(concurrency ?? 10);\n } else if (typeof concurrency === 'number') {\n (_globalLimiter as any).concurrency = concurrency;\n }\n return _globalLimiter!;\n};\n\n// --- NEW: task limiter for gating task starts ---\nlet _taskLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Limits how many *tasks* run concurrently (independent from AI calls). */\nexport const getTaskLimiter = (concurrency?: number) => {\n if (!_taskLimiter) {\n _taskLimiter = pLimit(concurrency ?? 5);\n } else if (typeof concurrency === 'number') {\n (_taskLimiter as any).concurrency = concurrency;\n }\n return _taskLimiter!;\n};\n\n// --- REPLACE your existing `parallelize` with this version ---\nexport const parallelizeGlobal = async <T, R>(\n items: T[],\n callback: (item: T, index: number) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n options?: {\n /** Share a single limiter across the app. If omitted, uses global limiter. */\n limiter?: ReturnType<typeof pLimit>;\n /** If provided and no limiter is passed, configure the global limiter. */\n concurrency?: number;\n /**\n * Whether to wrap *each* callback run in the limiter.\n * - For orchestration (outer loops): set `false` (don't burn limiter slots).\n * - For atomic work (AI calls, writes): leave `true` (default).\n */\n wrapInLimiter?: boolean;\n }\n): Promise<R[]> => {\n const limiter = options?.limiter ?? getGlobalLimiter(options?.concurrency);\n const wrap = options?.wrapInLimiter ?? true;\n\n const run = wrap\n ? <U>(fn: () => Promise<U>) => limiter(fn)\n : <U>(fn: () => Promise<U>) => fn();\n\n const promises = items.map((item, index) => run(() => callback(item, index)));\n return Promise.all(promises);\n};\n"],"mappings":";;;;AAKA,IAAI,iBAAmD;;AAGvD,MAAa,oBAAoB,gBAAyB;AACxD,KAAI,CAAC,eACH,kBAAiBA,4BAAO,eAAe,GAAG;UACjC,OAAO,gBAAgB,SAChC,CAAC,eAAuB,cAAc;AAExC,QAAO;;AAIT,IAAI,eAAiD;;AAGrD,MAAa,kBAAkB,gBAAyB;AACtD,KAAI,CAAC,aACH,gBAAeA,4BAAO,eAAe,EAAE;UAC9B,OAAO,gBAAgB,SAChC,CAAC,aAAqB,cAAc;AAEtC,QAAO;;AAIT,MAAa,oBAAoB,OAC/B,OACA,WAAmD,OAAO,SACxD,MACF,YAYiB;CACjB,MAAM,UAAU,SAAS,WAAW,iBAAiB,SAAS,YAAY;CAG1E,MAAM,MAFO,SAAS,iBAAiB,QAG/B,OAAyB,QAAQ,GAAG,IACpC,OAAyB,IAAI;CAErC,MAAM,WAAW,MAAM,KAAK,MAAM,UAAU,UAAU,SAAS,MAAM,MAAM,CAAC,CAAC;AAC7E,QAAO,QAAQ,IAAI,SAAS"}
@@ -1,2 +1,32 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=(t,n)=>{if(Array.isArray(n)){let r=Array.isArray(t)?t:[];return n.map((t,n)=>e(r[n],t))}if(typeof n==`object`&&n){let r={},i=typeof t==`object`&&t&&!Array.isArray(t)?t:{};for(let t of Object.keys(n)){let a=i[t],o=n[t];r[t]=e(a,o)}return r}return t};exports.reduceObjectFormat=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/reduceObjectFormat.ts
4
+ /**
5
+ * Reduce an object to only the shape provided by a format object.
6
+ * Values are always taken from the source object; the format is used only for structure.
7
+ *
8
+ * Examples:
9
+ * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }
10
+ * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }
11
+ */
12
+ const reduceObjectFormat = (source, format) => {
13
+ if (Array.isArray(format)) {
14
+ const sourceArray = Array.isArray(source) ? source : [];
15
+ return format.map((formatItem, index) => reduceObjectFormat(sourceArray[index], formatItem));
16
+ }
17
+ if (typeof format === "object" && format !== null) {
18
+ const result = {};
19
+ const sourceObject = typeof source === "object" && source !== null && !Array.isArray(source) ? source : {};
20
+ for (const key of Object.keys(format)) {
21
+ const nextSource = sourceObject[key];
22
+ const nextFormat = format[key];
23
+ result[key] = reduceObjectFormat(nextSource, nextFormat);
24
+ }
25
+ return result;
26
+ }
27
+ return source;
28
+ };
29
+
30
+ //#endregion
31
+ exports.reduceObjectFormat = reduceObjectFormat;
2
32
  //# sourceMappingURL=reduceObjectFormat.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reduceObjectFormat.cjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["type Primitive = string | number | boolean | null | undefined;\n\ntype Recursive = Primitive | { [key: string]: Recursive } | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n"],"mappings":"mEAYA,MAAa,GACX,EACA,IACc,CAEd,GAAI,MAAM,QAAQ,EAAO,CAAE,CACzB,IAAM,EAAc,MAAM,QAAQ,EAAO,CAAG,EAAS,EAAE,CACvD,OAAO,EAAO,KAAK,EAAY,IAC7B,EAAmB,EAAY,GAAQ,EAAW,CACnD,CAIH,GAAI,OAAO,GAAW,UAAY,EAAiB,CACjD,IAAM,EAAoC,EAAE,CACtC,EACJ,OAAO,GAAW,UAAY,GAAmB,CAAC,MAAM,QAAQ,EAAO,CAClE,EACA,EAAE,CAET,IAAK,IAAM,KAAO,OAAO,KAAK,EAAO,CAAE,CACrC,IAAM,EAAa,EAAa,GAC1B,EAAc,EAAqC,GACzD,EAAO,GAAO,EAAmB,EAAY,EAAW,CAE1D,OAAO,EAIT,OAAO"}
1
+ {"version":3,"file":"reduceObjectFormat.cjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["type Primitive = string | number | boolean | null | undefined;\n\ntype Recursive = Primitive | { [key: string]: Recursive } | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO"}
@@ -1,2 +1,22 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=async t=>{if(t&&typeof t.then==`function`)return e(await t);if(typeof t==`function`)return e(t());if(Array.isArray(t))return Promise.all(t.map(async t=>e(t)));if(t&&typeof t==`object`){let n={};for(let r of Object.keys(t))n[r]=await e(t[r]);return n}return t};exports.resolveObjectPromises=e;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/utils/resolveObjectPromises.ts
4
+ /**
5
+ * A more "unified" approach where each type (function, array, object, primitive)
6
+ * is handled inside the main recursive body.
7
+ */
8
+ const resolveObjectPromises = async (entry) => {
9
+ if (entry && typeof entry.then === "function") return resolveObjectPromises(await entry);
10
+ if (typeof entry === "function") return resolveObjectPromises(entry());
11
+ if (Array.isArray(entry)) return Promise.all(entry.map(async (item) => resolveObjectPromises(item)));
12
+ if (entry && typeof entry === "object") {
13
+ const result = {};
14
+ for (const key of Object.keys(entry)) result[key] = await resolveObjectPromises(entry[key]);
15
+ return result;
16
+ }
17
+ return entry;
18
+ };
19
+
20
+ //#endregion
21
+ exports.resolveObjectPromises = resolveObjectPromises;
2
22
  //# sourceMappingURL=resolveObjectPromises.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveObjectPromises.cjs","names":[],"sources":["../../../src/utils/resolveObjectPromises.ts"],"sourcesContent":["/**\n * A more \"unified\" approach where each type (function, array, object, primitive)\n * is handled inside the main recursive body.\n */\nexport const resolveObjectPromises = async <T = unknown>(\n entry: any\n): Promise<T> => {\n // Check if entry is a Promise (Thenable)\n if (entry && typeof entry.then === 'function') {\n const awaited = await entry;\n return resolveObjectPromises(awaited);\n }\n\n // If entry is a function, invoke it and process the result\n if (typeof entry === 'function') {\n const result = entry();\n return resolveObjectPromises(result);\n }\n\n if (Array.isArray(entry)) {\n return Promise.all(\n entry.map(async (item) => resolveObjectPromises(item))\n ) as unknown as T;\n }\n\n // Handle plain objects (but not arrays)\n if (entry && typeof entry === 'object') {\n // Arrays are handled in the `Array.isArray` branch above, so we know `entry` is a plain object here.\n\n const result: Record<string, any> = {};\n\n // Iterate over keys **sequentially** to make sure the insertion order of the\n // resulting object matches the original key order. Using `Promise.all` here\n // could lead to out-of-order insertions when asynchronous resolutions\n // finish at different times.\n for (const key of Object.keys(entry)) {\n result[key] = await resolveObjectPromises(entry[key]);\n }\n\n return result as T;\n }\n\n return entry as T;\n};\n"],"mappings":"mEAIA,MAAa,EAAwB,KACnC,IACe,CAEf,GAAI,GAAS,OAAO,EAAM,MAAS,WAEjC,OAAO,EADS,MAAM,EACe,CAIvC,GAAI,OAAO,GAAU,WAEnB,OAAO,EADQ,GAAO,CACc,CAGtC,GAAI,MAAM,QAAQ,EAAM,CACtB,OAAO,QAAQ,IACb,EAAM,IAAI,KAAO,IAAS,EAAsB,EAAK,CAAC,CACvD,CAIH,GAAI,GAAS,OAAO,GAAU,SAAU,CAGtC,IAAM,EAA8B,EAAE,CAMtC,IAAK,IAAM,KAAO,OAAO,KAAK,EAAM,CAClC,EAAO,GAAO,MAAM,EAAsB,EAAM,GAAK,CAGvD,OAAO,EAGT,OAAO"}
1
+ {"version":3,"file":"resolveObjectPromises.cjs","names":[],"sources":["../../../src/utils/resolveObjectPromises.ts"],"sourcesContent":["/**\n * A more \"unified\" approach where each type (function, array, object, primitive)\n * is handled inside the main recursive body.\n */\nexport const resolveObjectPromises = async <T = unknown>(\n entry: any\n): Promise<T> => {\n // Check if entry is a Promise (Thenable)\n if (entry && typeof entry.then === 'function') {\n const awaited = await entry;\n return resolveObjectPromises(awaited);\n }\n\n // If entry is a function, invoke it and process the result\n if (typeof entry === 'function') {\n const result = entry();\n return resolveObjectPromises(result);\n }\n\n if (Array.isArray(entry)) {\n return Promise.all(\n entry.map(async (item) => resolveObjectPromises(item))\n ) as unknown as T;\n }\n\n // Handle plain objects (but not arrays)\n if (entry && typeof entry === 'object') {\n // Arrays are handled in the `Array.isArray` branch above, so we know `entry` is a plain object here.\n\n const result: Record<string, any> = {};\n\n // Iterate over keys **sequentially** to make sure the insertion order of the\n // resulting object matches the original key order. Using `Promise.all` here\n // could lead to out-of-order insertions when asynchronous resolutions\n // finish at different times.\n for (const key of Object.keys(entry)) {\n result[key] = await resolveObjectPromises(entry[key]);\n }\n\n return result as T;\n }\n\n return entry as T;\n};\n"],"mappings":";;;;;;;AAIA,MAAa,wBAAwB,OACnC,UACe;AAEf,KAAI,SAAS,OAAO,MAAM,SAAS,WAEjC,QAAO,sBADS,MAAM,MACe;AAIvC,KAAI,OAAO,UAAU,WAEnB,QAAO,sBADQ,OAAO,CACc;AAGtC,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,QAAQ,IACb,MAAM,IAAI,OAAO,SAAS,sBAAsB,KAAK,CAAC,CACvD;AAIH,KAAI,SAAS,OAAO,UAAU,UAAU;EAGtC,MAAM,SAA8B,EAAE;AAMtC,OAAK,MAAM,OAAO,OAAO,KAAK,MAAM,CAClC,QAAO,OAAO,MAAM,sBAAsB,MAAM,KAAK;AAGvD,SAAO;;AAGT,QAAO"}
@@ -1,2 +1,22 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`node:path`);const t=(t,n,r)=>{if((0,e.isAbsolute)(t)){let n=(0,e.normalize)(t),i=(0,e.normalize)(r);if(t.startsWith(`/`)&&!n.startsWith(i)){let n=(0,e.resolve)(r,t.substring(1));if(!t.startsWith(`/usr/`)&&!t.startsWith(`/etc/`)&&!t.startsWith(`/var/`)&&!t.startsWith(`/home/`)&&!t.startsWith(`/Users/`)&&!t.startsWith(`/tmp/`)&&!t.startsWith(`/private/`)&&!t.startsWith(`/opt/`))return n}return n}return t.startsWith(`./`)||t.startsWith(`../`)?(0,e.resolve)((0,e.dirname)(n),t):(0,e.resolve)(r,t)};exports.resolveRelativePath=t;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let node_path = require("node:path");
4
+
5
+ //#region src/utils/resolveRelativePath.ts
6
+ const resolveRelativePath = (path, sourcePath, baseDir) => {
7
+ if ((0, node_path.isAbsolute)(path)) {
8
+ const normalizedResult = (0, node_path.normalize)(path);
9
+ const normalizedBaseDir = (0, node_path.normalize)(baseDir);
10
+ if (path.startsWith("/") && !normalizedResult.startsWith(normalizedBaseDir)) {
11
+ const relativeToBase = (0, node_path.resolve)(baseDir, path.substring(1));
12
+ if (!path.startsWith("/usr/") && !path.startsWith("/etc/") && !path.startsWith("/var/") && !path.startsWith("/home/") && !path.startsWith("/Users/") && !path.startsWith("/tmp/") && !path.startsWith("/private/") && !path.startsWith("/opt/")) return relativeToBase;
13
+ }
14
+ return normalizedResult;
15
+ }
16
+ if (path.startsWith("./") || path.startsWith("../")) return (0, node_path.resolve)((0, node_path.dirname)(sourcePath), path);
17
+ return (0, node_path.resolve)(baseDir, path);
18
+ };
19
+
20
+ //#endregion
21
+ exports.resolveRelativePath = resolveRelativePath;
2
22
  //# sourceMappingURL=resolveRelativePath.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveRelativePath.cjs","names":[],"sources":["../../../src/utils/resolveRelativePath.ts"],"sourcesContent":["import { dirname, isAbsolute, normalize, resolve } from 'node:path';\n\nexport const resolveRelativePath = (\n path: string,\n sourcePath: string,\n baseDir: string\n) => {\n // Handle absolute paths\n if (isAbsolute(path)) {\n const normalizedResult = normalize(path);\n const normalizedBaseDir = normalize(baseDir);\n\n // Check if it's relative to baseDir (starts with /)\n // but not a system path (like /usr/local)\n if (\n path.startsWith('/') &&\n !normalizedResult.startsWith(normalizedBaseDir)\n ) {\n // Try to resolve it relative to baseDir first\n const relativeToBase = resolve(baseDir, path.substring(1));\n\n // If the path doesn't exist in common system directories, treat as relative to baseDir\n if (\n !path.startsWith('/usr/') &&\n !path.startsWith('/etc/') &&\n !path.startsWith('/var/') &&\n !path.startsWith('/home/') &&\n !path.startsWith('/Users/') &&\n !path.startsWith('/tmp/') &&\n !path.startsWith('/private/') &&\n !path.startsWith('/opt/')\n ) {\n return relativeToBase;\n }\n }\n\n // It's a true system absolute path\n return normalizedResult;\n }\n\n // Handle relative paths (starting with ./ or ../)\n if (path.startsWith('./') || path.startsWith('../')) {\n const fileDir = dirname(sourcePath);\n return resolve(fileDir, path);\n }\n\n // Default case: treat as relative to baseDir\n return resolve(baseDir, path);\n};\n"],"mappings":"+HAEA,MAAa,GACX,EACA,EACA,IACG,CAEH,IAAA,EAAA,EAAA,YAAe,EAAK,CAAE,CACpB,IAAM,GAAA,EAAA,EAAA,WAA6B,EAAK,CAClC,GAAA,EAAA,EAAA,WAA8B,EAAQ,CAI5C,GACE,EAAK,WAAW,IAAI,EACpB,CAAC,EAAiB,WAAW,EAAkB,CAC/C,CAEA,IAAM,GAAA,EAAA,EAAA,SAAyB,EAAS,EAAK,UAAU,EAAE,CAAC,CAG1D,GACE,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,SAAS,EAC1B,CAAC,EAAK,WAAW,UAAU,EAC3B,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,YAAY,EAC7B,CAAC,EAAK,WAAW,QAAQ,CAEzB,OAAO,EAKX,OAAO,EAUT,OANI,EAAK,WAAW,KAAK,EAAI,EAAK,WAAW,MAAM,EAEjD,EAAA,EAAA,UAAA,EAAA,EAAA,SADwB,EAAW,CACX,EAAK,EAI/B,EAAA,EAAA,SAAe,EAAS,EAAK"}
1
+ {"version":3,"file":"resolveRelativePath.cjs","names":[],"sources":["../../../src/utils/resolveRelativePath.ts"],"sourcesContent":["import { dirname, isAbsolute, normalize, resolve } from 'node:path';\n\nexport const resolveRelativePath = (\n path: string,\n sourcePath: string,\n baseDir: string\n) => {\n // Handle absolute paths\n if (isAbsolute(path)) {\n const normalizedResult = normalize(path);\n const normalizedBaseDir = normalize(baseDir);\n\n // Check if it's relative to baseDir (starts with /)\n // but not a system path (like /usr/local)\n if (\n path.startsWith('/') &&\n !normalizedResult.startsWith(normalizedBaseDir)\n ) {\n // Try to resolve it relative to baseDir first\n const relativeToBase = resolve(baseDir, path.substring(1));\n\n // If the path doesn't exist in common system directories, treat as relative to baseDir\n if (\n !path.startsWith('/usr/') &&\n !path.startsWith('/etc/') &&\n !path.startsWith('/var/') &&\n !path.startsWith('/home/') &&\n !path.startsWith('/Users/') &&\n !path.startsWith('/tmp/') &&\n !path.startsWith('/private/') &&\n !path.startsWith('/opt/')\n ) {\n return relativeToBase;\n }\n }\n\n // It's a true system absolute path\n return normalizedResult;\n }\n\n // Handle relative paths (starting with ./ or ../)\n if (path.startsWith('./') || path.startsWith('../')) {\n const fileDir = dirname(sourcePath);\n return resolve(fileDir, path);\n }\n\n // Default case: treat as relative to baseDir\n return resolve(baseDir, path);\n};\n"],"mappings":";;;;;AAEA,MAAa,uBACX,MACA,YACA,YACG;AAEH,+BAAe,KAAK,EAAE;EACpB,MAAM,4CAA6B,KAAK;EACxC,MAAM,6CAA8B,QAAQ;AAI5C,MACE,KAAK,WAAW,IAAI,IACpB,CAAC,iBAAiB,WAAW,kBAAkB,EAC/C;GAEA,MAAM,wCAAyB,SAAS,KAAK,UAAU,EAAE,CAAC;AAG1D,OACE,CAAC,KAAK,WAAW,QAAQ,IACzB,CAAC,KAAK,WAAW,QAAQ,IACzB,CAAC,KAAK,WAAW,QAAQ,IACzB,CAAC,KAAK,WAAW,SAAS,IAC1B,CAAC,KAAK,WAAW,UAAU,IAC3B,CAAC,KAAK,WAAW,QAAQ,IACzB,CAAC,KAAK,WAAW,YAAY,IAC7B,CAAC,KAAK,WAAW,QAAQ,CAEzB,QAAO;;AAKX,SAAO;;AAIT,KAAI,KAAK,WAAW,KAAK,IAAI,KAAK,WAAW,MAAM,CAEjD,sDADwB,WAAW,EACX,KAAK;AAI/B,+BAAe,SAAS,KAAK"}