@bemoje/fs 0.2.10 → 0.2.13

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 (418) hide show
  1. package/README.md +2 -2
  2. package/cjs/index.d.ts +80 -0
  3. package/cjs/index.d.ts.map +1 -0
  4. package/cjs/index.js +83 -0
  5. package/cjs/index.js.map +1 -0
  6. package/cjs/lib/appendFile.d.ts +10 -0
  7. package/cjs/lib/appendFile.d.ts.map +1 -0
  8. package/cjs/lib/appendFile.js +23 -0
  9. package/cjs/lib/appendFile.js.map +1 -0
  10. package/cjs/lib/appendFileLine.d.ts +7 -0
  11. package/cjs/lib/appendFileLine.d.ts.map +1 -0
  12. package/cjs/lib/appendFileLine.js +16 -0
  13. package/cjs/lib/appendFileLine.js.map +1 -0
  14. package/cjs/lib/appendFileLineSync.d.ts +7 -0
  15. package/cjs/lib/appendFileLineSync.d.ts.map +1 -0
  16. package/cjs/lib/appendFileLineSync.js +16 -0
  17. package/cjs/lib/appendFileLineSync.js.map +1 -0
  18. package/cjs/lib/appendFileSync.d.ts +10 -0
  19. package/cjs/lib/appendFileSync.d.ts.map +1 -0
  20. package/cjs/lib/appendFileSync.js +23 -0
  21. package/cjs/lib/appendFileSync.js.map +1 -0
  22. package/{src → cjs}/lib/createDirectory.d.ts +1 -5
  23. package/cjs/lib/createDirectory.d.ts.map +1 -0
  24. package/cjs/lib/createDirectory.js +18 -0
  25. package/cjs/lib/createDirectory.js.map +1 -0
  26. package/{src → cjs}/lib/createDirectorySync.d.ts +1 -3
  27. package/cjs/lib/createDirectorySync.d.ts.map +1 -0
  28. package/{src → cjs}/lib/createDirectorySync.js +2 -5
  29. package/cjs/lib/createDirectorySync.js.map +1 -0
  30. package/cjs/lib/emptyDirectory.d.ts +17 -0
  31. package/cjs/lib/emptyDirectory.d.ts.map +1 -0
  32. package/cjs/lib/emptyDirectory.js +26 -0
  33. package/cjs/lib/emptyDirectory.js.map +1 -0
  34. package/cjs/lib/emptyDirectorySync.d.ts +17 -0
  35. package/cjs/lib/emptyDirectorySync.d.ts.map +1 -0
  36. package/cjs/lib/emptyDirectorySync.js +29 -0
  37. package/cjs/lib/emptyDirectorySync.js.map +1 -0
  38. package/{src → cjs}/lib/getJsonIndentation.d.ts +1 -0
  39. package/cjs/lib/getJsonIndentation.d.ts.map +1 -0
  40. package/{src → cjs}/lib/getJsonIndentation.js +2 -2
  41. package/{src → cjs}/lib/getJsonIndentation.js.map +1 -1
  42. package/{src → cjs}/lib/getLastMofifiedFileIn.d.ts +1 -0
  43. package/cjs/lib/getLastMofifiedFileIn.d.ts.map +1 -0
  44. package/cjs/lib/getLastMofifiedFileIn.js +20 -0
  45. package/cjs/lib/getLastMofifiedFileIn.js.map +1 -0
  46. package/cjs/lib/promptUserEditInTextEditor.d.ts +10 -0
  47. package/cjs/lib/promptUserEditInTextEditor.d.ts.map +1 -0
  48. package/cjs/lib/promptUserEditInTextEditor.js +29 -0
  49. package/cjs/lib/promptUserEditInTextEditor.js.map +1 -0
  50. package/cjs/lib/promptUserEditInTextEditorSync.d.ts +10 -0
  51. package/cjs/lib/promptUserEditInTextEditorSync.d.ts.map +1 -0
  52. package/cjs/lib/promptUserEditInTextEditorSync.js +27 -0
  53. package/cjs/lib/promptUserEditInTextEditorSync.js.map +1 -0
  54. package/cjs/lib/promptUserEditJsonInTextEditor.d.ts +13 -0
  55. package/cjs/lib/promptUserEditJsonInTextEditor.d.ts.map +1 -0
  56. package/cjs/lib/promptUserEditJsonInTextEditor.js +25 -0
  57. package/cjs/lib/promptUserEditJsonInTextEditor.js.map +1 -0
  58. package/cjs/lib/promptUserEditJsonInTextEditorSync.d.ts +13 -0
  59. package/cjs/lib/promptUserEditJsonInTextEditorSync.d.ts.map +1 -0
  60. package/cjs/lib/promptUserEditJsonInTextEditorSync.js +25 -0
  61. package/cjs/lib/promptUserEditJsonInTextEditorSync.js.map +1 -0
  62. package/cjs/lib/readDirectoryDirents.d.ts +11 -0
  63. package/cjs/lib/readDirectoryDirents.d.ts.map +1 -0
  64. package/cjs/lib/readDirectoryDirents.js +17 -0
  65. package/cjs/lib/readDirectoryDirents.js.map +1 -0
  66. package/cjs/lib/readDirectoryDirentsPaths.d.ts +14 -0
  67. package/cjs/lib/readDirectoryDirentsPaths.d.ts.map +1 -0
  68. package/cjs/lib/readDirectoryDirentsPaths.js +27 -0
  69. package/cjs/lib/readDirectoryDirentsPaths.js.map +1 -0
  70. package/cjs/lib/readDirectoryDirentsPathsSafe.d.ts +15 -0
  71. package/cjs/lib/readDirectoryDirentsPathsSafe.d.ts.map +1 -0
  72. package/cjs/lib/readDirectoryDirentsPathsSafe.js +22 -0
  73. package/cjs/lib/readDirectoryDirentsPathsSafe.js.map +1 -0
  74. package/cjs/lib/readDirectoryDirentsPathsSafeSync.d.ts +15 -0
  75. package/cjs/lib/readDirectoryDirentsPathsSafeSync.d.ts.map +1 -0
  76. package/cjs/lib/readDirectoryDirentsPathsSafeSync.js +22 -0
  77. package/cjs/lib/readDirectoryDirentsPathsSafeSync.js.map +1 -0
  78. package/cjs/lib/readDirectoryDirentsPathsSync.d.ts +14 -0
  79. package/cjs/lib/readDirectoryDirentsPathsSync.d.ts.map +1 -0
  80. package/cjs/lib/readDirectoryDirentsPathsSync.js +27 -0
  81. package/cjs/lib/readDirectoryDirentsPathsSync.js.map +1 -0
  82. package/cjs/lib/readDirectoryDirentsSafe.d.ts +12 -0
  83. package/cjs/lib/readDirectoryDirentsSafe.d.ts.map +1 -0
  84. package/cjs/lib/readDirectoryDirentsSafe.js +20 -0
  85. package/cjs/lib/readDirectoryDirentsSafe.js.map +1 -0
  86. package/cjs/lib/readDirectoryDirentsSafeSync.d.ts +12 -0
  87. package/cjs/lib/readDirectoryDirentsSafeSync.d.ts.map +1 -0
  88. package/cjs/lib/readDirectoryDirentsSafeSync.js +20 -0
  89. package/cjs/lib/readDirectoryDirentsSafeSync.js.map +1 -0
  90. package/cjs/lib/readDirectoryDirentsSync.d.ts +11 -0
  91. package/cjs/lib/readDirectoryDirentsSync.d.ts.map +1 -0
  92. package/cjs/lib/readDirectoryDirentsSync.js +17 -0
  93. package/cjs/lib/readDirectoryDirentsSync.js.map +1 -0
  94. package/cjs/lib/readDirectoryNames.d.ts +7 -0
  95. package/cjs/lib/readDirectoryNames.d.ts.map +1 -0
  96. package/cjs/lib/readDirectoryNames.js +15 -0
  97. package/cjs/lib/readDirectoryNames.js.map +1 -0
  98. package/cjs/lib/readDirectoryNamesPaths.d.ts +11 -0
  99. package/cjs/lib/readDirectoryNamesPaths.d.ts.map +1 -0
  100. package/cjs/lib/readDirectoryNamesPaths.js +24 -0
  101. package/cjs/lib/readDirectoryNamesPaths.js.map +1 -0
  102. package/cjs/lib/readDirectoryNamesPathsSafe.d.ts +12 -0
  103. package/cjs/lib/readDirectoryNamesPathsSafe.d.ts.map +1 -0
  104. package/cjs/lib/readDirectoryNamesPathsSafe.js +20 -0
  105. package/cjs/lib/readDirectoryNamesPathsSafe.js.map +1 -0
  106. package/cjs/lib/readDirectoryNamesPathsSafeSync.d.ts +12 -0
  107. package/cjs/lib/readDirectoryNamesPathsSafeSync.d.ts.map +1 -0
  108. package/cjs/lib/readDirectoryNamesPathsSafeSync.js +20 -0
  109. package/cjs/lib/readDirectoryNamesPathsSafeSync.js.map +1 -0
  110. package/cjs/lib/readDirectoryNamesPathsSync.d.ts +11 -0
  111. package/cjs/lib/readDirectoryNamesPathsSync.d.ts.map +1 -0
  112. package/cjs/lib/readDirectoryNamesPathsSync.js +24 -0
  113. package/cjs/lib/readDirectoryNamesPathsSync.js.map +1 -0
  114. package/cjs/lib/readDirectoryNamesSafe.d.ts +8 -0
  115. package/cjs/lib/readDirectoryNamesSafe.d.ts.map +1 -0
  116. package/cjs/lib/readDirectoryNamesSafe.js +18 -0
  117. package/cjs/lib/readDirectoryNamesSafe.js.map +1 -0
  118. package/cjs/lib/readDirectoryNamesSafeSync.d.ts +8 -0
  119. package/cjs/lib/readDirectoryNamesSafeSync.d.ts.map +1 -0
  120. package/cjs/lib/readDirectoryNamesSafeSync.js +18 -0
  121. package/cjs/lib/readDirectoryNamesSafeSync.js.map +1 -0
  122. package/cjs/lib/readDirectoryNamesSync.d.ts +7 -0
  123. package/cjs/lib/readDirectoryNamesSync.d.ts.map +1 -0
  124. package/cjs/lib/readDirectoryNamesSync.js +15 -0
  125. package/cjs/lib/readDirectoryNamesSync.js.map +1 -0
  126. package/cjs/lib/readDirectoryPaths.d.ts +7 -0
  127. package/cjs/lib/readDirectoryPaths.d.ts.map +1 -0
  128. package/cjs/lib/readDirectoryPaths.js +18 -0
  129. package/cjs/lib/readDirectoryPaths.js.map +1 -0
  130. package/cjs/lib/readDirectoryPathsSafe.d.ts +8 -0
  131. package/cjs/lib/readDirectoryPathsSafe.d.ts.map +1 -0
  132. package/cjs/lib/readDirectoryPathsSafe.js +19 -0
  133. package/cjs/lib/readDirectoryPathsSafe.js.map +1 -0
  134. package/cjs/lib/readDirectoryPathsSafeSync.d.ts +8 -0
  135. package/cjs/lib/readDirectoryPathsSafeSync.d.ts.map +1 -0
  136. package/cjs/lib/readDirectoryPathsSafeSync.js +19 -0
  137. package/cjs/lib/readDirectoryPathsSafeSync.js.map +1 -0
  138. package/cjs/lib/readDirectoryPathsSync.d.ts +7 -0
  139. package/cjs/lib/readDirectoryPathsSync.d.ts.map +1 -0
  140. package/cjs/lib/readDirectoryPathsSync.js +18 -0
  141. package/cjs/lib/readDirectoryPathsSync.js.map +1 -0
  142. package/cjs/lib/readDirectoryStats.d.ts +13 -0
  143. package/cjs/lib/readDirectoryStats.d.ts.map +1 -0
  144. package/cjs/lib/readDirectoryStats.js +33 -0
  145. package/cjs/lib/readDirectoryStats.js.map +1 -0
  146. package/cjs/lib/readDirectoryStatsSafe.d.ts +14 -0
  147. package/cjs/lib/readDirectoryStatsSafe.d.ts.map +1 -0
  148. package/cjs/lib/readDirectoryStatsSafe.js +20 -0
  149. package/cjs/lib/readDirectoryStatsSafe.js.map +1 -0
  150. package/cjs/lib/readDirectoryStatsSafeSync.d.ts +14 -0
  151. package/cjs/lib/readDirectoryStatsSafeSync.d.ts.map +1 -0
  152. package/cjs/lib/readDirectoryStatsSafeSync.js +20 -0
  153. package/cjs/lib/readDirectoryStatsSafeSync.js.map +1 -0
  154. package/cjs/lib/readDirectoryStatsSync.d.ts +13 -0
  155. package/cjs/lib/readDirectoryStatsSync.d.ts.map +1 -0
  156. package/cjs/lib/readDirectoryStatsSync.js +32 -0
  157. package/cjs/lib/readDirectoryStatsSync.js.map +1 -0
  158. package/cjs/lib/readFile.d.ts +22 -0
  159. package/cjs/lib/readFile.d.ts.map +1 -0
  160. package/cjs/lib/readFile.js +21 -0
  161. package/cjs/lib/readFile.js.map +1 -0
  162. package/cjs/lib/readFileBuffer.d.ts +20 -0
  163. package/cjs/lib/readFileBuffer.d.ts.map +1 -0
  164. package/cjs/lib/readFileBuffer.js +20 -0
  165. package/cjs/lib/readFileBuffer.js.map +1 -0
  166. package/cjs/lib/readFileBufferSafe.d.ts +12 -0
  167. package/cjs/lib/readFileBufferSafe.d.ts.map +1 -0
  168. package/cjs/lib/readFileBufferSafe.js +24 -0
  169. package/cjs/lib/readFileBufferSafe.js.map +1 -0
  170. package/cjs/lib/readFileBufferSafeSync.d.ts +12 -0
  171. package/cjs/lib/readFileBufferSafeSync.d.ts.map +1 -0
  172. package/cjs/lib/readFileBufferSafeSync.js +24 -0
  173. package/cjs/lib/readFileBufferSafeSync.js.map +1 -0
  174. package/cjs/lib/readFileBufferSync.d.ts +10 -0
  175. package/cjs/lib/readFileBufferSync.d.ts.map +1 -0
  176. package/cjs/lib/readFileBufferSync.js +17 -0
  177. package/cjs/lib/readFileBufferSync.js.map +1 -0
  178. package/cjs/lib/readFileSafe.d.ts +14 -0
  179. package/cjs/lib/readFileSafe.d.ts.map +1 -0
  180. package/cjs/lib/readFileSafe.js +26 -0
  181. package/cjs/lib/readFileSafe.js.map +1 -0
  182. package/cjs/lib/readFileSafeSync.d.ts +14 -0
  183. package/cjs/lib/readFileSafeSync.d.ts.map +1 -0
  184. package/cjs/lib/readFileSafeSync.js +26 -0
  185. package/cjs/lib/readFileSafeSync.js.map +1 -0
  186. package/cjs/lib/readFileSync.d.ts +11 -0
  187. package/cjs/lib/readFileSync.d.ts.map +1 -0
  188. package/cjs/lib/readFileSync.js +18 -0
  189. package/cjs/lib/readFileSync.js.map +1 -0
  190. package/cjs/lib/readJsonFile.d.ts +2 -0
  191. package/cjs/lib/readJsonFile.d.ts.map +1 -0
  192. package/cjs/lib/readJsonFile.js +6 -0
  193. package/cjs/lib/readJsonFile.js.map +1 -0
  194. package/cjs/lib/readJsonFileSafe.d.ts +10 -0
  195. package/cjs/lib/readJsonFileSafe.d.ts.map +1 -0
  196. package/cjs/lib/readJsonFileSafe.js +22 -0
  197. package/cjs/lib/readJsonFileSafe.js.map +1 -0
  198. package/cjs/lib/readJsonFileSafeSync.d.ts +10 -0
  199. package/cjs/lib/readJsonFileSafeSync.d.ts.map +1 -0
  200. package/cjs/lib/readJsonFileSafeSync.js +22 -0
  201. package/cjs/lib/readJsonFileSafeSync.js.map +1 -0
  202. package/cjs/lib/readJsonFileSync.d.ts +2 -0
  203. package/cjs/lib/readJsonFileSync.d.ts.map +1 -0
  204. package/cjs/lib/readJsonFileSync.js +6 -0
  205. package/cjs/lib/readJsonFileSync.js.map +1 -0
  206. package/cjs/lib/removeDirectory.d.ts +2 -0
  207. package/cjs/lib/removeDirectory.d.ts.map +1 -0
  208. package/cjs/lib/removeDirectory.js +6 -0
  209. package/cjs/lib/removeDirectory.js.map +1 -0
  210. package/cjs/lib/removeDirectorySync.d.ts +2 -0
  211. package/cjs/lib/removeDirectorySync.d.ts.map +1 -0
  212. package/cjs/lib/removeDirectorySync.js +6 -0
  213. package/cjs/lib/removeDirectorySync.js.map +1 -0
  214. package/cjs/lib/removeFile.d.ts +2 -0
  215. package/cjs/lib/removeFile.d.ts.map +1 -0
  216. package/cjs/lib/removeFile.js +6 -0
  217. package/cjs/lib/removeFile.js.map +1 -0
  218. package/cjs/lib/removeFileSync.d.ts +2 -0
  219. package/cjs/lib/removeFileSync.d.ts.map +1 -0
  220. package/cjs/lib/removeFileSync.js +6 -0
  221. package/cjs/lib/removeFileSync.js.map +1 -0
  222. package/{src → cjs}/lib/tempFile.d.ts +3 -2
  223. package/cjs/lib/tempFile.d.ts.map +1 -0
  224. package/cjs/lib/tempFile.js +27 -0
  225. package/cjs/lib/tempFile.js.map +1 -0
  226. package/cjs/lib/tempFileSync.d.ts +7 -0
  227. package/cjs/lib/tempFileSync.d.ts.map +1 -0
  228. package/cjs/lib/tempFileSync.js +27 -0
  229. package/cjs/lib/tempFileSync.js.map +1 -0
  230. package/cjs/lib/types/IGetUserInputFromEditorOptions.d.ts +16 -0
  231. package/cjs/lib/types/IGetUserInputFromEditorOptions.d.ts.map +1 -0
  232. package/{src/lib/types/IEnsureValidWindowsPathOptions.js → cjs/lib/types/IGetUserInputFromEditorOptions.js} +1 -1
  233. package/cjs/lib/types/IGetUserInputFromEditorOptions.js.map +1 -0
  234. package/cjs/lib/types/IJFReadOptions.d.ts +2 -0
  235. package/cjs/lib/types/IJFReadOptions.d.ts.map +1 -0
  236. package/cjs/lib/types/IJFReadOptions.js +3 -0
  237. package/cjs/lib/types/IJFReadOptions.js.map +1 -0
  238. package/cjs/lib/types/IJFWriteOptions.d.ts +2 -0
  239. package/cjs/lib/types/IJFWriteOptions.d.ts.map +1 -0
  240. package/cjs/lib/types/IJFWriteOptions.js +3 -0
  241. package/cjs/lib/types/IJFWriteOptions.js.map +1 -0
  242. package/cjs/lib/types/IJsonOutputOptions.d.ts +2 -0
  243. package/cjs/lib/types/IJsonOutputOptions.d.ts.map +1 -0
  244. package/cjs/lib/types/IJsonOutputOptions.js +3 -0
  245. package/cjs/lib/types/IJsonOutputOptions.js.map +1 -0
  246. package/{src → cjs}/lib/types/ILogFileData.d.ts +1 -0
  247. package/cjs/lib/types/ILogFileData.d.ts.map +1 -0
  248. package/cjs/lib/types/IReadJsonFileOptions.d.ts +2 -0
  249. package/cjs/lib/types/IReadJsonFileOptions.d.ts.map +1 -0
  250. package/cjs/lib/types/IReadJsonFileOptions.js +3 -0
  251. package/cjs/lib/types/IReadJsonFileOptions.js.map +1 -0
  252. package/cjs/lib/types/JsonReplacerReviver.d.ts +2 -0
  253. package/cjs/lib/types/JsonReplacerReviver.d.ts.map +1 -0
  254. package/cjs/lib/types/JsonReplacerReviver.js +3 -0
  255. package/cjs/lib/types/JsonReplacerReviver.js.map +1 -0
  256. package/cjs/lib/updateFile.d.ts +11 -0
  257. package/cjs/lib/updateFile.d.ts.map +1 -0
  258. package/cjs/lib/updateFile.js +20 -0
  259. package/cjs/lib/updateFile.js.map +1 -0
  260. package/cjs/lib/updateFileSafe.d.ts +13 -0
  261. package/cjs/lib/updateFileSafe.d.ts.map +1 -0
  262. package/cjs/lib/updateFileSafe.js +28 -0
  263. package/cjs/lib/updateFileSafe.js.map +1 -0
  264. package/cjs/lib/updateFileSafeSync.d.ts +13 -0
  265. package/cjs/lib/updateFileSafeSync.d.ts.map +1 -0
  266. package/cjs/lib/updateFileSafeSync.js +28 -0
  267. package/cjs/lib/updateFileSafeSync.js.map +1 -0
  268. package/cjs/lib/updateFileSync.d.ts +11 -0
  269. package/cjs/lib/updateFileSync.d.ts.map +1 -0
  270. package/cjs/lib/updateFileSync.js +20 -0
  271. package/cjs/lib/updateFileSync.js.map +1 -0
  272. package/cjs/lib/updateJsonFile.d.ts +15 -0
  273. package/cjs/lib/updateJsonFile.d.ts.map +1 -0
  274. package/cjs/lib/updateJsonFile.js +20 -0
  275. package/cjs/lib/updateJsonFile.js.map +1 -0
  276. package/cjs/lib/updateJsonFileSafe.d.ts +17 -0
  277. package/cjs/lib/updateJsonFileSafe.d.ts.map +1 -0
  278. package/cjs/lib/updateJsonFileSafe.js +28 -0
  279. package/cjs/lib/updateJsonFileSafe.js.map +1 -0
  280. package/cjs/lib/updateJsonFileSafeSync.d.ts +17 -0
  281. package/cjs/lib/updateJsonFileSafeSync.d.ts.map +1 -0
  282. package/cjs/lib/updateJsonFileSafeSync.js +28 -0
  283. package/cjs/lib/updateJsonFileSafeSync.js.map +1 -0
  284. package/cjs/lib/updateJsonFileSync.d.ts +15 -0
  285. package/cjs/lib/updateJsonFileSync.d.ts.map +1 -0
  286. package/cjs/lib/updateJsonFileSync.js +20 -0
  287. package/cjs/lib/updateJsonFileSync.js.map +1 -0
  288. package/cjs/lib/writeFile.d.ts +2 -0
  289. package/cjs/lib/writeFile.d.ts.map +1 -0
  290. package/cjs/lib/writeFile.js +6 -0
  291. package/cjs/lib/writeFile.js.map +1 -0
  292. package/cjs/lib/writeFileSafe.d.ts +2 -0
  293. package/cjs/lib/writeFileSafe.d.ts.map +1 -0
  294. package/cjs/lib/writeFileSafe.js +6 -0
  295. package/cjs/lib/writeFileSafe.js.map +1 -0
  296. package/cjs/lib/writeFileSafeSync.d.ts +2 -0
  297. package/cjs/lib/writeFileSafeSync.d.ts.map +1 -0
  298. package/cjs/lib/writeFileSafeSync.js +6 -0
  299. package/cjs/lib/writeFileSafeSync.js.map +1 -0
  300. package/cjs/lib/writeFileSync.d.ts +2 -0
  301. package/cjs/lib/writeFileSync.d.ts.map +1 -0
  302. package/cjs/lib/writeFileSync.js +6 -0
  303. package/cjs/lib/writeFileSync.js.map +1 -0
  304. package/cjs/lib/writeJsonFile.d.ts +2 -0
  305. package/cjs/lib/writeJsonFile.d.ts.map +1 -0
  306. package/cjs/lib/writeJsonFile.js +6 -0
  307. package/cjs/lib/writeJsonFile.js.map +1 -0
  308. package/cjs/lib/writeJsonFileSafe.d.ts +2 -0
  309. package/cjs/lib/writeJsonFileSafe.d.ts.map +1 -0
  310. package/cjs/lib/writeJsonFileSafe.js +6 -0
  311. package/cjs/lib/writeJsonFileSafe.js.map +1 -0
  312. package/cjs/lib/writeJsonFileSafeSync.d.ts +2 -0
  313. package/cjs/lib/writeJsonFileSafeSync.d.ts.map +1 -0
  314. package/cjs/lib/writeJsonFileSafeSync.js +6 -0
  315. package/cjs/lib/writeJsonFileSafeSync.js.map +1 -0
  316. package/cjs/lib/writeJsonFileSync.d.ts +2 -0
  317. package/cjs/lib/writeJsonFileSync.d.ts.map +1 -0
  318. package/cjs/lib/writeJsonFileSync.js +6 -0
  319. package/cjs/lib/writeJsonFileSync.js.map +1 -0
  320. package/package.json +11 -17
  321. package/src/index.d.ts +0 -35
  322. package/src/index.js +0 -39
  323. package/src/index.js.map +0 -1
  324. package/src/lib/AppData.d.ts +0 -10
  325. package/src/lib/AppData.js +0 -24
  326. package/src/lib/AppData.js.map +0 -1
  327. package/src/lib/JsonFile.d.ts +0 -78
  328. package/src/lib/JsonFile.js +0 -158
  329. package/src/lib/JsonFile.js.map +0 -1
  330. package/src/lib/LogFile.d.ts +0 -50
  331. package/src/lib/LogFile.js +0 -158
  332. package/src/lib/LogFile.js.map +0 -1
  333. package/src/lib/absoluteToRelativePath.d.ts +0 -13
  334. package/src/lib/absoluteToRelativePath.js +0 -25
  335. package/src/lib/absoluteToRelativePath.js.map +0 -1
  336. package/src/lib/appendLineToFile.d.ts +0 -11
  337. package/src/lib/appendLineToFile.js +0 -28
  338. package/src/lib/appendLineToFile.js.map +0 -1
  339. package/src/lib/cleanDirectorySync.d.ts +0 -16
  340. package/src/lib/cleanDirectorySync.js +0 -29
  341. package/src/lib/cleanDirectorySync.js.map +0 -1
  342. package/src/lib/createDirectory.js +0 -25
  343. package/src/lib/createDirectory.js.map +0 -1
  344. package/src/lib/createDirectorySync.js.map +0 -1
  345. package/src/lib/createFileExtensionFilter.d.ts +0 -13
  346. package/src/lib/createFileExtensionFilter.js +0 -32
  347. package/src/lib/createFileExtensionFilter.js.map +0 -1
  348. package/src/lib/cwdpath.d.ts +0 -12
  349. package/src/lib/cwdpath.js +0 -21
  350. package/src/lib/cwdpath.js.map +0 -1
  351. package/src/lib/deleteDirectory.d.ts +0 -12
  352. package/src/lib/deleteDirectory.js +0 -23
  353. package/src/lib/deleteDirectory.js.map +0 -1
  354. package/src/lib/deleteDirectorySafe.d.ts +0 -13
  355. package/src/lib/deleteDirectorySafe.js +0 -25
  356. package/src/lib/deleteDirectorySafe.js.map +0 -1
  357. package/src/lib/deleteDirectorySafeSync.d.ts +0 -11
  358. package/src/lib/deleteDirectorySafeSync.js +0 -23
  359. package/src/lib/deleteDirectorySafeSync.js.map +0 -1
  360. package/src/lib/deleteDirectorySync.d.ts +0 -12
  361. package/src/lib/deleteDirectorySync.js +0 -22
  362. package/src/lib/deleteDirectorySync.js.map +0 -1
  363. package/src/lib/ensureValidWindowsPath.d.ts +0 -22
  364. package/src/lib/ensureValidWindowsPath.js +0 -54
  365. package/src/lib/ensureValidWindowsPath.js.map +0 -1
  366. package/src/lib/getDiskDrivesWindows.d.ts +0 -1
  367. package/src/lib/getDiskDrivesWindows.js +0 -19
  368. package/src/lib/getDiskDrivesWindows.js.map +0 -1
  369. package/src/lib/getDownloadsDirectory.d.ts +0 -1
  370. package/src/lib/getDownloadsDirectory.js +0 -11
  371. package/src/lib/getDownloadsDirectory.js.map +0 -1
  372. package/src/lib/getHomeDirectory.d.ts +0 -1
  373. package/src/lib/getHomeDirectory.js +0 -13
  374. package/src/lib/getHomeDirectory.js.map +0 -1
  375. package/src/lib/getLastMofifiedFileIn.js +0 -22
  376. package/src/lib/getLastMofifiedFileIn.js.map +0 -1
  377. package/src/lib/getRootDir.d.ts +0 -1
  378. package/src/lib/getRootDir.js +0 -10
  379. package/src/lib/getRootDir.js.map +0 -1
  380. package/src/lib/normalizeFileExtension.d.ts +0 -22
  381. package/src/lib/normalizeFileExtension.js +0 -36
  382. package/src/lib/normalizeFileExtension.js.map +0 -1
  383. package/src/lib/readFileLastLines.d.ts +0 -7
  384. package/src/lib/readFileLastLines.js +0 -18
  385. package/src/lib/readFileLastLines.js.map +0 -1
  386. package/src/lib/readJsonFile.d.ts +0 -12
  387. package/src/lib/readJsonFile.js +0 -23
  388. package/src/lib/readJsonFile.js.map +0 -1
  389. package/src/lib/readJsonFileSync.d.ts +0 -12
  390. package/src/lib/readJsonFileSync.js +0 -21
  391. package/src/lib/readJsonFileSync.js.map +0 -1
  392. package/src/lib/readPackageJson.d.ts +0 -1
  393. package/src/lib/readPackageJson.js +0 -15
  394. package/src/lib/readPackageJson.js.map +0 -1
  395. package/src/lib/removeIllegalFilenameCharacters.d.ts +0 -1
  396. package/src/lib/removeIllegalFilenameCharacters.js +0 -8
  397. package/src/lib/removeIllegalFilenameCharacters.js.map +0 -1
  398. package/src/lib/tempFile.js +0 -26
  399. package/src/lib/tempFile.js.map +0 -1
  400. package/src/lib/types/IEnsureValidWindowsPathOptions.d.ts +0 -10
  401. package/src/lib/types/IEnsureValidWindowsPathOptions.js.map +0 -1
  402. package/src/lib/updateJsonFile.d.ts +0 -18
  403. package/src/lib/updateJsonFile.js +0 -44
  404. package/src/lib/updateJsonFile.js.map +0 -1
  405. package/src/lib/updateJsonFileSync.d.ts +0 -18
  406. package/src/lib/updateJsonFileSync.js +0 -42
  407. package/src/lib/updateJsonFileSync.js.map +0 -1
  408. package/src/lib/wipeDirectorySafe.d.ts +0 -1
  409. package/src/lib/wipeDirectorySafe.js +0 -14
  410. package/src/lib/wipeDirectorySafe.js.map +0 -1
  411. package/src/lib/writeJsonFile.d.ts +0 -14
  412. package/src/lib/writeJsonFile.js +0 -25
  413. package/src/lib/writeJsonFile.js.map +0 -1
  414. package/src/lib/writeJsonFileSync.d.ts +0 -13
  415. package/src/lib/writeJsonFileSync.js +0 -22
  416. package/src/lib/writeJsonFileSync.js.map +0 -1
  417. /package/{src → cjs}/lib/types/ILogFileData.js +0 -0
  418. /package/{src → cjs}/lib/types/ILogFileData.js.map +0 -0
