@bemoje/fs 0.2.11 → 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 -16
  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,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureValidWindowsPath = void 0;
4
- /**
5
- * Check whether a provided windows filesystem path string is valid according to:
6
- * https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
7
- * @param path The path to validate.
8
- * @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.
9
- * @throws Will throw an error if the `assert` option is true and the path is invalid.
10
- * @param options An optional object that may contain the following properties:
11
- * - `assert`: If true, the function will throw an error if the path is invalid. Default is false.
12
- * - `extendedMaxLength`: If true, the function will allow paths up to 32767 characters long. Default is false.
13
- * @example ```ts
14
- * ensureValidWindowsPath('C:\\Users\\User\\Documents\\file.txt');;
15
- * //=> true
16
- * ensureValidWindowsPath('C:/Users/User/Documents/file.txt');;
17
- * //=> false
18
- * ensureValidWindowsPath('C:\\Users\\User\\Documents\\file.txt', { assert: true });;
19
- * //=> throws an error
20
- * ensureValidWindowsPath('C:\\Users\\User\\Documents\\file.txt', { extendedMaxLength: true });;
21
- * //=> true
22
- * ```
23
- */
24
- function ensureValidWindowsPath(path, options) {
25
- const throwOrFalse = (msg) => {
26
- if (options && options.assert === true) {
27
- throw new Error(`Invalid windows path. ${msg} | input received: ${path}`);
28
- }
29
- return false;
30
- };
31
- if (path.length === 0) {
32
- return throwOrFalse('Path string is length 0.');
33
- }
34
- if (path.indexOf('/') !== -1 && path.indexOf('\\') !== -1) {
35
- return throwOrFalse('Path contains both backslash and forward slash.');
36
- }
37
- const maxLength = (options && options.extendedMaxLength ? 32767 : 260) - 12;
38
- if (path.length > maxLength) {
39
- return throwOrFalse(`Maximum length of ${maxLength} exceeded`);
40
- }
41
- let noDriveLetter = path;
42
- if (/^\w:(\\|\/)/g.test(path)) {
43
- noDriveLetter = path.substring(2);
44
- }
45
- if (/[<>"|?*:]/g.test(noDriveLetter)) {
46
- return throwOrFalse(`Illegal characters in: ${path} | Illegal characters are: <>"|?:*`);
47
- }
48
- if (/(\\|\/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])((\\|\/)|$)/g.test(path)) {
49
- return throwOrFalse('Illegal name in path string');
50
- }
51
- return true;
52
- }
53
- exports.ensureValidWindowsPath = ensureValidWindowsPath;
54
- //# sourceMappingURL=ensureValidWindowsPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureValidWindowsPath.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/ensureValidWindowsPath.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,sBAAsB,CAAC,IAAY,EAAE,OAAwC;IAC3F,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;QACnC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,wBAAwB,IAAI,EAAE,CAAC,CAAA;SAC5E;QACD,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,OAAO,YAAY,CAAC,0BAA0B,CAAC,CAAA;KAChD;IAED,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QACzD,OAAO,YAAY,CAAC,iDAAiD,CAAC,CAAA;KACvE;IAED,MAAM,SAAS,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;IAC3E,IAAI,IAAI,CAAC,MAAM,GAAG,SAAS,EAAE;QAC3B,OAAO,YAAY,CAAC,qBAAqB,SAAS,WAAW,CAAC,CAAA;KAC/D;IAED,IAAI,aAAa,GAAG,IAAI,CAAA;IACxB,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC7B,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;KAClC;IACD,IAAI,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE;QACpC,OAAO,YAAY,CAAC,0BAA0B,IAAI,sCAAsC,CAAC,CAAA;KAC1F;IAED,IAAI,wDAAwD,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACvE,OAAO,YAAY,CAAC,6BAA6B,CAAC,CAAA;KACnD;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAlCD,wDAkCC"}
@@ -1 +0,0 @@
1
- export declare function getDiskDrivesWindows(): string[];
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDiskDrivesWindows = void 0;
4
- const tslib_1 = require("tslib");
5
- const os_1 = require("@bemoje/os");
6
- const child_process_1 = require("child_process");
7
- const path_1 = tslib_1.__importDefault(require("path"));
8
- function getDiskDrivesWindows() {
9
- if (!(0, os_1.isWindows)())
10
- throw new Error('This function is only available on Windows.');
11
- return (0, child_process_1.execSync)('wmic logicaldisk get name')
12
- .toString()
13
- .split('\n')
14
- .map((s) => s.trim())
15
- .filter((s) => /^[a-z]:/i.test(s))
16
- .map((s) => s.substring(0, 2) + path_1.default.sep);
17
- }
18
- exports.getDiskDrivesWindows = getDiskDrivesWindows;
19
- //# sourceMappingURL=getDiskDrivesWindows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDiskDrivesWindows.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/getDiskDrivesWindows.ts"],"names":[],"mappings":";;;;AAAA,mCAAsC;AACtC,iDAAwC;AACxC,wDAAuB;AAEvB,SAAgB,oBAAoB;IAClC,IAAI,CAAC,IAAA,cAAS,GAAE;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAChF,OAAO,IAAA,wBAAQ,EAAC,2BAA2B,CAAC;SACzC,QAAQ,EAAE;SACV,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,cAAI,CAAC,GAAG,CAAC,CAAA;AAC7C,CAAC;AARD,oDAQC"}
@@ -1 +0,0 @@
1
- export declare function getDownloadsDirectory(): string;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDownloadsDirectory = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- const getHomeDirectory_1 = require("./getHomeDirectory");
7
- function getDownloadsDirectory() {
8
- return path_1.default.join((0, getHomeDirectory_1.getHomeDirectory)(), 'Downloads');
9
- }
10
- exports.getDownloadsDirectory = getDownloadsDirectory;
11
- //# sourceMappingURL=getDownloadsDirectory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDownloadsDirectory.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/getDownloadsDirectory.ts"],"names":[],"mappings":";;;;AAAA,wDAAuB;AACvB,yDAAqD;AAErD,SAAgB,qBAAqB;IACnC,OAAO,cAAI,CAAC,IAAI,CAAC,IAAA,mCAAgB,GAAE,EAAE,WAAW,CAAC,CAAA;AACnD,CAAC;AAFD,sDAEC"}
@@ -1 +0,0 @@
1
- export declare function getHomeDirectory(): string;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHomeDirectory = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- function getHomeDirectory() {
7
- const home = path_1.default.resolve(process.env['HOME'] || process.env['USERPROFILE'] || '');
8
- if (!home)
9
- throw new Error('Home directory not found');
10
- return home;
11
- }
12
- exports.getHomeDirectory = getHomeDirectory;
13
- //# sourceMappingURL=getHomeDirectory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getHomeDirectory.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/getHomeDirectory.ts"],"names":[],"mappings":";;;;AAAA,wDAAuB;AAEvB,SAAgB,gBAAgB;IAC9B,MAAM,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAA;IAClF,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;IACtD,OAAO,IAAI,CAAA;AACb,CAAC;AAJD,4CAIC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLastMofifiedFileIn = 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
- function getLastMofifiedFileIn(dirpath) {
8
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
- const children = yield fs_1.default.promises.readdir(dirpath);
10
- const filtered = children
11
- .map((fname) => {
12
- const fpath = path_1.default.join(dirpath, fname);
13
- const stat = fs_1.default.statSync(fpath);
14
- return [fpath, stat.mtimeMs, stat.isFile()];
15
- })
16
- .filter((a) => a[2]);
17
- const sorted = filtered.sort((a, b) => b[1] - a[1]);
18
- return sorted[0][0];
19
- });
20
- }
21
- exports.getLastMofifiedFileIn = getLastMofifiedFileIn;
22
- //# sourceMappingURL=getLastMofifiedFileIn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getLastMofifiedFileIn.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/getLastMofifiedFileIn.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,wDAAuB;AAEvB,SAAsB,qBAAqB,CAAC,OAAe;;QACzD,MAAM,QAAQ,GAAG,MAAM,YAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACnD,MAAM,QAAQ,GAAG,QAAQ;aACtB,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE;YACrB,MAAM,KAAK,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;YACvC,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YAC/B,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QAC7C,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAgC,CAAA;QACrD,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACnD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;CAAA;AAXD,sDAWC"}
@@ -1 +0,0 @@
1
- export declare function getRootDir(): string;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRootDir = void 0;
4
- const tslib_1 = require("tslib");
5
- const path_1 = tslib_1.__importDefault(require("path"));
6
- function getRootDir() {
7
- return path_1.default.parse(process.cwd()).root;
8
- }
9
- exports.getRootDir = getRootDir;
10
- //# sourceMappingURL=getRootDir.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getRootDir.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/getRootDir.ts"],"names":[],"mappings":";;;;AAAA,wDAAuB;AAEvB,SAAgB,UAAU;IACxB,OAAO,cAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAA;AACvC,CAAC;AAFD,gCAEC"}
@@ -1,22 +0,0 @@
1
- /**
2
- * Normalize a file extension to the form: .[ext]
3
- * Anything before the last "." is not returned.
4
- * @returns The normalized file extension.
5
- * @throws If the extension contains illegal characters.
6
- * @param ext file extension
7
- * @example ```ts
8
- * normalizeFileExtension('jpg');;
9
- * //=> '.jpg'
10
- * normalizeFileExtension('.jpg');;
11
- * //=> '.jpg'
12
- * normalizeFileExtension('..jpg');;
13
- * //=> '.jpg'
14
- * normalizeFileExtension('');;
15
- * //=> ''
16
- * normalizeFileExtension('.');;
17
- * //=> ''
18
- * normalizeFileExtension('jpg|png');;
19
- * //=> Error
20
- * ```
21
- */
22
- export declare function normalizeFileExtension(ext: string): string;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeFileExtension = void 0;
4
- /**
5
- * Normalize a file extension to the form: .[ext]
6
- * Anything before the last "." is not returned.
7
- * @returns The normalized file extension.
8
- * @throws If the extension contains illegal characters.
9
- * @param ext file extension
10
- * @example ```ts
11
- * normalizeFileExtension('jpg');;
12
- * //=> '.jpg'
13
- * normalizeFileExtension('.jpg');;
14
- * //=> '.jpg'
15
- * normalizeFileExtension('..jpg');;
16
- * //=> '.jpg'
17
- * normalizeFileExtension('');;
18
- * //=> ''
19
- * normalizeFileExtension('.');;
20
- * //=> ''
21
- * normalizeFileExtension('jpg|png');;
22
- * //=> Error
23
- * ```
24
- */
25
- function normalizeFileExtension(ext) {
26
- if (ext === '' || ext === '.')
27
- return '';
28
- if (/[<>"|?*:]/g.test(ext)) {
29
- throw new Error(`Illegal characters in file extension: ${ext} | Illegal characters are: <>"|?:*`);
30
- }
31
- if (!ext.includes('.'))
32
- return '.' + ext;
33
- return ext.substring(ext.lastIndexOf('.'));
34
- }
35
- exports.normalizeFileExtension = normalizeFileExtension;
36
- //# sourceMappingURL=normalizeFileExtension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeFileExtension.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/normalizeFileExtension.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,sBAAsB,CAAC,GAAW;IAChD,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,GAAG;QAAE,OAAO,EAAE,CAAA;IACxC,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC1B,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,sCAAsC,CAAC,CAAA;KACpG;IACD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,GAAG,GAAG,CAAA;IACxC,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;AAC5C,CAAC;AAPD,wDAOC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Read the last n lines of a file.
3
- * @param filepath The path to the file.
4
- * @param n The number of lines to read.
5
- * @example await readLastLines.read('path/to/file.log', 50)
6
- */
7
- export declare function readFileLastLines(filepath: string, n: number): Promise<string>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readFileLastLines = void 0;
4
- const tslib_1 = require("tslib");
5
- const read_last_lines_1 = tslib_1.__importDefault(require("read-last-lines"));
6
- /**
7
- * Read the last n lines of a file.
8
- * @param filepath The path to the file.
9
- * @param n The number of lines to read.
10
- * @example await readLastLines.read('path/to/file.log', 50)
11
- */
12
- function readFileLastLines(filepath, n) {
13
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
- return yield read_last_lines_1.default.read(filepath, n, 'utf8');
15
- });
16
- }
17
- exports.readFileLastLines = readFileLastLines;
18
- //# sourceMappingURL=readFileLastLines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readFileLastLines.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/readFileLastLines.ts"],"names":[],"mappings":";;;;AAAA,8EAA2C;AAE3C;;;;;GAKG;AACH,SAAsB,iBAAiB,CAAC,QAAgB,EAAE,CAAS;;QACjE,OAAO,MAAM,yBAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;IACtD,CAAC;CAAA;AAFD,8CAEC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Reads a JSON file from the given filepath and returns its content as a Promise.
3
- * The Promise will resolve with the parsed JSON content as an object of type T.
4
- * @template T The expected return type of the JSON object.
5
- * @param filepath The path to the JSON file to read.
6
- * @returns A Promise that resolves with the parsed JSON content as an object of type T.
7
- * @throws Will throw an error if reading the file fails for any reason.
8
- * @example ```ts
9
- * const data: MyType = await readJsonFile<MyType>('path/to/myfile.json');
10
- * ```
11
- */
12
- export declare function readJsonFile<T>(filepath: string): Promise<T>;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readJsonFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Reads a JSON file from the given filepath and returns its content as a Promise.
8
- * The Promise will resolve with the parsed JSON content as an object of type T.
9
- * @template T The expected return type of the JSON object.
10
- * @param filepath The path to the JSON file to read.
11
- * @returns A Promise that resolves with the parsed JSON content as an object of type T.
12
- * @throws Will throw an error if reading the file fails for any reason.
13
- * @example ```ts
14
- * const data: MyType = await readJsonFile<MyType>('path/to/myfile.json');
15
- * ```
16
- */
17
- function readJsonFile(filepath) {
18
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
- return JSON.parse(yield fs_1.default.promises.readFile(filepath, 'utf8'));
20
- });
21
- }
22
- exports.readJsonFile = readJsonFile;
23
- //# sourceMappingURL=readJsonFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readJsonFile.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/readJsonFile.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;;;GAUG;AACH,SAAsB,YAAY,CAAI,QAAgB;;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;IACjE,CAAC;CAAA;AAFD,oCAEC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Reads a JSON file synchronously and returns a Promise that resolves with the parsed JSON data.
3
- * @template T The expected return type of the JSON data.
4
- * @param filepath The path to the JSON file to read.
5
- * @returns A Promise that resolves with the parsed JSON data.
6
- * @throws If the file cannot be read or the content cannot be parsed as JSON.
7
- * @example ```ts
8
- * const data = await readJsonFileSync<MyType>('/path/to/file.json');
9
- * console.log(data);
10
- * ```
11
- */
12
- export declare function readJsonFileSync<T>(filepath: string): T;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readJsonFileSync = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- /**
7
- * Reads a JSON file synchronously and returns a Promise that resolves with the parsed JSON data.
8
- * @template T The expected return type of the JSON data.
9
- * @param filepath The path to the JSON file to read.
10
- * @returns A Promise that resolves with the parsed JSON data.
11
- * @throws If the file cannot be read or the content cannot be parsed as JSON.
12
- * @example ```ts
13
- * const data = await readJsonFileSync<MyType>('/path/to/file.json');
14
- * console.log(data);
15
- * ```
16
- */
17
- function readJsonFileSync(filepath) {
18
- return JSON.parse(fs_1.default.readFileSync(filepath, 'utf8'));
19
- }
20
- exports.readJsonFileSync = readJsonFileSync;
21
- //# sourceMappingURL=readJsonFileSync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readJsonFileSync.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/readJsonFileSync.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AAEnB;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB,CAAI,QAAgB;IAClD,OAAO,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;AACtD,CAAC;AAFD,4CAEC"}
@@ -1 +0,0 @@
1
- export declare function readPackageJson(projectRoot?: string): Record<string, any> | undefined;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readPackageJson = 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 readJsonFileSync_1 = require("./readJsonFileSync");
8
- function readPackageJson(projectRoot = process.cwd()) {
9
- const filepath = path_1.default.join(projectRoot, 'package.json');
10
- if (!fs_1.default.existsSync(filepath))
11
- return;
12
- return (0, readJsonFileSync_1.readJsonFileSync)(filepath);
13
- }
14
- exports.readPackageJson = readPackageJson;
15
- //# sourceMappingURL=readPackageJson.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readPackageJson.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/readPackageJson.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,wDAAuB;AACvB,yDAAqD;AAErD,SAAgB,eAAe,CAAC,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;IACzD,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAA;IACvD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAM;IACpC,OAAO,IAAA,mCAAgB,EAAC,QAAQ,CAAC,CAAA;AACnC,CAAC;AAJD,0CAIC"}
@@ -1 +0,0 @@
1
- export declare function removeIllegalFilenameCharacters(string: string): string;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeIllegalFilenameCharacters = void 0;
4
- function removeIllegalFilenameCharacters(string) {
5
- return string.replace(/[/\\?%*:|"<>]/g, '');
6
- }
7
- exports.removeIllegalFilenameCharacters = removeIllegalFilenameCharacters;
8
- //# sourceMappingURL=removeIllegalFilenameCharacters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"removeIllegalFilenameCharacters.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/removeIllegalFilenameCharacters.ts"],"names":[],"mappings":";;;AAAA,SAAgB,+BAA+B,CAAC,MAAc;IAC5D,OAAO,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;AAC7C,CAAC;AAFD,0EAEC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tempFile = 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
- * Creates a temporary file and deletes it after the callback has finished.
9
- * @param fileExtension - The file extension to use for the temporary file.
10
- * @param callback - The callback to execute with the temporary file path. The callback can return a promise and the temporary file will not be deleted until the promise has resolved or rejected.
11
- */
12
- function tempFile(fileExtension, callback) {
13
- const dir = path_1.default.join(process.env['TEMP'], 'bemoje', 'temp');
14
- const fpath = path_1.default.join(dir, Date.now() + fileExtension);
15
- fs_1.default.mkdirSync(dir, { recursive: true });
16
- const prom = callback(fpath);
17
- if (prom instanceof Promise) {
18
- const rm = () => fs_1.default.rmSync(fpath);
19
- prom.then(rm).catch(rm);
20
- }
21
- else {
22
- fs_1.default.rmSync(fpath);
23
- }
24
- }
25
- exports.tempFile = tempFile;
26
- //# sourceMappingURL=tempFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tempFile.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/tempFile.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,wDAAuB;AAEvB;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,aAAqB,EAAE,QAAiD;IAC/F,MAAM,GAAG,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC7D,MAAM,KAAK,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC,CAAA;IACxD,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACtC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC5B,IAAI,IAAI,YAAY,OAAO,EAAE;QAC3B,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC,YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACjC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;KACxB;SAAM;QACL,YAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KACjB;AACH,CAAC;AAXD,4BAWC"}
@@ -1,10 +0,0 @@
1
- export interface IEnsureValidWindowsPathOptions {
2
- /**
3
- * On most versions of windows, the max allowed length of paths has been raised.
4
- */
5
- extendedMaxLength?: boolean;
6
- /**
7
- * Throw if not valid, otherwise return false.
8
- */
9
- assert?: boolean;
10
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"IEnsureValidWindowsPathOptions.js","sourceRoot":"","sources":["../../../../../../packages/fs/src/lib/types/IEnsureValidWindowsPathOptions.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- /**
2
- * Updates a JSON file asynchronously based on a provided update function.
3
- * The update function takes the current JSON object as a parameter and should return the updated JSON object.
4
- * If the update function returns a falsy value, the JSON file will not be written to.
5
- * The indentation of the original JSON file is preserved.
6
- *
7
- * @param filepath - The path to the JSON file to update.
8
- * @param update - The function to update the JSON object. Takes the current JSON object as a parameter and should return the updated JSON object.
9
- * @throws If the file cannot be read or written to.
10
- * @example
11
- * ```ts
12
- * await updateJsonFileSync('./package.json', (json) => {
13
- * json.version = '1.0.1';
14
- * return json;
15
- * });
16
- * ```
17
- */
18
- export declare function updateJsonFile(filepath: string, update: (o: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>, defaultJson?: string): Promise<void>;
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateJsonFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const getJsonIndentation_1 = require("./getJsonIndentation");
7
- const writeJsonFile_1 = require("./writeJsonFile");
8
- /**
9
- * Updates a JSON file asynchronously based on a provided update function.
10
- * The update function takes the current JSON object as a parameter and should return the updated JSON object.
11
- * If the update function returns a falsy value, the JSON file will not be written to.
12
- * The indentation of the original JSON file is preserved.
13
- *
14
- * @param filepath - The path to the JSON file to update.
15
- * @param update - The function to update the JSON object. Takes the current JSON object as a parameter and should return the updated JSON object.
16
- * @throws If the file cannot be read or written to.
17
- * @example
18
- * ```ts
19
- * await updateJsonFileSync('./package.json', (json) => {
20
- * json.version = '1.0.1';
21
- * return json;
22
- * });
23
- * ```
24
- */
25
- function updateJsonFile(filepath, update, defaultJson) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- let json;
28
- try {
29
- json = yield fs_1.default.promises.readFile(filepath, 'utf8');
30
- }
31
- catch (error) {
32
- if (!defaultJson)
33
- throw error;
34
- json = defaultJson;
35
- }
36
- const result = yield update(JSON.parse(json));
37
- if (!result)
38
- return;
39
- const indents = (0, getJsonIndentation_1.getJsonIndentation)(json);
40
- yield (0, writeJsonFile_1.writeJsonFile)(filepath, result, !!indents, indents);
41
- });
42
- }
43
- exports.updateJsonFile = updateJsonFile;
44
- //# sourceMappingURL=updateJsonFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateJsonFile.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/updateJsonFile.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,6DAAyD;AACzD,mDAA+C;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,SAAsB,cAAc,CAClC,QAAgB,EAChB,MAAkG,EAClG,WAAoB;;QAEpB,IAAI,IAAY,CAAA;QAChB,IAAI;YACF,IAAI,GAAG,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;SACpD;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,WAAW;gBAAE,MAAM,KAAK,CAAA;YAC7B,IAAI,GAAG,WAAW,CAAA;SACnB;QACD,MAAM,MAAM,GAA4B,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;QACtE,IAAI,CAAC,MAAM;YAAE,OAAM;QACnB,MAAM,OAAO,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAA;QACxC,MAAM,IAAA,6BAAa,EAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;CAAA;AAhBD,wCAgBC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Updates a JSON file synchronously based on a provided update function.
3
- * The update function takes the current JSON object as a parameter and should return the updated JSON object.
4
- * If the update function returns a falsy value, the JSON file will not be written to.
5
- * The indentation of the original JSON file is preserved.
6
- *
7
- * @param filepath - The path to the JSON file to update.
8
- * @param update - The function to update the JSON object. Takes the current JSON object as a parameter and should return the updated JSON object.
9
- * @throws If the file cannot be read or written to.
10
- * @example
11
- * ```ts
12
- * updateJsonFileSync('./package.json', (json) => {
13
- * json.version = '1.0.1';
14
- * return json;
15
- * });
16
- * ```
17
- */
18
- export declare function updateJsonFileSync(filepath: string, update: (o: Record<string, unknown>) => Record<string, unknown>, defaultJson?: string): void;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateJsonFileSync = void 0;
4
- const tslib_1 = require("tslib");
5
- const fs_1 = tslib_1.__importDefault(require("fs"));
6
- const getJsonIndentation_1 = require("./getJsonIndentation");
7
- const writeJsonFileSync_1 = require("./writeJsonFileSync");
8
- /**
9
- * Updates a JSON file synchronously based on a provided update function.
10
- * The update function takes the current JSON object as a parameter and should return the updated JSON object.
11
- * If the update function returns a falsy value, the JSON file will not be written to.
12
- * The indentation of the original JSON file is preserved.
13
- *
14
- * @param filepath - The path to the JSON file to update.
15
- * @param update - The function to update the JSON object. Takes the current JSON object as a parameter and should return the updated JSON object.
16
- * @throws If the file cannot be read or written to.
17
- * @example
18
- * ```ts
19
- * updateJsonFileSync('./package.json', (json) => {
20
- * json.version = '1.0.1';
21
- * return json;
22
- * });
23
- * ```
24
- */
25
- function updateJsonFileSync(filepath, update, defaultJson) {
26
- let json;
27
- try {
28
- json = fs_1.default.readFileSync(filepath, 'utf8');
29
- }
30
- catch (error) {
31
- if (!defaultJson)
32
- throw error;
33
- json = defaultJson;
34
- }
35
- const result = update(JSON.parse(json));
36
- if (!result)
37
- return;
38
- const indents = (0, getJsonIndentation_1.getJsonIndentation)(json);
39
- (0, writeJsonFileSync_1.writeJsonFileSync)(filepath, result, !!indents, indents);
40
- }
41
- exports.updateJsonFileSync = updateJsonFileSync;
42
- //# sourceMappingURL=updateJsonFileSync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateJsonFileSync.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/updateJsonFileSync.ts"],"names":[],"mappings":";;;;AAAA,oDAAmB;AACnB,6DAAyD;AACzD,2DAAuD;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,kBAAkB,CAChC,QAAgB,EAChB,MAA+D,EAC/D,WAAoB;IAEpB,IAAI,IAAY,CAAA;IAChB,IAAI;QACF,IAAI,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;KACzC;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,WAAW;YAAE,MAAM,KAAK,CAAA;QAC7B,IAAI,GAAG,WAAW,CAAA;KACnB;IACD,MAAM,MAAM,GAA4B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;IAChE,IAAI,CAAC,MAAM;QAAE,OAAM;IACnB,MAAM,OAAO,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,CAAA;IACxC,IAAA,qCAAiB,EAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzD,CAAC;AAhBD,gDAgBC"}
@@ -1 +0,0 @@
1
- export declare function wipeDirectorySafe(dirpath: string): Promise<void>;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wipeDirectorySafe = void 0;
4
- const tslib_1 = require("tslib");
5
- const createDirectory_1 = require("./createDirectory");
6
- const deleteDirectorySafe_1 = require("./deleteDirectorySafe");
7
- function wipeDirectorySafe(dirpath) {
8
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
9
- yield (0, deleteDirectorySafe_1.deleteDirectorySafe)(dirpath);
10
- yield (0, createDirectory_1.createDirectory)(dirpath);
11
- });
12
- }
13
- exports.wipeDirectorySafe = wipeDirectorySafe;
14
- //# sourceMappingURL=wipeDirectorySafe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wipeDirectorySafe.js","sourceRoot":"","sources":["../../../../../packages/fs/src/lib/wipeDirectorySafe.ts"],"names":[],"mappings":";;;;AAAA,uDAAmD;AACnD,+DAA2D;AAE3D,SAAsB,iBAAiB,CAAC,OAAe;;QACrD,MAAM,IAAA,yCAAmB,EAAC,OAAO,CAAC,CAAA;QAClC,MAAM,IAAA,iCAAe,EAAC,OAAO,CAAC,CAAA;IAChC,CAAC;CAAA;AAHD,8CAGC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Writes a JSON file to the specified filepath. The data to be written is passed as an argument.
3
- * If the 'pretty' argument is set to true, the JSON data will be formatted in a more human-readable way.
4
- * @template T - The type of the data to be written to the file.
5
- * @param filepath - The path to the file where the data should be written.
6
- * @param data - The data to be written to the file.
7
- * @param pretty - Optional. If set to true, formats the JSON data in a more human-readable way. Default is false.
8
- * @returns A Promise that resolves when the file has been successfully written.
9
- * @example ```ts
10
- * const data = { name: 'John', age: 30 };
11
- * await writeJsonFile('./data.json', data, true);
12
- * ```
13
- */
14
- export declare function writeJsonFile<T>(filepath: string, data: T, pretty?: boolean, indents?: number): Promise<void>;