@@ -1,158 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const path_1 = tslib_1.__importDefault(require("path"));
7
- const readline_1 = tslib_1.__importDefault(require("readline"));
8
- /**
9
- * Represents a log file manager that appends log entries to a file.
10
- * It does not ensure extremely precise ordering of log entries' timestamps if used asynchronously. It logs them as they are received.
11
- */
12
- class LogFile {
13
- /**
14
- * Creates a new instance of the LogFile class.
15
- * @param filepath - The path to the log file.
16
- */
17
- constructor(filepath) {
18
- this.filepath = filepath;
19
- this.ensureDirectoryExists();
20
- }
21
- /**
22
- * Appends a log entry to the log file.
23
- * @param data - The data to be logged.
24
- * @param time - The timestamp of the log entry. Defaults to the current time.
25
- * @returns A promise that resolves when the log entry is appended.
26
- */
27
- append(data, time = Date.now()) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- yield fs_1.default.promises.appendFile(this.filepath, time + '|' + JSON.stringify(data) + '\n', 'utf8');
30
- });
31
- }
32
- /**
33
- * Resets the log file by removing it.
34
- */
35
- reset() {
36
- fs_1.default.rmSync(this.filepath);
37
- }
38
- /**
39
- * Reads the log entire file and returns an array of log entries, sorted by timestamp in descending order.
40
- * @returns An array of log entries, sorted by timestamp in descending order.
41
- */
42
- readFile() {
43
- const data = fs_1.default.readFileSync(this.filepath, 'utf8');
44
- const lines = data.split('\n');
45
- const result = [];
46
- for (const line of lines) {
47
- const i = line.indexOf('|');
48
- if (i === -1)
49
- continue;
50
- const time = parseInt(line.substring(0, i));
51
- const data = JSON.parse(line.substring(i + 1));
52
- result.push([time, data]);
53
- }
54
- return result.sort((a, b) => b[0] - a[0]);
55
- }
56
- /**
57
- * Returns an async generator that yields the timestamps of log entries in the log file.
58
- * @yields The timestamps of log entries.
59
- */
60
- keys() {
61
- return tslib_1.__asyncGenerator(this, arguments, function* keys_1() {
62
- var _a, e_1, _b, _c;
63
- const fileStream = fs_1.default.createReadStream(this.filepath, 'utf8');
64
- const rl = readline_1.default.createInterface({
65
- input: fileStream,
66
- crlfDelay: Infinity,
67
- });
68
- try {
69
- for (var _d = true, rl_1 = tslib_1.__asyncValues(rl), rl_1_1; rl_1_1 = yield tslib_1.__await(rl_1.next()), _a = rl_1_1.done, !_a; _d = true) {
70
- _c = rl_1_1.value;
71
- _d = false;
72
- const line = _c;
73
- const i = line.indexOf('|');
74
- const time = parseInt(line.substring(0, i));
75
- yield yield tslib_1.__await(time);
76
- }
77
- }
78
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
79
- finally {
80
- try {
81
- if (!_d && !_a && (_b = rl_1.return)) yield tslib_1.__await(_b.call(rl_1));
82
- }
83
- finally { if (e_1) throw e_1.error; }
84
- }
85
- });
86
- }
87
- /**
88
- * Returns an async generator that yields the values of log entries in the log file.
89
- * @yields The values of log entries.
90
- */
91
- values() {
92
- return tslib_1.__asyncGenerator(this, arguments, function* values_1() {
93
- var _a, e_2, _b, _c;
94
- const fileStream = fs_1.default.createReadStream(this.filepath, 'utf8');
95
- const rl = readline_1.default.createInterface({
96
- input: fileStream,
97
- crlfDelay: Infinity,
98
- });
99
- try {
100
- for (var _d = true, rl_2 = tslib_1.__asyncValues(rl), rl_2_1; rl_2_1 = yield tslib_1.__await(rl_2.next()), _a = rl_2_1.done, !_a; _d = true) {
101
- _c = rl_2_1.value;
102
- _d = false;
103
- const line = _c;
104
- const i = line.indexOf('|');
105
- const data = JSON.parse(line.substring(i + 1));
106
- yield yield tslib_1.__await(data);
107
- }
108
- }
109
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
110
- finally {
111
- try {
112
- if (!_d && !_a && (_b = rl_2.return)) yield tslib_1.__await(_b.call(rl_2));
113
- }
114
- finally { if (e_2) throw e_2.error; }
115
- }
116
- });
117
- }
118
- /**
119
- * Returns an async generator that yields the entries (timestamp and value) of log entries in the log file.
120
- * @yields The entries (timestamp and value) of log entries.
121
- */
122
- entries() {
123
- return tslib_1.__asyncGenerator(this, arguments, function* entries_1() {
124
- var _a, e_3, _b, _c;
125
- const fileStream = fs_1.default.createReadStream(this.filepath, 'utf8');
126
- const rl = readline_1.default.createInterface({
127
- input: fileStream,
128
- crlfDelay: Infinity,
129
- });
130
- try {
131
- for (var _d = true, rl_3 = tslib_1.__asyncValues(rl), rl_3_1; rl_3_1 = yield tslib_1.__await(rl_3.next()), _a = rl_3_1.done, !_a; _d = true) {
132
- _c = rl_3_1.value;
133
- _d = false;
134
- const line = _c;
135
- const i = line.indexOf('|');
136
- const time = parseInt(line.substring(0, i));
137
- const data = JSON.parse(line.substring(i + 1));
138
- yield yield tslib_1.__await([time, data]);
139
- }
140
- }
141
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
142
- finally {
143
- try {
144
- if (!_d && !_a && (_b = rl_3.return)) yield tslib_1.__await(_b.call(rl_3));
145
- }
146
- finally { if (e_3) throw e_3.error; }
147
- }
148
- });
149
- }
150
- /**
151
- * Ensures that the directory containing the log file exists.
152
- */
153
- ensureDirectoryExists() {
154
- fs_1.default.mkdirSync(path_1.default.dirname(this.filepath), { recursive: true });
155
- }
156
- }
157
- exports.LogFile = LogFile;
158
- //# sourceMappingURL=LogFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LogFile.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/LogFile.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,wDAAuB;AACvB,gEAA+B;AAE/B;;;GAGG;AACH,MAAa,OAAO;IAMlB;;;OAGG;IACH,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,qBAAqB,EAAE,CAAA;IAC9B,CAAC;IAED;;;;;OAKG;IACG,MAAM,CAAC,IAAO,EAAE,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE;;YACrC,MAAM,YAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAA;QAC/F,CAAC;KAAA;IAED;;OAEG;IACH,KAAK;QACH,YAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC1B,CAAC;IAED;;;OAGG;IACH,QAAQ;QACN,MAAM,IAAI,GAAG,YAAE,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9B,MAAM,MAAM,GAAG,EAAmB,CAAA;QAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,CAAC,CAAC;gBAAE,SAAQ;YACtB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;YAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,CAAA;YACnD,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;SAC1B;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3C,CAAC;IAED;;;OAGG;IACI,IAAI;;;YACT,MAAM,UAAU,GAAG,YAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAC7D,MAAM,EAAE,GAAG,kBAAQ,CAAC,eAAe,CAAC;gBAClC,KAAK,EAAE,UAAU;gBACjB,SAAS,EAAE,QAAQ;aACpB,CAAC,CAAA;;gBACF,KAAyB,eAAA,OAAA,sBAAA,EAAE,CAAA,QAAA,iFAAE;oBAAJ,kBAAE;oBAAF,WAAE;oBAAhB,MAAM,IAAI,KAAA,CAAA;oBACnB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;oBAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;oBAC3C,4BAAM,IAAI,CAAA,CAAA;iBACX;;;;;;;;;QACH,CAAC;KAAA;IAED;;;OAGG;IACI,MAAM;;;YACX,MAAM,UAAU,GAAG,YAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAC7D,MAAM,EAAE,GAAG,kBAAQ,CAAC,eAAe,CAAC;gBAClC,KAAK,EAAE,UAAU;gBACjB,SAAS,EAAE,QAAQ;aACpB,CAAC,CAAA;;gBACF,KAAyB,eAAA,OAAA,sBAAA,EAAE,CAAA,QAAA,iFAAE;oBAAJ,kBAAE;oBAAF,WAAE;oBAAhB,MAAM,IAAI,KAAA,CAAA;oBACnB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;oBAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,CAAA;oBACnD,4BAAM,IAAI,CAAA,CAAA;iBACX;;;;;;;;;QACH,CAAC;KAAA;IAED;;;OAGG;IACI,OAAO;;;YACZ,MAAM,UAAU,GAAG,YAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAC7D,MAAM,EAAE,GAAG,kBAAQ,CAAC,eAAe,CAAC;gBAClC,KAAK,EAAE,UAAU;gBACjB,SAAS,EAAE,QAAQ;aACpB,CAAC,CAAA;;gBACF,KAAyB,eAAA,OAAA,sBAAA,EAAE,CAAA,QAAA,iFAAE;oBAAJ,kBAAE;oBAAF,WAAE;oBAAhB,MAAM,IAAI,KAAA,CAAA;oBACnB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;oBAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;oBAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,CAAM,CAAA;oBACnD,4BAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA,CAAA;iBACnB;;;;;;;;;QACH,CAAC;KAAA;IAED;;OAEG;IACH,qBAAqB;QACnB,YAAE,CAAC,SAAS,CAAC,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChE,CAAC;CACF;AA5GD,0BA4GC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * If the filepath is somewhere in the current working directory, it can be converted into a relative path.
3
- * @remarks This function takes an absolute path as input and returns a relative path. It replaces the current working directory in the path with an empty string,
4
- * replaces all backslashes with forward slashes, and removes any leading forward slashes.
5
- * @param workingDirectory The directory relative to which the path should be converted. Defaults to the current working directory.
6
- * @returns The relative path.
7
- * @param absolute the absolute filepath to convert.
8
- * @example ```ts
9
- * absoluteToRelativePath(__filename)
10
- * //=> 'src/absoluteToRelativePath.ts'
11
- * ```
12
- */
13
- export declare function absoluteToRelativePath(absolute: string, workingDirectory?: string): string;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.absoluteToRelativePath = void 0;
4
- const tslib_1 = require("tslib");
5
- const string_1 = require("@bemoje/string");
6
- const path_1 = tslib_1.__importDefault(require("path"));
7
- /**
8
- * If the filepath is somewhere in the current working directory, it can be converted into a relative path.
9
- * @remarks This function takes an absolute path as input and returns a relative path. It replaces the current working directory in the path with an empty string,
10
- * replaces all backslashes with forward slashes, and removes any leading forward slashes.
11
- * @param workingDirectory The directory relative to which the path should be converted. Defaults to the current working directory.
12
- * @returns The relative path.
13
- * @param absolute the absolute filepath to convert.
14
- * @example ```ts
15
- * absoluteToRelativePath(__filename)
16
- * //=> 'src/absoluteToRelativePath.ts'
17
- * ```
18
- */
19
- function absoluteToRelativePath(absolute, workingDirectory = process.cwd()) {
20
- return path_1.default
21
- .normalize(absolute)
22
- .replace(new RegExp((0, string_1.regexEscapeString)(path_1.default.normalize(workingDirectory) + path_1.default.sep), 'i'), '');
23
- }
24
- exports.absoluteToRelativePath = absoluteToRelativePath;
25
- //# sourceMappingURL=absoluteToRelativePath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"absoluteToRelativePath.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/absoluteToRelativePath.ts"],"names":[],"mappings":";;;;AAAA,2CAAkD;AAClD,wDAAuB;AAEvB;;;;;;;;;;;GAWG;AACH,SAAgB,sBAAsB,CAAC,QAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE;IACvF,OAAO,cAAI;SACR,SAAS,CAAC,QAAQ,CAAC;SACnB,OAAO,CAAC,IAAI,MAAM,CAAC,IAAA,0BAAiB,EAAC,cAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,cAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;AACjG,CAAC;AAJD,wDAIC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Append a line to a file. Creates the file if it does not exist.
3
- * @param filepath The path of the file.
4
- * @param line The string data to append.
5
- * @returns A Promise that resolves when the line has been appended to the file.
6
- * @throws Will throw an error if the operation fails.
7
- * @example ```ts
8
- * await appendLineToFile('/path/to/file', 'This is a new line')
9
- * ```
10
- */
11
- export declare function appendLineToFile(filepath: string, line: string, linebreakBefore?: boolean): Promise<void>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appendLineToFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const path_1 = tslib_1.__importDefault(require("path"));
7
- const createDirectory_1 = require("./createDirectory");
8
- /**
9
- * Append a line to a file. Creates the file if it does not exist.
10
- * @param filepath The path of the file.
11
- * @param line The string data to append.
12
- * @returns A Promise that resolves when the line has been appended to the file.
13
- * @throws Will throw an error if the operation fails.
14
- * @example ```ts
15
- * await appendLineToFile('/path/to/file', 'This is a new line')
16
- * ```
17
- */
18
- function appendLineToFile(filepath, line, linebreakBefore = false) {
19
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
- if (!fs_1.default.existsSync(filepath)) {
21
- yield (0, createDirectory_1.createDirectory)(path_1.default.dirname(filepath));
22
- yield fs_1.default.promises.writeFile(filepath, '');
23
- }
24
- yield fs_1.default.promises.appendFile(filepath, linebreakBefore ? '\n' + line : line + '\n');
25
- });
26
- }
27
- exports.appendLineToFile = appendLineToFile;
28
- //# sourceMappingURL=appendLineToFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appendLineToFile.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/appendLineToFile.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,wDAAuB;AACvB,uDAAmD;AAEnD;;;;;;;;;GASG;AACH,SAAsB,gBAAgB,CAAC,QAAgB,EAAE,IAAY,EAAE,eAAe,GAAG,KAAK;;QAC5F,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE;YAC5B,MAAM,IAAA,iCAAe,EAAC,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC7C,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;SAC1C;QACD,MAAM,YAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IACrF,CAAC;CAAA;AAND,4CAMC"}
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- import type { Stats } from 'fs';
3
- /**
4
- * Synchronously cleans a directory by removing files that satisfy a given predicate.
5
- * @remarks This function is a part of the File System module.
6
- * @param dirpath - The path to the directory that needs to be cleaned.
7
- * @param predicate - A function that takes a filepath and its stats as arguments and returns a boolean. If the function returns true for a file, that file is removed from the directory.
8
- * @throws If the directory at the provided path does not exist or cannot be read.
9
- * @example ```ts
10
- * import { Stats } from 'fs';
11
- * const dirpath = './my-directory';
12
- * const predicate = (filepath: string, stat: Stats) => stat.size > 1024;
13
- * cleanDirectorySync(dirpath, predicate);
14
- * ```
15
- */
16
- export declare function cleanDirectorySync(dirpath: string, predicate: (filepath: string, stat: Stats) => boolean): void;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cleanDirectorySync = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const path_1 = tslib_1.__importDefault(require("path"));
7
- /**
8
- * Synchronously cleans a directory by removing files that satisfy a given predicate.
9
- * @remarks This function is a part of the File System module.
10
- * @param dirpath - The path to the directory that needs to be cleaned.
11
- * @param predicate - A function that takes a filepath and its stats as arguments and returns a boolean. If the function returns true for a file, that file is removed from the directory.
12
- * @throws If the directory at the provided path does not exist or cannot be read.
13
- * @example ```ts
14
- * import { Stats } from 'fs';
15
- * const dirpath = './my-directory';
16
- * const predicate = (filepath: string, stat: Stats) => stat.size > 1024;
17
- * cleanDirectorySync(dirpath, predicate);
18
- * ```
19
- */
20
- function cleanDirectorySync(dirpath, predicate) {
21
- for (const filename of fs_1.default.readdirSync(dirpath)) {
22
- const filepath = path_1.default.join(dirpath, filename);
23
- const stat = fs_1.default.statSync(filepath);
24
- if (predicate(filepath, stat))
25
- fs_1.default.unlinkSync(filepath);
26
- }
27
- }
28
- exports.cleanDirectorySync = cleanDirectorySync;
29
- //# sourceMappingURL=cleanDirectorySync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cleanDirectorySync.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/cleanDirectorySync.ts"],"names":[],"mappings":";;;;AACA,oDAAmB;AACnB,wDAAuB;AAEvB;;;;;;;;;;;;GAYG;AACH,SAAgB,kBAAkB,CAAC,OAAe,EAAE,SAAqD;IACvG,KAAK,MAAM,QAAQ,IAAI,YAAE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QAC9C,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAC7C,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAClC,IAAI,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC;YAAE,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;KACvD;AACH,CAAC;AAND,gDAMC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDirectory = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Create a directory at a given path if it does not exist.
8
- * Automatically creates parent directories if they do not exist.
9
- * @param dirpath The path where the directory should be created.
10
- * @returns The path of the directory.
11
- * @throws Will throw an error if the directory cannot be created.
12
- * @example ```ts
13
- * createDirectory('/path/to/directory').then((dirpath) => {
14
- * //=> `Directory created at ${dirpath}`
15
- * });
16
- * ```
17
- */
18
- function createDirectory(dirpath) {
19
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
- yield fs_1.default.promises.mkdir(dirpath, { recursive: true });
21
- return dirpath;
22
- });
23
- }
24
- exports.createDirectory = createDirectory;
25
- //# sourceMappingURL=createDirectory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDirectory.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/createDirectory.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB;;;;;;;;;;;GAWG;AACH,SAAsB,eAAe,CAAC,OAAe;;QACnD,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACrD,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAHD,0CAGC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDirectorySync.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/createDirectorySync.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IACjD,YAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1C,OAAO,OAAO,CAAA;AAChB,CAAC;AAHD,kDAGC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Takes a list of file extensions and returns a filter function that returns true if a filepath/filename passed to it contains one of the given file extensions.
3
- * @remarks If no file extensions are provided, the filter will always return true.
4
- * @returns A function that takes a filepath and returns true if the filepath has one of the specified file extensions, false otherwise.
5
- * @param fileExtensions file extensions
6
- * @example ```ts
7
- * createFileExtensionFilter('.ts', '.tsx')('index.ts');;
8
- * //=> true
9
- * createFileExtensionFilter('.ts', '.tsx')('index.js');;
10
- * //=> false
11
- * ```
12
- */
13
- export declare function createFileExtensionFilter(...fileExtensions: string[]): (filepath: string) => boolean;
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFileExtensionFilter = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const normalizeFileExtension_1 = require("./normalizeFileExtension");
7
- /**
8
- * Takes a list of file extensions and returns a filter function that returns true if a filepath/filename passed to it contains one of the given file extensions.
9
- * @remarks If no file extensions are provided, the filter will always return true.
10
- * @returns A function that takes a filepath and returns true if the filepath has one of the specified file extensions, false otherwise.
11
- * @param fileExtensions file extensions
12
- * @example ```ts
13
- * createFileExtensionFilter('.ts', '.tsx')('index.ts');;
14
- * //=> true
15
- * createFileExtensionFilter('.ts', '.tsx')('index.js');;
16
- * //=> false
17
- * ```
18
- */
19
- function createFileExtensionFilter(...fileExtensions) {
20
- if (!fileExtensions.length)
21
- return () => true;
22
- return (filepath) => {
23
- for (const ext of fileExtensions.map(normalizeFileExtension_1.normalizeFileExtension)) {
24
- if (path_1.default.extname(filepath) === ext) {
25
- return true;
26
- }
27
- }
28
- return false;
29
- };
30
- }
31
- exports.createFileExtensionFilter = createFileExtensionFilter;
32
- //# sourceMappingURL=createFileExtensionFilter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createFileExtensionFilter.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/createFileExtensionFilter.ts"],"names":[],"mappings":";;;;AAAA,wDAAuB;AACvB,qEAAiE;AAEjE;;;;;;;;;;;GAWG;AACH,SAAgB,yBAAyB,CAAC,GAAG,cAAwB;IACnE,IAAI,CAAC,cAAc,CAAC,MAAM;QAAE,OAAO,GAAG,EAAE,CAAC,IAAI,CAAA;IAC7C,OAAO,CAAC,QAAgB,EAAE,EAAE;QAC1B,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,+CAAsB,CAAC,EAAE;YAC5D,IAAI,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE;gBAClC,OAAO,IAAI,CAAA;aACZ;SACF;QACD,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;AACH,CAAC;AAVD,8DAUC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Joins the given path segments to the current working directory path, and normalizes the resulting path.
3
- * @remarks
4
- * The function uses the `path.join` method from the Node.js `path` module, and the `process.cwd` method from the Node.js `process` module.
5
- * @param paths - The path segments to join to the current working directory path.
6
- * @returns The resulting path.
7
- * @example ```ts
8
- * console.log(cwdpath('src', 'index.ts'));
9
- * //=> '{working_directory}/src/index.ts'
10
- * ```
11
- */
12
- export declare function cwdpath(...paths: string[]): string;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cwdpath = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- /**
7
- * Joins the given path segments to the current working directory path, and normalizes the resulting path.
8
- * @remarks
9
- * The function uses the `path.join` method from the Node.js `path` module, and the `process.cwd` method from the Node.js `process` module.
10
- * @param paths - The path segments to join to the current working directory path.
11
- * @returns The resulting path.
12
- * @example ```ts
13
- * console.log(cwdpath('src', 'index.ts'));
14
- * //=> '{working_directory}/src/index.ts'
15
- * ```
16
- */
17
- function cwdpath(...paths) {
18
- return path_1.default.join(process.cwd(), ...paths);
19
- }
20
- exports.cwdpath = cwdpath;
21
- //# sourceMappingURL=cwdpath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cwdpath.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/cwdpath.ts"],"names":[],"mappings":";;;;AAAA,wDAAuB;AAEvB;;;;;;;;;;GAUG;AACH,SAAgB,OAAO,CAAC,GAAG,KAAe;IACxC,OAAO,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,0BAEC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Deletes a directory and all of its contents.
3
- * @remarks This function uses Node.js's `fs.promises.rm` method with the `recursive` and `force` options set to `true`.
4
- * This means it will delete the directory and all of its contents, even if the directory is not empty.
5
- * @param dirpath The path to the directory to delete.
6
- * @returns A Promise that resolves when the directory has been deleted.
7
- * @throws Will throw an error if the directory does not exist, or if there was a problem deleting the directory.
8
- * @example ```ts
9
- * deleteDirectory('/path/to/directory');
10
- * ```
11
- */
12
- export declare function deleteDirectory(dirpath: string): Promise<void>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteDirectory = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Deletes a directory and all of its contents.
8
- * @remarks This function uses Node.js's `fs.promises.rm` method with the `recursive` and `force` options set to `true`.
9
- * This means it will delete the directory and all of its contents, even if the directory is not empty.
10
- * @param dirpath The path to the directory to delete.
11
- * @returns A Promise that resolves when the directory has been deleted.
12
- * @throws Will throw an error if the directory does not exist, or if there was a problem deleting the directory.
13
- * @example ```ts
14
- * deleteDirectory('/path/to/directory');
15
- * ```
16
- */
17
- function deleteDirectory(dirpath) {
18
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
- yield fs_1.default.promises.rm(dirpath, { recursive: true, force: true });
20
- });
21
- }
22
- exports.deleteDirectory = deleteDirectory;
23
- //# sourceMappingURL=deleteDirectory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteDirectory.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/deleteDirectory.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;;;GAUG;AACH,SAAsB,eAAe,CAAC,OAAe;;QACnD,MAAM,YAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACjE,CAAC;CAAA;AAFD,0CAEC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Deletes a directory safely if it exists.
3
- * @remarks This function uses Node.js' `fs.promises.rm` method with the `recursive` and `force` options set to `true`.
4
- * This means it will delete the directory and all its contents, even if the directory is not empty.
5
- * @param dirpath The path of the directory to delete.
6
- * @returns A promise that resolves to `void` when the directory has been deleted.
7
- * @throws Will throw an error if the `fs.promises.rm` operation fails.
8
- * @example ```ts
9
- * deleteDirectorySafe('/path/to/directory');;
10
- * //=> undefined
11
- * ```
12
- */
13
- export declare function deleteDirectorySafe(dirpath: string): Promise<void>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteDirectorySafe = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Deletes a directory safely if it exists.
8
- * @remarks This function uses Node.js' `fs.promises.rm` method with the `recursive` and `force` options set to `true`.
9
- * This means it will delete the directory and all its contents, even if the directory is not empty.
10
- * @param dirpath The path of the directory to delete.
11
- * @returns A promise that resolves to `void` when the directory has been deleted.
12
- * @throws Will throw an error if the `fs.promises.rm` operation fails.
13
- * @example ```ts
14
- * deleteDirectorySafe('/path/to/directory');;
15
- * //=> undefined
16
- * ```
17
- */
18
- function deleteDirectorySafe(dirpath) {
19
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
- if (fs_1.default.existsSync(dirpath))
21
- yield fs_1.default.promises.rm(dirpath, { recursive: true, force: true });
22
- });
23
- }
24
- exports.deleteDirectorySafe = deleteDirectorySafe;
25
- //# sourceMappingURL=deleteDirectorySafe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteDirectorySafe.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/deleteDirectorySafe.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;;;;GAWG;AACH,SAAsB,mBAAmB,CAAC,OAAe;;QACvD,IAAI,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC;YAAE,MAAM,YAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7F,CAAC;CAAA;AAFD,kDAEC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Deletes a directory synchronously in a safe manner. If the directory does not exist, it will simply return the directory path without throwing an error.
3
- * @param dirpath The path of the directory to be deleted.
4
- * @returns The path of the directory that was intended to be deleted.
5
- * @throws Will throw an error if the operation fails for reasons other than the directory not existing.
6
- * @example ```ts
7
- * deleteDirectorySafeSync('/path/to/directory');;
8
- * //=> undefined
9
- * ```
10
- */
11
- export declare function deleteDirectorySafeSync(dirpath: string): string;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteDirectorySafeSync = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Deletes a directory synchronously in a safe manner. If the directory does not exist, it will simply return the directory path without throwing an error.
8
- * @param dirpath The path of the directory to be deleted.
9
- * @returns The path of the directory that was intended to be deleted.
10
- * @throws Will throw an error if the operation fails for reasons other than the directory not existing.
11
- * @example ```ts
12
- * deleteDirectorySafeSync('/path/to/directory');;
13
- * //=> undefined
14
- * ```
15
- */
16
- function deleteDirectorySafeSync(dirpath) {
17
- if (!fs_1.default.existsSync(dirpath))
18
- return dirpath;
19
- fs_1.default.rmSync(dirpath, { recursive: true, force: true });
20
- return dirpath;
21
- }
22
- exports.deleteDirectorySafeSync = deleteDirectorySafeSync;
23
- //# sourceMappingURL=deleteDirectorySafeSync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteDirectorySafeSync.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/deleteDirectorySafeSync.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;;GASG;AACH,SAAgB,uBAAuB,CAAC,OAAe;IACrD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAA;IAC3C,YAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACpD,OAAO,OAAO,CAAA;AAChB,CAAC;AAJD,0DAIC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Deletes a directory synchronously.
3
- * @remarks This function uses Node.js's `fs.rmSync` method with the options `{ recursive: true, force: true }`.
4
- * @param dirpath The path of the directory to delete.
5
- * @returns The path of the deleted directory.
6
- * @throws Will throw an error if the directory does not exist or if the process lacks permissions to delete it.
7
- * @example ```ts
8
- * deleteDirectorySync('/path/to/directory');;
9
- * //=> undefined
10
- * ```
11
- */
12
- export declare function deleteDirectorySync(dirpath: string): string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteDirectorySync = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Deletes a directory synchronously.
8
- * @remarks This function uses Node.js's `fs.rmSync` method with the options `{ recursive: true, force: true }`.
9
- * @param dirpath The path of the directory to delete.
10
- * @returns The path of the deleted directory.
11
- * @throws Will throw an error if the directory does not exist or if the process lacks permissions to delete it.
12
- * @example ```ts
13
- * deleteDirectorySync('/path/to/directory');;
14
- * //=> undefined
15
- * ```
16
- */
17
- function deleteDirectorySync(dirpath) {
18
- fs_1.default.rmSync(dirpath, { recursive: true, force: true });
19
- return dirpath;
20
- }
21
- exports.deleteDirectorySync = deleteDirectorySync;
22
- //# sourceMappingURL=deleteDirectorySync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deleteDirectorySync.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/deleteDirectorySync.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IACjD,YAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACpD,OAAO,OAAO,CAAA;AAChB,CAAC;AAHD,kDAGC"}
@@ -1,22 +0,0 @@
1
- import { IEnsureValidWindowsPathOptions } from './types/IEnsureValidWindowsPathOptions';
2
- /**
3
- * Check whether a provided windows filesystem path string is valid according to:
4
- * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
5
- * @param path The path to validate.
6
- * @returns A boolean indicating whether the path is valid. If the `assert` option is true, the function will throw an error instead of returning false.
7
- * @throws Will throw an error if the `assert` option is true and the path is invalid.
8
- * @param options An optional object that may contain the following properties:
9
- * - `assert`: If true, the function will throw an error if the path is invalid. Default is false.
10
- * - `extendedMaxLength`: If true, the function will allow paths up to 32767 characters long. Default is false.
11
- * @example ```ts
12
- * ensureValidWindowsPath('C:\\Users\\User\\Documents\\file.txt');;
13
- * //=> true
14
- * ensureValidWindowsPath('C:/Users/User/Documents/file.txt');;
15
- * //=> false
16
- * ensureValidWindowsPath('C:\\Users\\User\\Documents\\file.txt', { assert: true });;
17
- * //=> throws an error
18
- * ensureValidWindowsPath('C:\\Users\\User\\Documents\\file.txt', { extendedMaxLength: true });;
19
- * //=> true
20
- * ```
21
- */
22
- export declare function ensureValidWindowsPath(path: string, options?: IEnsureValidWindowsPathOptions): boolean;