@duplojs/server 0.0.0-stage → 0.1.0-beta.10

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 (280) hide show
  1. package/README.md +8 -2
  2. package/dist/_virtual/_rolldown/runtime.cjs +33 -0
  3. package/dist/_virtual/_rolldown/runtime.mjs +17 -0
  4. package/dist/command/argument.cjs +27 -0
  5. package/dist/command/argument.d.ts +18 -0
  6. package/dist/command/argument.mjs +24 -0
  7. package/dist/command/create.cjs +102 -0
  8. package/dist/command/create.d.ts +47 -0
  9. package/dist/command/create.mjs +96 -0
  10. package/dist/command/error.cjs +206 -0
  11. package/dist/command/error.d.ts +61 -0
  12. package/dist/command/error.mjs +193 -0
  13. package/dist/command/exec.cjs +19 -0
  14. package/dist/command/exec.d.ts +14 -0
  15. package/dist/command/exec.mjs +17 -0
  16. package/dist/command/execOptions.cjs +41 -0
  17. package/dist/command/execOptions.d.ts +14 -0
  18. package/dist/command/execOptions.mjs +37 -0
  19. package/dist/command/help.cjs +250 -0
  20. package/dist/command/help.d.ts +10 -0
  21. package/dist/command/help.mjs +237 -0
  22. package/dist/command/index.cjs +82 -0
  23. package/dist/command/index.d.ts +8 -0
  24. package/dist/command/index.mjs +47 -0
  25. package/dist/command/kind.cjs +7 -0
  26. package/dist/command/kind.d.ts +2 -0
  27. package/dist/command/kind.mjs +5 -0
  28. package/dist/command/options/base.cjs +76 -0
  29. package/dist/command/options/base.d.ts +30 -0
  30. package/dist/command/options/base.mjs +69 -0
  31. package/dist/command/options/defaults/array.cjs +35 -0
  32. package/dist/command/options/defaults/array.d.ts +26 -0
  33. package/dist/command/options/defaults/array.mjs +29 -0
  34. package/dist/command/options/defaults/boolean.cjs +28 -0
  35. package/dist/command/options/defaults/boolean.d.ts +14 -0
  36. package/dist/command/options/defaults/boolean.mjs +25 -0
  37. package/dist/command/options/defaults/index.d.ts +3 -0
  38. package/dist/command/options/defaults/simple.cjs +25 -0
  39. package/dist/command/options/defaults/simple.d.ts +18 -0
  40. package/dist/command/options/defaults/simple.mjs +22 -0
  41. package/dist/command/options/identifier.cjs +7 -0
  42. package/dist/command/options/identifier.d.ts +4 -0
  43. package/dist/command/options/identifier.mjs +5 -0
  44. package/dist/command/options/index.d.ts +4 -0
  45. package/dist/command/options/types/index.d.ts +1 -0
  46. package/dist/command/options/types/options.d.ts +9 -0
  47. package/dist/command/types/eligibleType.d.ts +4 -0
  48. package/dist/command/types/forbiddenDuplicateName.d.ts +11 -0
  49. package/dist/command/types/forbiddenInvalidIdentifier.d.ts +6 -0
  50. package/dist/command/types/index.d.ts +3 -0
  51. package/dist/common/environmentVariable/expandEnvironmentVariables.cjs +27 -0
  52. package/dist/common/environmentVariable/expandEnvironmentVariables.d.ts +2 -0
  53. package/dist/common/environmentVariable/expandEnvironmentVariables.mjs +22 -0
  54. package/dist/common/environmentVariable/index.cjs +47 -0
  55. package/dist/common/environmentVariable/index.d.ts +16 -0
  56. package/dist/common/environmentVariable/index.mjs +41 -0
  57. package/dist/common/environmentVariable/overrideEnvironmentVariables.cjs +13 -0
  58. package/dist/common/environmentVariable/overrideEnvironmentVariables.d.ts +3 -0
  59. package/dist/common/environmentVariable/overrideEnvironmentVariables.mjs +9 -0
  60. package/dist/common/environmentVariable/parseEnvironmentFiles.cjs +32 -0
  61. package/dist/common/environmentVariable/parseEnvironmentFiles.d.ts +5 -0
  62. package/dist/common/environmentVariable/parseEnvironmentFiles.mjs +26 -0
  63. package/dist/common/environmentVariableOrThrow.cjs +23 -0
  64. package/dist/common/environmentVariableOrThrow.d.ts +12 -0
  65. package/dist/common/environmentVariableOrThrow.mjs +19 -0
  66. package/dist/common/exitProcess.cjs +7 -0
  67. package/dist/common/exitProcess.d.ts +6 -0
  68. package/dist/common/exitProcess.mjs +8 -0
  69. package/dist/common/getCurrentWorkDirectory.cjs +15 -0
  70. package/dist/common/getCurrentWorkDirectory.d.ts +8 -0
  71. package/dist/common/getCurrentWorkDirectory.mjs +11 -0
  72. package/dist/common/getCurrentWorkDirectoryOrThrow.cjs +25 -0
  73. package/dist/common/getCurrentWorkDirectoryOrThrow.d.ts +8 -0
  74. package/dist/common/getCurrentWorkDirectoryOrThrow.mjs +20 -0
  75. package/dist/common/getProcessArguments.cjs +18 -0
  76. package/dist/common/getProcessArguments.d.ts +6 -0
  77. package/dist/common/getProcessArguments.mjs +18 -0
  78. package/dist/common/index.cjs +44 -0
  79. package/dist/common/index.d.ts +9 -0
  80. package/dist/common/index.mjs +27 -0
  81. package/dist/common/meta/getCurrentDirectoryName.cjs +10 -0
  82. package/dist/common/meta/getCurrentDirectoryName.d.ts +7 -0
  83. package/dist/common/meta/getCurrentDirectoryName.mjs +7 -0
  84. package/dist/common/meta/index.d.ts +7 -0
  85. package/dist/common/setCurrentWorkingDirectory.cjs +11 -0
  86. package/dist/common/setCurrentWorkingDirectory.d.ts +8 -0
  87. package/dist/common/setCurrentWorkingDirectory.mjs +9 -0
  88. package/dist/common/setCurrentWorkingDirectoryOrThrow.cjs +23 -0
  89. package/dist/common/setCurrentWorkingDirectoryOrThrow.d.ts +8 -0
  90. package/dist/common/setCurrentWorkingDirectoryOrThrow.mjs +18 -0
  91. package/dist/dataStructure/common/codec/defaults/index.d.ts +2 -0
  92. package/dist/dataStructure/common/codec/defaults/json.cjs +25 -0
  93. package/dist/dataStructure/common/codec/defaults/json.d.ts +9 -0
  94. package/dist/dataStructure/common/codec/defaults/json.mjs +22 -0
  95. package/dist/dataStructure/common/codec/defaults/string.cjs +25 -0
  96. package/dist/dataStructure/common/codec/defaults/string.d.ts +13 -0
  97. package/dist/dataStructure/common/codec/defaults/string.mjs +22 -0
  98. package/dist/dataStructure/common/codec/index.d.ts +1 -0
  99. package/dist/dataStructure/common/error/defaultInterpreter.cjs +29 -0
  100. package/dist/dataStructure/common/error/defaultInterpreter.d.ts +69 -0
  101. package/dist/dataStructure/common/error/defaultInterpreter.mjs +26 -0
  102. package/dist/dataStructure/common/error/index.d.ts +1 -0
  103. package/dist/dataStructure/common/index.d.ts +2 -0
  104. package/dist/dataStructure/constraint/fileExist.cjs +19 -0
  105. package/dist/dataStructure/constraint/fileExist.d.ts +10 -0
  106. package/dist/dataStructure/constraint/fileExist.mjs +15 -0
  107. package/dist/dataStructure/constraint/folderExist.cjs +19 -0
  108. package/dist/dataStructure/constraint/folderExist.d.ts +10 -0
  109. package/dist/dataStructure/constraint/folderExist.mjs +15 -0
  110. package/dist/dataStructure/constraint/index.d.ts +5 -0
  111. package/dist/dataStructure/constraint/mimeType.cjs +18 -0
  112. package/dist/dataStructure/constraint/mimeType.d.ts +11 -0
  113. package/dist/dataStructure/constraint/mimeType.mjs +14 -0
  114. package/dist/dataStructure/constraint/size.cjs +29 -0
  115. package/dist/dataStructure/constraint/size.d.ts +16 -0
  116. package/dist/dataStructure/constraint/size.mjs +24 -0
  117. package/dist/dataStructure/constraint/types/constraints.d.ts +12 -0
  118. package/dist/dataStructure/constraint/types/index.d.ts +1 -0
  119. package/dist/dataStructure/fundamentalType/file.cjs +11 -0
  120. package/dist/dataStructure/fundamentalType/file.d.ts +8 -0
  121. package/dist/dataStructure/fundamentalType/file.mjs +8 -0
  122. package/dist/dataStructure/fundamentalType/folder.cjs +11 -0
  123. package/dist/dataStructure/fundamentalType/folder.d.ts +8 -0
  124. package/dist/dataStructure/fundamentalType/folder.mjs +8 -0
  125. package/dist/dataStructure/fundamentalType/index.d.ts +3 -0
  126. package/dist/dataStructure/fundamentalType/types/fundamentalTypes.d.ts +8 -0
  127. package/dist/dataStructure/fundamentalType/types/index.d.ts +1 -0
  128. package/dist/dataStructure/helper/file.cjs +10 -0
  129. package/dist/dataStructure/helper/file.d.ts +3 -0
  130. package/dist/dataStructure/helper/file.mjs +8 -0
  131. package/dist/dataStructure/helper/fileExist.cjs +7 -0
  132. package/dist/dataStructure/helper/fileExist.d.ts +2 -0
  133. package/dist/dataStructure/helper/fileExist.mjs +7 -0
  134. package/dist/dataStructure/helper/folder.cjs +10 -0
  135. package/dist/dataStructure/helper/folder.d.ts +3 -0
  136. package/dist/dataStructure/helper/folder.mjs +8 -0
  137. package/dist/dataStructure/helper/folderExist.cjs +7 -0
  138. package/dist/dataStructure/helper/folderExist.d.ts +2 -0
  139. package/dist/dataStructure/helper/folderExist.mjs +7 -0
  140. package/dist/dataStructure/helper/index.d.ts +6 -0
  141. package/dist/dataStructure/helper/mimeType.cjs +7 -0
  142. package/dist/dataStructure/helper/mimeType.d.ts +2 -0
  143. package/dist/dataStructure/helper/mimeType.mjs +7 -0
  144. package/dist/dataStructure/helper/size.cjs +7 -0
  145. package/dist/dataStructure/helper/size.d.ts +2 -0
  146. package/dist/dataStructure/helper/size.mjs +7 -0
  147. package/dist/dataStructure/index.cjs +83 -0
  148. package/dist/dataStructure/index.d.ts +6 -0
  149. package/dist/dataStructure/index.mjs +51 -0
  150. package/dist/dataStructure/kind.cjs +7 -0
  151. package/dist/dataStructure/kind.d.ts +2 -0
  152. package/dist/dataStructure/kind.mjs +5 -0
  153. package/dist/dataStructure/type/file.cjs +14 -0
  154. package/dist/dataStructure/type/file.d.ts +11 -0
  155. package/dist/dataStructure/type/file.mjs +11 -0
  156. package/dist/dataStructure/type/folder.cjs +14 -0
  157. package/dist/dataStructure/type/folder.d.ts +11 -0
  158. package/dist/dataStructure/type/folder.mjs +11 -0
  159. package/dist/dataStructure/type/index.d.ts +3 -0
  160. package/dist/dataStructure/type/types/index.d.ts +1 -0
  161. package/dist/dataStructure/type/types/types.d.ts +8 -0
  162. package/dist/file/appendFile.cjs +67 -0
  163. package/dist/file/appendFile.d.ts +43 -0
  164. package/dist/file/appendFile.mjs +54 -0
  165. package/dist/file/appendTextFile.cjs +67 -0
  166. package/dist/file/appendTextFile.d.ts +43 -0
  167. package/dist/file/appendTextFile.mjs +54 -0
  168. package/dist/file/copy.cjs +53 -0
  169. package/dist/file/copy.d.ts +43 -0
  170. package/dist/file/copy.mjs +40 -0
  171. package/dist/file/createEntryInterface.cjs +19 -0
  172. package/dist/file/createEntryInterface.d.ts +3 -0
  173. package/dist/file/createEntryInterface.mjs +15 -0
  174. package/dist/file/ensureDirectory.cjs +52 -0
  175. package/dist/file/ensureDirectory.d.ts +36 -0
  176. package/dist/file/ensureDirectory.mjs +41 -0
  177. package/dist/file/ensureFile.cjs +60 -0
  178. package/dist/file/ensureFile.d.ts +39 -0
  179. package/dist/file/ensureFile.mjs +48 -0
  180. package/dist/file/exists.cjs +43 -0
  181. package/dist/file/exists.d.ts +27 -0
  182. package/dist/file/exists.mjs +35 -0
  183. package/dist/file/fileInterface.cjs +76 -0
  184. package/dist/file/fileInterface.d.ts +31 -0
  185. package/dist/file/fileInterface.mjs +70 -0
  186. package/dist/file/folderInterface.cjs +76 -0
  187. package/dist/file/folderInterface.d.ts +33 -0
  188. package/dist/file/folderInterface.mjs +70 -0
  189. package/dist/file/index.cjs +634 -0
  190. package/dist/file/index.d.ts +35 -0
  191. package/dist/file/index.mjs +335 -0
  192. package/dist/file/link.cjs +70 -0
  193. package/dist/file/link.d.ts +46 -0
  194. package/dist/file/link.mjs +56 -0
  195. package/dist/file/linkStat.cjs +98 -0
  196. package/dist/file/linkStat.d.ts +31 -0
  197. package/dist/file/linkStat.mjs +88 -0
  198. package/dist/file/makeDirectory.cjs +60 -0
  199. package/dist/file/makeDirectory.d.ts +45 -0
  200. package/dist/file/makeDirectory.mjs +47 -0
  201. package/dist/file/makeTemporaryDirectory.cjs +48 -0
  202. package/dist/file/makeTemporaryDirectory.d.ts +32 -0
  203. package/dist/file/makeTemporaryDirectory.mjs +38 -0
  204. package/dist/file/makeTemporaryFile.cjs +62 -0
  205. package/dist/file/makeTemporaryFile.d.ts +36 -0
  206. package/dist/file/makeTemporaryFile.mjs +50 -0
  207. package/dist/file/move.cjs +71 -0
  208. package/dist/file/move.d.ts +46 -0
  209. package/dist/file/move.mjs +57 -0
  210. package/dist/file/readDirectory.cjs +44 -0
  211. package/dist/file/readDirectory.d.ts +35 -0
  212. package/dist/file/readDirectory.mjs +33 -0
  213. package/dist/file/readFile.cjs +51 -0
  214. package/dist/file/readFile.d.ts +33 -0
  215. package/dist/file/readFile.mjs +41 -0
  216. package/dist/file/readJsonFile.cjs +51 -0
  217. package/dist/file/readJsonFile.d.ts +33 -0
  218. package/dist/file/readJsonFile.mjs +41 -0
  219. package/dist/file/readLink.cjs +46 -0
  220. package/dist/file/readLink.d.ts +30 -0
  221. package/dist/file/readLink.mjs +37 -0
  222. package/dist/file/readTextFile.cjs +51 -0
  223. package/dist/file/readTextFile.d.ts +33 -0
  224. package/dist/file/readTextFile.mjs +41 -0
  225. package/dist/file/realPath.cjs +42 -0
  226. package/dist/file/realPath.d.ts +27 -0
  227. package/dist/file/realPath.mjs +34 -0
  228. package/dist/file/relocate.cjs +83 -0
  229. package/dist/file/relocate.d.ts +46 -0
  230. package/dist/file/relocate.mjs +68 -0
  231. package/dist/file/remove.cjs +60 -0
  232. package/dist/file/remove.d.ts +42 -0
  233. package/dist/file/remove.mjs +48 -0
  234. package/dist/file/rename.cjs +83 -0
  235. package/dist/file/rename.d.ts +46 -0
  236. package/dist/file/rename.mjs +68 -0
  237. package/dist/file/setMode.cjs +65 -0
  238. package/dist/file/setMode.d.ts +45 -0
  239. package/dist/file/setMode.mjs +56 -0
  240. package/dist/file/setOwner.cjs +53 -0
  241. package/dist/file/setOwner.d.ts +35 -0
  242. package/dist/file/setOwner.mjs +44 -0
  243. package/dist/file/setTime.cjs +55 -0
  244. package/dist/file/setTime.d.ts +36 -0
  245. package/dist/file/setTime.mjs +45 -0
  246. package/dist/file/stat.cjs +99 -0
  247. package/dist/file/stat.d.ts +62 -0
  248. package/dist/file/stat.mjs +89 -0
  249. package/dist/file/symlink.cjs +64 -0
  250. package/dist/file/symlink.d.ts +48 -0
  251. package/dist/file/symlink.mjs +52 -0
  252. package/dist/file/truncate.cjs +60 -0
  253. package/dist/file/truncate.d.ts +42 -0
  254. package/dist/file/truncate.mjs +47 -0
  255. package/dist/file/unknownEntryInterface.cjs +40 -0
  256. package/dist/file/unknownEntryInterface.d.ts +17 -0
  257. package/dist/file/unknownEntryInterface.mjs +35 -0
  258. package/dist/file/walkDirectory.cjs +57 -0
  259. package/dist/file/walkDirectory.d.ts +37 -0
  260. package/dist/file/walkDirectory.mjs +45 -0
  261. package/dist/file/writeFile.cjs +68 -0
  262. package/dist/file/writeFile.d.ts +43 -0
  263. package/dist/file/writeFile.mjs +55 -0
  264. package/dist/file/writeJsonFile.cjs +77 -0
  265. package/dist/file/writeJsonFile.d.ts +46 -0
  266. package/dist/file/writeJsonFile.mjs +64 -0
  267. package/dist/file/writeTextFile.cjs +68 -0
  268. package/dist/file/writeTextFile.d.ts +43 -0
  269. package/dist/file/writeTextFile.mjs +55 -0
  270. package/dist/implementor.cjs +67 -0
  271. package/dist/implementor.d.ts +35 -0
  272. package/dist/implementor.mjs +55 -0
  273. package/dist/index.cjs +76 -0
  274. package/dist/index.d.ts +9 -0
  275. package/dist/index.mjs +15 -0
  276. package/dist/kind.cjs +7 -0
  277. package/dist/kind.d.ts +2 -0
  278. package/dist/kind.mjs +5 -0
  279. package/dist/override.d.ts +8 -0
  280. package/package.json +81 -3
@@ -0,0 +1,35 @@
1
+ export * from './appendFile';
2
+ export * from './appendTextFile';
3
+ export * from './copy';
4
+ export * from './createEntryInterface';
5
+ export * from './ensureDirectory';
6
+ export * from './ensureFile';
7
+ export * from './exists';
8
+ export * from './fileInterface';
9
+ export * from './folderInterface';
10
+ export * from './link';
11
+ export * from './linkStat';
12
+ export * from './makeDirectory';
13
+ export * from './makeTemporaryDirectory';
14
+ export * from './makeTemporaryFile';
15
+ export * from './move';
16
+ export * from './readDirectory';
17
+ export * from './readFile';
18
+ export * from './readJsonFile';
19
+ export * from './readLink';
20
+ export * from './readTextFile';
21
+ export * from './realPath';
22
+ export * from './relocate';
23
+ export * from './remove';
24
+ export * from './rename';
25
+ export * from './setMode';
26
+ export * from './setOwner';
27
+ export * from './setTime';
28
+ export * from './stat';
29
+ export * from './symlink';
30
+ export * from './truncate';
31
+ export * from './unknownEntryInterface';
32
+ export * from './walkDirectory';
33
+ export * from './writeFile';
34
+ export * from './writeJsonFile';
35
+ export * from './writeTextFile';
@@ -0,0 +1,335 @@
1
+ import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
+ import { AppendFileError, AppendFileErrorBusy, AppendFileErrorInvalidArgument, AppendFileErrorIsDirectory, AppendFileErrorNoSpace, AppendFileErrorNotDirectory, AppendFileErrorNotFound, AppendFileErrorPermissionDenied, AppendFileErrorReadOnly, AppendFileErrorTooManyOpenFiles, appendFile } from "./appendFile.mjs";
3
+ import { AppendTextFileError, AppendTextFileErrorBusy, AppendTextFileErrorInvalidArgument, AppendTextFileErrorIsDirectory, AppendTextFileErrorNoSpace, AppendTextFileErrorNotDirectory, AppendTextFileErrorNotFound, AppendTextFileErrorPermissionDenied, AppendTextFileErrorReadOnly, AppendTextFileErrorTooManyOpenFiles, appendTextFile } from "./appendTextFile.mjs";
4
+ import { CopyError, CopyErrorAlreadyExists, CopyErrorBusy, CopyErrorInvalidArgument, CopyErrorNoSpace, CopyErrorNotDirectory, CopyErrorNotFound, CopyErrorPermissionDenied, CopyErrorReadOnly, CopyErrorTooManyOpenFiles, copy } from "./copy.mjs";
5
+ import { StatError, StatErrorBusy, StatErrorNotDirectory, StatErrorNotFound, StatErrorPermissionDenied, StatErrorTooManyOpenFiles, stat } from "./stat.mjs";
6
+ import { RenameError, RenameErrorAlreadyExists, RenameErrorBusy, RenameErrorCrossDevice, RenameErrorDirectoryNotEmpty, RenameErrorInvalidArgument, RenameErrorIsDirectory, RenameErrorNotDirectory, RenameErrorNotFound, RenameErrorPermissionDenied, RenameErrorReadOnly, rename } from "./rename.mjs";
7
+ import { ExistsError, ExistsErrorNotDirectory, ExistsErrorNotFound, ExistsErrorPermissionDenied, ExistsErrorTooManyOpenFiles, exists } from "./exists.mjs";
8
+ import { MoveError, MoveErrorAlreadyExists, MoveErrorBusy, MoveErrorCrossDevice, MoveErrorDirectoryNotEmpty, MoveErrorInvalidArgument, MoveErrorIsDirectory, MoveErrorNotDirectory, MoveErrorNotFound, MoveErrorPermissionDenied, MoveErrorReadOnly, move } from "./move.mjs";
9
+ import { RemoveError, RemoveErrorBusy, RemoveErrorDirectoryNotEmpty, RemoveErrorInvalidArgument, RemoveErrorIsDirectory, RemoveErrorNotDirectory, RemoveErrorNotFound, RemoveErrorPermissionDenied, RemoveErrorReadOnly, remove } from "./remove.mjs";
10
+ import { RelocateError, RelocateErrorAlreadyExists, RelocateErrorBusy, RelocateErrorCrossDevice, RelocateErrorDirectoryNotEmpty, RelocateErrorInvalidArgument, RelocateErrorIsDirectory, RelocateErrorNotDirectory, RelocateErrorNotFound, RelocateErrorPermissionDenied, RelocateErrorReadOnly, relocate } from "./relocate.mjs";
11
+ import { createFileInterface, isFileInterface, isFileInterfaceFromUnknown } from "./fileInterface.mjs";
12
+ import { ReadDirectoryError, ReadDirectoryErrorBusy, ReadDirectoryErrorNotDirectory, ReadDirectoryErrorNotFound, ReadDirectoryErrorPermissionDenied, ReadDirectoryErrorTooManyOpenFiles, readDirectory } from "./readDirectory.mjs";
13
+ import { createUnknownEntryInterface, isUnknownEntryInterface, isUnknownEntryInterfaceFromUnknown } from "./unknownEntryInterface.mjs";
14
+ import { WalkDirectoryError, WalkDirectoryErrorBusy, WalkDirectoryErrorNotDirectory, WalkDirectoryErrorNotFound, WalkDirectoryErrorPermissionDenied, WalkDirectoryErrorTooManyOpenFiles, walkDirectory } from "./walkDirectory.mjs";
15
+ import { createFolderInterface, isFolderInterface, isFolderInterfaceFromUnknown } from "./folderInterface.mjs";
16
+ import { createEntryInterface } from "./createEntryInterface.mjs";
17
+ import { EnsureDirectoryError, EnsureDirectoryErrorBusy, EnsureDirectoryErrorInvalidArgument, EnsureDirectoryErrorNoSpace, EnsureDirectoryErrorNotDirectory, EnsureDirectoryErrorPermissionDenied, EnsureDirectoryErrorReadOnly, EnsureDirectoryErrorTooManyOpenFiles, ensureDirectory } from "./ensureDirectory.mjs";
18
+ import { EnsureFileError, EnsureFileErrorBusy, EnsureFileErrorInvalidArgument, EnsureFileErrorIsDirectory, EnsureFileErrorNoSpace, EnsureFileErrorNotDirectory, EnsureFileErrorPermissionDenied, EnsureFileErrorReadOnly, EnsureFileErrorTooManyOpenFiles, ensureFile } from "./ensureFile.mjs";
19
+ import { LinkError, LinkErrorAlreadyExists, LinkErrorBusy, LinkErrorCrossDevice, LinkErrorInvalidArgument, LinkErrorNoSpace, LinkErrorNotDirectory, LinkErrorNotFound, LinkErrorPermissionDenied, LinkErrorReadOnly, LinkErrorTooManyOpenFiles, link } from "./link.mjs";
20
+ import { LinkStatError, LinkStatErrorBusy, LinkStatErrorNotDirectory, LinkStatErrorNotFound, LinkStatErrorPermissionDenied, LinkStatErrorTooManyOpenFiles, linkStat } from "./linkStat.mjs";
21
+ import { MakeDirectoryError, MakeDirectoryErrorAlreadyExists, MakeDirectoryErrorBusy, MakeDirectoryErrorInvalidArgument, MakeDirectoryErrorNoSpace, MakeDirectoryErrorNotDirectory, MakeDirectoryErrorNotFound, MakeDirectoryErrorPermissionDenied, MakeDirectoryErrorReadOnly, MakeDirectoryErrorTooManyOpenFiles, makeDirectory } from "./makeDirectory.mjs";
22
+ import { MakeTemporaryDirectoryError, MakeTemporaryDirectoryErrorInvalidArgument, MakeTemporaryDirectoryErrorNoSpace, MakeTemporaryDirectoryErrorNotDirectory, MakeTemporaryDirectoryErrorPermissionDenied, MakeTemporaryDirectoryErrorReadOnly, MakeTemporaryDirectoryErrorTooManyOpenFiles, makeTemporaryDirectory } from "./makeTemporaryDirectory.mjs";
23
+ import { MakeTemporaryFileError, MakeTemporaryFileErrorAlreadyExists, MakeTemporaryFileErrorInvalidArgument, MakeTemporaryFileErrorNoSpace, MakeTemporaryFileErrorNotDirectory, MakeTemporaryFileErrorPermissionDenied, MakeTemporaryFileErrorReadOnly, MakeTemporaryFileErrorTooManyOpenFiles, makeTemporaryFile } from "./makeTemporaryFile.mjs";
24
+ import { ReadFileError, ReadFileErrorBusy, ReadFileErrorIsDirectory, ReadFileErrorNotDirectory, ReadFileErrorNotFound, ReadFileErrorPermissionDenied, ReadFileErrorTooManyOpenFiles, readFile } from "./readFile.mjs";
25
+ import { ReadJsonFileError, ReadJsonFileErrorBusy, ReadJsonFileErrorIsDirectory, ReadJsonFileErrorNotDirectory, ReadJsonFileErrorNotFound, ReadJsonFileErrorPermissionDenied, ReadJsonFileErrorTooManyOpenFiles, readJsonFile } from "./readJsonFile.mjs";
26
+ import { ReadLinkError, ReadLinkErrorInvalidArgument, ReadLinkErrorNotDirectory, ReadLinkErrorNotFound, ReadLinkErrorPermissionDenied, ReadLinkErrorTooManyOpenFiles, readLink } from "./readLink.mjs";
27
+ import { ReadTextFileError, ReadTextFileErrorBusy, ReadTextFileErrorIsDirectory, ReadTextFileErrorNotDirectory, ReadTextFileErrorNotFound, ReadTextFileErrorPermissionDenied, ReadTextFileErrorTooManyOpenFiles, readTextFile } from "./readTextFile.mjs";
28
+ import { RealPathError, RealPathErrorNotDirectory, RealPathErrorNotFound, RealPathErrorPermissionDenied, RealPathErrorTooManyOpenFiles, realPath } from "./realPath.mjs";
29
+ import { SetModeError, SetModeErrorInvalidArgument, SetModeErrorNotDirectory, SetModeErrorNotFound, SetModeErrorPermissionDenied, SetModeErrorReadOnly, setMode } from "./setMode.mjs";
30
+ import { SetOwnerError, SetOwnerErrorInvalidArgument, SetOwnerErrorNotDirectory, SetOwnerErrorNotFound, SetOwnerErrorPermissionDenied, SetOwnerErrorReadOnly, setOwner } from "./setOwner.mjs";
31
+ import { SetTimeError, SetTimeErrorInvalidArgument, SetTimeErrorNotDirectory, SetTimeErrorNotFound, SetTimeErrorPermissionDenied, SetTimeErrorReadOnly, setTime } from "./setTime.mjs";
32
+ import { SymlinkError, SymlinkErrorAlreadyExists, SymlinkErrorBusy, SymlinkErrorInvalidArgument, SymlinkErrorNotDirectory, SymlinkErrorNotFound, SymlinkErrorPermissionDenied, SymlinkErrorReadOnly, SymlinkErrorTooManyOpenFiles, symlink } from "./symlink.mjs";
33
+ import { TruncateError, TruncateErrorBusy, TruncateErrorInvalidArgument, TruncateErrorIsDirectory, TruncateErrorNoSpace, TruncateErrorNotDirectory, TruncateErrorNotFound, TruncateErrorPermissionDenied, TruncateErrorReadOnly, TruncateErrorTooManyOpenFiles, truncate } from "./truncate.mjs";
34
+ import { WriteFileError, WriteFileErrorBusy, WriteFileErrorInvalidArgument, WriteFileErrorIsDirectory, WriteFileErrorNoSpace, WriteFileErrorNotDirectory, WriteFileErrorNotFound, WriteFileErrorPermissionDenied, WriteFileErrorReadOnly, WriteFileErrorTooManyOpenFiles, writeFile } from "./writeFile.mjs";
35
+ import { WriteJsonFileError, WriteJsonFileErrorBusy, WriteJsonFileErrorInvalidArgument, WriteJsonFileErrorIsDirectory, WriteJsonFileErrorNoSpace, WriteJsonFileErrorNotDirectory, WriteJsonFileErrorNotFound, WriteJsonFileErrorPermissionDenied, WriteJsonFileErrorReadOnly, WriteJsonFileErrorTooManyOpenFiles, writeJsonFile } from "./writeJsonFile.mjs";
36
+ import { WriteTextFileError, WriteTextFileErrorBusy, WriteTextFileErrorInvalidArgument, WriteTextFileErrorIsDirectory, WriteTextFileErrorNoSpace, WriteTextFileErrorNotDirectory, WriteTextFileErrorNotFound, WriteTextFileErrorPermissionDenied, WriteTextFileErrorReadOnly, WriteTextFileErrorTooManyOpenFiles, writeTextFile } from "./writeTextFile.mjs";
37
+ //#region scripts/file/index.ts
38
+ var file_exports = /* @__PURE__ */ __exportAll({
39
+ AppendFileError: () => AppendFileError,
40
+ AppendFileErrorBusy: () => AppendFileErrorBusy,
41
+ AppendFileErrorInvalidArgument: () => AppendFileErrorInvalidArgument,
42
+ AppendFileErrorIsDirectory: () => AppendFileErrorIsDirectory,
43
+ AppendFileErrorNoSpace: () => AppendFileErrorNoSpace,
44
+ AppendFileErrorNotDirectory: () => AppendFileErrorNotDirectory,
45
+ AppendFileErrorNotFound: () => AppendFileErrorNotFound,
46
+ AppendFileErrorPermissionDenied: () => AppendFileErrorPermissionDenied,
47
+ AppendFileErrorReadOnly: () => AppendFileErrorReadOnly,
48
+ AppendFileErrorTooManyOpenFiles: () => AppendFileErrorTooManyOpenFiles,
49
+ AppendTextFileError: () => AppendTextFileError,
50
+ AppendTextFileErrorBusy: () => AppendTextFileErrorBusy,
51
+ AppendTextFileErrorInvalidArgument: () => AppendTextFileErrorInvalidArgument,
52
+ AppendTextFileErrorIsDirectory: () => AppendTextFileErrorIsDirectory,
53
+ AppendTextFileErrorNoSpace: () => AppendTextFileErrorNoSpace,
54
+ AppendTextFileErrorNotDirectory: () => AppendTextFileErrorNotDirectory,
55
+ AppendTextFileErrorNotFound: () => AppendTextFileErrorNotFound,
56
+ AppendTextFileErrorPermissionDenied: () => AppendTextFileErrorPermissionDenied,
57
+ AppendTextFileErrorReadOnly: () => AppendTextFileErrorReadOnly,
58
+ AppendTextFileErrorTooManyOpenFiles: () => AppendTextFileErrorTooManyOpenFiles,
59
+ CopyError: () => CopyError,
60
+ CopyErrorAlreadyExists: () => CopyErrorAlreadyExists,
61
+ CopyErrorBusy: () => CopyErrorBusy,
62
+ CopyErrorInvalidArgument: () => CopyErrorInvalidArgument,
63
+ CopyErrorNoSpace: () => CopyErrorNoSpace,
64
+ CopyErrorNotDirectory: () => CopyErrorNotDirectory,
65
+ CopyErrorNotFound: () => CopyErrorNotFound,
66
+ CopyErrorPermissionDenied: () => CopyErrorPermissionDenied,
67
+ CopyErrorReadOnly: () => CopyErrorReadOnly,
68
+ CopyErrorTooManyOpenFiles: () => CopyErrorTooManyOpenFiles,
69
+ EnsureDirectoryError: () => EnsureDirectoryError,
70
+ EnsureDirectoryErrorBusy: () => EnsureDirectoryErrorBusy,
71
+ EnsureDirectoryErrorInvalidArgument: () => EnsureDirectoryErrorInvalidArgument,
72
+ EnsureDirectoryErrorNoSpace: () => EnsureDirectoryErrorNoSpace,
73
+ EnsureDirectoryErrorNotDirectory: () => EnsureDirectoryErrorNotDirectory,
74
+ EnsureDirectoryErrorPermissionDenied: () => EnsureDirectoryErrorPermissionDenied,
75
+ EnsureDirectoryErrorReadOnly: () => EnsureDirectoryErrorReadOnly,
76
+ EnsureDirectoryErrorTooManyOpenFiles: () => EnsureDirectoryErrorTooManyOpenFiles,
77
+ EnsureFileError: () => EnsureFileError,
78
+ EnsureFileErrorBusy: () => EnsureFileErrorBusy,
79
+ EnsureFileErrorInvalidArgument: () => EnsureFileErrorInvalidArgument,
80
+ EnsureFileErrorIsDirectory: () => EnsureFileErrorIsDirectory,
81
+ EnsureFileErrorNoSpace: () => EnsureFileErrorNoSpace,
82
+ EnsureFileErrorNotDirectory: () => EnsureFileErrorNotDirectory,
83
+ EnsureFileErrorPermissionDenied: () => EnsureFileErrorPermissionDenied,
84
+ EnsureFileErrorReadOnly: () => EnsureFileErrorReadOnly,
85
+ EnsureFileErrorTooManyOpenFiles: () => EnsureFileErrorTooManyOpenFiles,
86
+ ExistsError: () => ExistsError,
87
+ ExistsErrorNotDirectory: () => ExistsErrorNotDirectory,
88
+ ExistsErrorNotFound: () => ExistsErrorNotFound,
89
+ ExistsErrorPermissionDenied: () => ExistsErrorPermissionDenied,
90
+ ExistsErrorTooManyOpenFiles: () => ExistsErrorTooManyOpenFiles,
91
+ LinkError: () => LinkError,
92
+ LinkErrorAlreadyExists: () => LinkErrorAlreadyExists,
93
+ LinkErrorBusy: () => LinkErrorBusy,
94
+ LinkErrorCrossDevice: () => LinkErrorCrossDevice,
95
+ LinkErrorInvalidArgument: () => LinkErrorInvalidArgument,
96
+ LinkErrorNoSpace: () => LinkErrorNoSpace,
97
+ LinkErrorNotDirectory: () => LinkErrorNotDirectory,
98
+ LinkErrorNotFound: () => LinkErrorNotFound,
99
+ LinkErrorPermissionDenied: () => LinkErrorPermissionDenied,
100
+ LinkErrorReadOnly: () => LinkErrorReadOnly,
101
+ LinkErrorTooManyOpenFiles: () => LinkErrorTooManyOpenFiles,
102
+ LinkStatError: () => LinkStatError,
103
+ LinkStatErrorBusy: () => LinkStatErrorBusy,
104
+ LinkStatErrorNotDirectory: () => LinkStatErrorNotDirectory,
105
+ LinkStatErrorNotFound: () => LinkStatErrorNotFound,
106
+ LinkStatErrorPermissionDenied: () => LinkStatErrorPermissionDenied,
107
+ LinkStatErrorTooManyOpenFiles: () => LinkStatErrorTooManyOpenFiles,
108
+ MakeDirectoryError: () => MakeDirectoryError,
109
+ MakeDirectoryErrorAlreadyExists: () => MakeDirectoryErrorAlreadyExists,
110
+ MakeDirectoryErrorBusy: () => MakeDirectoryErrorBusy,
111
+ MakeDirectoryErrorInvalidArgument: () => MakeDirectoryErrorInvalidArgument,
112
+ MakeDirectoryErrorNoSpace: () => MakeDirectoryErrorNoSpace,
113
+ MakeDirectoryErrorNotDirectory: () => MakeDirectoryErrorNotDirectory,
114
+ MakeDirectoryErrorNotFound: () => MakeDirectoryErrorNotFound,
115
+ MakeDirectoryErrorPermissionDenied: () => MakeDirectoryErrorPermissionDenied,
116
+ MakeDirectoryErrorReadOnly: () => MakeDirectoryErrorReadOnly,
117
+ MakeDirectoryErrorTooManyOpenFiles: () => MakeDirectoryErrorTooManyOpenFiles,
118
+ MakeTemporaryDirectoryError: () => MakeTemporaryDirectoryError,
119
+ MakeTemporaryDirectoryErrorInvalidArgument: () => MakeTemporaryDirectoryErrorInvalidArgument,
120
+ MakeTemporaryDirectoryErrorNoSpace: () => MakeTemporaryDirectoryErrorNoSpace,
121
+ MakeTemporaryDirectoryErrorNotDirectory: () => MakeTemporaryDirectoryErrorNotDirectory,
122
+ MakeTemporaryDirectoryErrorPermissionDenied: () => MakeTemporaryDirectoryErrorPermissionDenied,
123
+ MakeTemporaryDirectoryErrorReadOnly: () => MakeTemporaryDirectoryErrorReadOnly,
124
+ MakeTemporaryDirectoryErrorTooManyOpenFiles: () => MakeTemporaryDirectoryErrorTooManyOpenFiles,
125
+ MakeTemporaryFileError: () => MakeTemporaryFileError,
126
+ MakeTemporaryFileErrorAlreadyExists: () => MakeTemporaryFileErrorAlreadyExists,
127
+ MakeTemporaryFileErrorInvalidArgument: () => MakeTemporaryFileErrorInvalidArgument,
128
+ MakeTemporaryFileErrorNoSpace: () => MakeTemporaryFileErrorNoSpace,
129
+ MakeTemporaryFileErrorNotDirectory: () => MakeTemporaryFileErrorNotDirectory,
130
+ MakeTemporaryFileErrorPermissionDenied: () => MakeTemporaryFileErrorPermissionDenied,
131
+ MakeTemporaryFileErrorReadOnly: () => MakeTemporaryFileErrorReadOnly,
132
+ MakeTemporaryFileErrorTooManyOpenFiles: () => MakeTemporaryFileErrorTooManyOpenFiles,
133
+ MoveError: () => MoveError,
134
+ MoveErrorAlreadyExists: () => MoveErrorAlreadyExists,
135
+ MoveErrorBusy: () => MoveErrorBusy,
136
+ MoveErrorCrossDevice: () => MoveErrorCrossDevice,
137
+ MoveErrorDirectoryNotEmpty: () => MoveErrorDirectoryNotEmpty,
138
+ MoveErrorInvalidArgument: () => MoveErrorInvalidArgument,
139
+ MoveErrorIsDirectory: () => MoveErrorIsDirectory,
140
+ MoveErrorNotDirectory: () => MoveErrorNotDirectory,
141
+ MoveErrorNotFound: () => MoveErrorNotFound,
142
+ MoveErrorPermissionDenied: () => MoveErrorPermissionDenied,
143
+ MoveErrorReadOnly: () => MoveErrorReadOnly,
144
+ ReadDirectoryError: () => ReadDirectoryError,
145
+ ReadDirectoryErrorBusy: () => ReadDirectoryErrorBusy,
146
+ ReadDirectoryErrorNotDirectory: () => ReadDirectoryErrorNotDirectory,
147
+ ReadDirectoryErrorNotFound: () => ReadDirectoryErrorNotFound,
148
+ ReadDirectoryErrorPermissionDenied: () => ReadDirectoryErrorPermissionDenied,
149
+ ReadDirectoryErrorTooManyOpenFiles: () => ReadDirectoryErrorTooManyOpenFiles,
150
+ ReadFileError: () => ReadFileError,
151
+ ReadFileErrorBusy: () => ReadFileErrorBusy,
152
+ ReadFileErrorIsDirectory: () => ReadFileErrorIsDirectory,
153
+ ReadFileErrorNotDirectory: () => ReadFileErrorNotDirectory,
154
+ ReadFileErrorNotFound: () => ReadFileErrorNotFound,
155
+ ReadFileErrorPermissionDenied: () => ReadFileErrorPermissionDenied,
156
+ ReadFileErrorTooManyOpenFiles: () => ReadFileErrorTooManyOpenFiles,
157
+ ReadJsonFileError: () => ReadJsonFileError,
158
+ ReadJsonFileErrorBusy: () => ReadJsonFileErrorBusy,
159
+ ReadJsonFileErrorIsDirectory: () => ReadJsonFileErrorIsDirectory,
160
+ ReadJsonFileErrorNotDirectory: () => ReadJsonFileErrorNotDirectory,
161
+ ReadJsonFileErrorNotFound: () => ReadJsonFileErrorNotFound,
162
+ ReadJsonFileErrorPermissionDenied: () => ReadJsonFileErrorPermissionDenied,
163
+ ReadJsonFileErrorTooManyOpenFiles: () => ReadJsonFileErrorTooManyOpenFiles,
164
+ ReadLinkError: () => ReadLinkError,
165
+ ReadLinkErrorInvalidArgument: () => ReadLinkErrorInvalidArgument,
166
+ ReadLinkErrorNotDirectory: () => ReadLinkErrorNotDirectory,
167
+ ReadLinkErrorNotFound: () => ReadLinkErrorNotFound,
168
+ ReadLinkErrorPermissionDenied: () => ReadLinkErrorPermissionDenied,
169
+ ReadLinkErrorTooManyOpenFiles: () => ReadLinkErrorTooManyOpenFiles,
170
+ ReadTextFileError: () => ReadTextFileError,
171
+ ReadTextFileErrorBusy: () => ReadTextFileErrorBusy,
172
+ ReadTextFileErrorIsDirectory: () => ReadTextFileErrorIsDirectory,
173
+ ReadTextFileErrorNotDirectory: () => ReadTextFileErrorNotDirectory,
174
+ ReadTextFileErrorNotFound: () => ReadTextFileErrorNotFound,
175
+ ReadTextFileErrorPermissionDenied: () => ReadTextFileErrorPermissionDenied,
176
+ ReadTextFileErrorTooManyOpenFiles: () => ReadTextFileErrorTooManyOpenFiles,
177
+ RealPathError: () => RealPathError,
178
+ RealPathErrorNotDirectory: () => RealPathErrorNotDirectory,
179
+ RealPathErrorNotFound: () => RealPathErrorNotFound,
180
+ RealPathErrorPermissionDenied: () => RealPathErrorPermissionDenied,
181
+ RealPathErrorTooManyOpenFiles: () => RealPathErrorTooManyOpenFiles,
182
+ RelocateError: () => RelocateError,
183
+ RelocateErrorAlreadyExists: () => RelocateErrorAlreadyExists,
184
+ RelocateErrorBusy: () => RelocateErrorBusy,
185
+ RelocateErrorCrossDevice: () => RelocateErrorCrossDevice,
186
+ RelocateErrorDirectoryNotEmpty: () => RelocateErrorDirectoryNotEmpty,
187
+ RelocateErrorInvalidArgument: () => RelocateErrorInvalidArgument,
188
+ RelocateErrorIsDirectory: () => RelocateErrorIsDirectory,
189
+ RelocateErrorNotDirectory: () => RelocateErrorNotDirectory,
190
+ RelocateErrorNotFound: () => RelocateErrorNotFound,
191
+ RelocateErrorPermissionDenied: () => RelocateErrorPermissionDenied,
192
+ RelocateErrorReadOnly: () => RelocateErrorReadOnly,
193
+ RemoveError: () => RemoveError,
194
+ RemoveErrorBusy: () => RemoveErrorBusy,
195
+ RemoveErrorDirectoryNotEmpty: () => RemoveErrorDirectoryNotEmpty,
196
+ RemoveErrorInvalidArgument: () => RemoveErrorInvalidArgument,
197
+ RemoveErrorIsDirectory: () => RemoveErrorIsDirectory,
198
+ RemoveErrorNotDirectory: () => RemoveErrorNotDirectory,
199
+ RemoveErrorNotFound: () => RemoveErrorNotFound,
200
+ RemoveErrorPermissionDenied: () => RemoveErrorPermissionDenied,
201
+ RemoveErrorReadOnly: () => RemoveErrorReadOnly,
202
+ RenameError: () => RenameError,
203
+ RenameErrorAlreadyExists: () => RenameErrorAlreadyExists,
204
+ RenameErrorBusy: () => RenameErrorBusy,
205
+ RenameErrorCrossDevice: () => RenameErrorCrossDevice,
206
+ RenameErrorDirectoryNotEmpty: () => RenameErrorDirectoryNotEmpty,
207
+ RenameErrorInvalidArgument: () => RenameErrorInvalidArgument,
208
+ RenameErrorIsDirectory: () => RenameErrorIsDirectory,
209
+ RenameErrorNotDirectory: () => RenameErrorNotDirectory,
210
+ RenameErrorNotFound: () => RenameErrorNotFound,
211
+ RenameErrorPermissionDenied: () => RenameErrorPermissionDenied,
212
+ RenameErrorReadOnly: () => RenameErrorReadOnly,
213
+ SetModeError: () => SetModeError,
214
+ SetModeErrorInvalidArgument: () => SetModeErrorInvalidArgument,
215
+ SetModeErrorNotDirectory: () => SetModeErrorNotDirectory,
216
+ SetModeErrorNotFound: () => SetModeErrorNotFound,
217
+ SetModeErrorPermissionDenied: () => SetModeErrorPermissionDenied,
218
+ SetModeErrorReadOnly: () => SetModeErrorReadOnly,
219
+ SetOwnerError: () => SetOwnerError,
220
+ SetOwnerErrorInvalidArgument: () => SetOwnerErrorInvalidArgument,
221
+ SetOwnerErrorNotDirectory: () => SetOwnerErrorNotDirectory,
222
+ SetOwnerErrorNotFound: () => SetOwnerErrorNotFound,
223
+ SetOwnerErrorPermissionDenied: () => SetOwnerErrorPermissionDenied,
224
+ SetOwnerErrorReadOnly: () => SetOwnerErrorReadOnly,
225
+ SetTimeError: () => SetTimeError,
226
+ SetTimeErrorInvalidArgument: () => SetTimeErrorInvalidArgument,
227
+ SetTimeErrorNotDirectory: () => SetTimeErrorNotDirectory,
228
+ SetTimeErrorNotFound: () => SetTimeErrorNotFound,
229
+ SetTimeErrorPermissionDenied: () => SetTimeErrorPermissionDenied,
230
+ SetTimeErrorReadOnly: () => SetTimeErrorReadOnly,
231
+ StatError: () => StatError,
232
+ StatErrorBusy: () => StatErrorBusy,
233
+ StatErrorNotDirectory: () => StatErrorNotDirectory,
234
+ StatErrorNotFound: () => StatErrorNotFound,
235
+ StatErrorPermissionDenied: () => StatErrorPermissionDenied,
236
+ StatErrorTooManyOpenFiles: () => StatErrorTooManyOpenFiles,
237
+ SymlinkError: () => SymlinkError,
238
+ SymlinkErrorAlreadyExists: () => SymlinkErrorAlreadyExists,
239
+ SymlinkErrorBusy: () => SymlinkErrorBusy,
240
+ SymlinkErrorInvalidArgument: () => SymlinkErrorInvalidArgument,
241
+ SymlinkErrorNotDirectory: () => SymlinkErrorNotDirectory,
242
+ SymlinkErrorNotFound: () => SymlinkErrorNotFound,
243
+ SymlinkErrorPermissionDenied: () => SymlinkErrorPermissionDenied,
244
+ SymlinkErrorReadOnly: () => SymlinkErrorReadOnly,
245
+ SymlinkErrorTooManyOpenFiles: () => SymlinkErrorTooManyOpenFiles,
246
+ TruncateError: () => TruncateError,
247
+ TruncateErrorBusy: () => TruncateErrorBusy,
248
+ TruncateErrorInvalidArgument: () => TruncateErrorInvalidArgument,
249
+ TruncateErrorIsDirectory: () => TruncateErrorIsDirectory,
250
+ TruncateErrorNoSpace: () => TruncateErrorNoSpace,
251
+ TruncateErrorNotDirectory: () => TruncateErrorNotDirectory,
252
+ TruncateErrorNotFound: () => TruncateErrorNotFound,
253
+ TruncateErrorPermissionDenied: () => TruncateErrorPermissionDenied,
254
+ TruncateErrorReadOnly: () => TruncateErrorReadOnly,
255
+ TruncateErrorTooManyOpenFiles: () => TruncateErrorTooManyOpenFiles,
256
+ WalkDirectoryError: () => WalkDirectoryError,
257
+ WalkDirectoryErrorBusy: () => WalkDirectoryErrorBusy,
258
+ WalkDirectoryErrorNotDirectory: () => WalkDirectoryErrorNotDirectory,
259
+ WalkDirectoryErrorNotFound: () => WalkDirectoryErrorNotFound,
260
+ WalkDirectoryErrorPermissionDenied: () => WalkDirectoryErrorPermissionDenied,
261
+ WalkDirectoryErrorTooManyOpenFiles: () => WalkDirectoryErrorTooManyOpenFiles,
262
+ WriteFileError: () => WriteFileError,
263
+ WriteFileErrorBusy: () => WriteFileErrorBusy,
264
+ WriteFileErrorInvalidArgument: () => WriteFileErrorInvalidArgument,
265
+ WriteFileErrorIsDirectory: () => WriteFileErrorIsDirectory,
266
+ WriteFileErrorNoSpace: () => WriteFileErrorNoSpace,
267
+ WriteFileErrorNotDirectory: () => WriteFileErrorNotDirectory,
268
+ WriteFileErrorNotFound: () => WriteFileErrorNotFound,
269
+ WriteFileErrorPermissionDenied: () => WriteFileErrorPermissionDenied,
270
+ WriteFileErrorReadOnly: () => WriteFileErrorReadOnly,
271
+ WriteFileErrorTooManyOpenFiles: () => WriteFileErrorTooManyOpenFiles,
272
+ WriteJsonFileError: () => WriteJsonFileError,
273
+ WriteJsonFileErrorBusy: () => WriteJsonFileErrorBusy,
274
+ WriteJsonFileErrorInvalidArgument: () => WriteJsonFileErrorInvalidArgument,
275
+ WriteJsonFileErrorIsDirectory: () => WriteJsonFileErrorIsDirectory,
276
+ WriteJsonFileErrorNoSpace: () => WriteJsonFileErrorNoSpace,
277
+ WriteJsonFileErrorNotDirectory: () => WriteJsonFileErrorNotDirectory,
278
+ WriteJsonFileErrorNotFound: () => WriteJsonFileErrorNotFound,
279
+ WriteJsonFileErrorPermissionDenied: () => WriteJsonFileErrorPermissionDenied,
280
+ WriteJsonFileErrorReadOnly: () => WriteJsonFileErrorReadOnly,
281
+ WriteJsonFileErrorTooManyOpenFiles: () => WriteJsonFileErrorTooManyOpenFiles,
282
+ WriteTextFileError: () => WriteTextFileError,
283
+ WriteTextFileErrorBusy: () => WriteTextFileErrorBusy,
284
+ WriteTextFileErrorInvalidArgument: () => WriteTextFileErrorInvalidArgument,
285
+ WriteTextFileErrorIsDirectory: () => WriteTextFileErrorIsDirectory,
286
+ WriteTextFileErrorNoSpace: () => WriteTextFileErrorNoSpace,
287
+ WriteTextFileErrorNotDirectory: () => WriteTextFileErrorNotDirectory,
288
+ WriteTextFileErrorNotFound: () => WriteTextFileErrorNotFound,
289
+ WriteTextFileErrorPermissionDenied: () => WriteTextFileErrorPermissionDenied,
290
+ WriteTextFileErrorReadOnly: () => WriteTextFileErrorReadOnly,
291
+ WriteTextFileErrorTooManyOpenFiles: () => WriteTextFileErrorTooManyOpenFiles,
292
+ appendFile: () => appendFile,
293
+ appendTextFile: () => appendTextFile,
294
+ copy: () => copy,
295
+ createEntryInterface: () => createEntryInterface,
296
+ createFileInterface: () => createFileInterface,
297
+ createFolderInterface: () => createFolderInterface,
298
+ createUnknownEntryInterface: () => createUnknownEntryInterface,
299
+ ensureDirectory: () => ensureDirectory,
300
+ ensureFile: () => ensureFile,
301
+ exists: () => exists,
302
+ isFileInterface: () => isFileInterface,
303
+ isFileInterfaceFromUnknown: () => isFileInterfaceFromUnknown,
304
+ isFolderInterface: () => isFolderInterface,
305
+ isFolderInterfaceFromUnknown: () => isFolderInterfaceFromUnknown,
306
+ isUnknownEntryInterface: () => isUnknownEntryInterface,
307
+ isUnknownEntryInterfaceFromUnknown: () => isUnknownEntryInterfaceFromUnknown,
308
+ link: () => link,
309
+ linkStat: () => linkStat,
310
+ makeDirectory: () => makeDirectory,
311
+ makeTemporaryDirectory: () => makeTemporaryDirectory,
312
+ makeTemporaryFile: () => makeTemporaryFile,
313
+ move: () => move,
314
+ readDirectory: () => readDirectory,
315
+ readFile: () => readFile,
316
+ readJsonFile: () => readJsonFile,
317
+ readLink: () => readLink,
318
+ readTextFile: () => readTextFile,
319
+ realPath: () => realPath,
320
+ relocate: () => relocate,
321
+ remove: () => remove,
322
+ rename: () => rename,
323
+ setMode: () => setMode,
324
+ setOwner: () => setOwner,
325
+ setTime: () => setTime,
326
+ stat: () => stat,
327
+ symlink: () => symlink,
328
+ truncate: () => truncate,
329
+ walkDirectory: () => walkDirectory,
330
+ writeFile: () => writeFile,
331
+ writeJsonFile: () => writeJsonFile,
332
+ writeTextFile: () => writeTextFile
333
+ });
334
+ //#endregion
335
+ export { AppendFileError, AppendFileErrorBusy, AppendFileErrorInvalidArgument, AppendFileErrorIsDirectory, AppendFileErrorNoSpace, AppendFileErrorNotDirectory, AppendFileErrorNotFound, AppendFileErrorPermissionDenied, AppendFileErrorReadOnly, AppendFileErrorTooManyOpenFiles, AppendTextFileError, AppendTextFileErrorBusy, AppendTextFileErrorInvalidArgument, AppendTextFileErrorIsDirectory, AppendTextFileErrorNoSpace, AppendTextFileErrorNotDirectory, AppendTextFileErrorNotFound, AppendTextFileErrorPermissionDenied, AppendTextFileErrorReadOnly, AppendTextFileErrorTooManyOpenFiles, CopyError, CopyErrorAlreadyExists, CopyErrorBusy, CopyErrorInvalidArgument, CopyErrorNoSpace, CopyErrorNotDirectory, CopyErrorNotFound, CopyErrorPermissionDenied, CopyErrorReadOnly, CopyErrorTooManyOpenFiles, EnsureDirectoryError, EnsureDirectoryErrorBusy, EnsureDirectoryErrorInvalidArgument, EnsureDirectoryErrorNoSpace, EnsureDirectoryErrorNotDirectory, EnsureDirectoryErrorPermissionDenied, EnsureDirectoryErrorReadOnly, EnsureDirectoryErrorTooManyOpenFiles, EnsureFileError, EnsureFileErrorBusy, EnsureFileErrorInvalidArgument, EnsureFileErrorIsDirectory, EnsureFileErrorNoSpace, EnsureFileErrorNotDirectory, EnsureFileErrorPermissionDenied, EnsureFileErrorReadOnly, EnsureFileErrorTooManyOpenFiles, ExistsError, ExistsErrorNotDirectory, ExistsErrorNotFound, ExistsErrorPermissionDenied, ExistsErrorTooManyOpenFiles, LinkError, LinkErrorAlreadyExists, LinkErrorBusy, LinkErrorCrossDevice, LinkErrorInvalidArgument, LinkErrorNoSpace, LinkErrorNotDirectory, LinkErrorNotFound, LinkErrorPermissionDenied, LinkErrorReadOnly, LinkErrorTooManyOpenFiles, LinkStatError, LinkStatErrorBusy, LinkStatErrorNotDirectory, LinkStatErrorNotFound, LinkStatErrorPermissionDenied, LinkStatErrorTooManyOpenFiles, MakeDirectoryError, MakeDirectoryErrorAlreadyExists, MakeDirectoryErrorBusy, MakeDirectoryErrorInvalidArgument, MakeDirectoryErrorNoSpace, MakeDirectoryErrorNotDirectory, MakeDirectoryErrorNotFound, MakeDirectoryErrorPermissionDenied, MakeDirectoryErrorReadOnly, MakeDirectoryErrorTooManyOpenFiles, MakeTemporaryDirectoryError, MakeTemporaryDirectoryErrorInvalidArgument, MakeTemporaryDirectoryErrorNoSpace, MakeTemporaryDirectoryErrorNotDirectory, MakeTemporaryDirectoryErrorPermissionDenied, MakeTemporaryDirectoryErrorReadOnly, MakeTemporaryDirectoryErrorTooManyOpenFiles, MakeTemporaryFileError, MakeTemporaryFileErrorAlreadyExists, MakeTemporaryFileErrorInvalidArgument, MakeTemporaryFileErrorNoSpace, MakeTemporaryFileErrorNotDirectory, MakeTemporaryFileErrorPermissionDenied, MakeTemporaryFileErrorReadOnly, MakeTemporaryFileErrorTooManyOpenFiles, MoveError, MoveErrorAlreadyExists, MoveErrorBusy, MoveErrorCrossDevice, MoveErrorDirectoryNotEmpty, MoveErrorInvalidArgument, MoveErrorIsDirectory, MoveErrorNotDirectory, MoveErrorNotFound, MoveErrorPermissionDenied, MoveErrorReadOnly, ReadDirectoryError, ReadDirectoryErrorBusy, ReadDirectoryErrorNotDirectory, ReadDirectoryErrorNotFound, ReadDirectoryErrorPermissionDenied, ReadDirectoryErrorTooManyOpenFiles, ReadFileError, ReadFileErrorBusy, ReadFileErrorIsDirectory, ReadFileErrorNotDirectory, ReadFileErrorNotFound, ReadFileErrorPermissionDenied, ReadFileErrorTooManyOpenFiles, ReadJsonFileError, ReadJsonFileErrorBusy, ReadJsonFileErrorIsDirectory, ReadJsonFileErrorNotDirectory, ReadJsonFileErrorNotFound, ReadJsonFileErrorPermissionDenied, ReadJsonFileErrorTooManyOpenFiles, ReadLinkError, ReadLinkErrorInvalidArgument, ReadLinkErrorNotDirectory, ReadLinkErrorNotFound, ReadLinkErrorPermissionDenied, ReadLinkErrorTooManyOpenFiles, ReadTextFileError, ReadTextFileErrorBusy, ReadTextFileErrorIsDirectory, ReadTextFileErrorNotDirectory, ReadTextFileErrorNotFound, ReadTextFileErrorPermissionDenied, ReadTextFileErrorTooManyOpenFiles, RealPathError, RealPathErrorNotDirectory, RealPathErrorNotFound, RealPathErrorPermissionDenied, RealPathErrorTooManyOpenFiles, RelocateError, RelocateErrorAlreadyExists, RelocateErrorBusy, RelocateErrorCrossDevice, RelocateErrorDirectoryNotEmpty, RelocateErrorInvalidArgument, RelocateErrorIsDirectory, RelocateErrorNotDirectory, RelocateErrorNotFound, RelocateErrorPermissionDenied, RelocateErrorReadOnly, RemoveError, RemoveErrorBusy, RemoveErrorDirectoryNotEmpty, RemoveErrorInvalidArgument, RemoveErrorIsDirectory, RemoveErrorNotDirectory, RemoveErrorNotFound, RemoveErrorPermissionDenied, RemoveErrorReadOnly, RenameError, RenameErrorAlreadyExists, RenameErrorBusy, RenameErrorCrossDevice, RenameErrorDirectoryNotEmpty, RenameErrorInvalidArgument, RenameErrorIsDirectory, RenameErrorNotDirectory, RenameErrorNotFound, RenameErrorPermissionDenied, RenameErrorReadOnly, SetModeError, SetModeErrorInvalidArgument, SetModeErrorNotDirectory, SetModeErrorNotFound, SetModeErrorPermissionDenied, SetModeErrorReadOnly, SetOwnerError, SetOwnerErrorInvalidArgument, SetOwnerErrorNotDirectory, SetOwnerErrorNotFound, SetOwnerErrorPermissionDenied, SetOwnerErrorReadOnly, SetTimeError, SetTimeErrorInvalidArgument, SetTimeErrorNotDirectory, SetTimeErrorNotFound, SetTimeErrorPermissionDenied, SetTimeErrorReadOnly, StatError, StatErrorBusy, StatErrorNotDirectory, StatErrorNotFound, StatErrorPermissionDenied, StatErrorTooManyOpenFiles, SymlinkError, SymlinkErrorAlreadyExists, SymlinkErrorBusy, SymlinkErrorInvalidArgument, SymlinkErrorNotDirectory, SymlinkErrorNotFound, SymlinkErrorPermissionDenied, SymlinkErrorReadOnly, SymlinkErrorTooManyOpenFiles, TruncateError, TruncateErrorBusy, TruncateErrorInvalidArgument, TruncateErrorIsDirectory, TruncateErrorNoSpace, TruncateErrorNotDirectory, TruncateErrorNotFound, TruncateErrorPermissionDenied, TruncateErrorReadOnly, TruncateErrorTooManyOpenFiles, WalkDirectoryError, WalkDirectoryErrorBusy, WalkDirectoryErrorNotDirectory, WalkDirectoryErrorNotFound, WalkDirectoryErrorPermissionDenied, WalkDirectoryErrorTooManyOpenFiles, WriteFileError, WriteFileErrorBusy, WriteFileErrorInvalidArgument, WriteFileErrorIsDirectory, WriteFileErrorNoSpace, WriteFileErrorNotDirectory, WriteFileErrorNotFound, WriteFileErrorPermissionDenied, WriteFileErrorReadOnly, WriteFileErrorTooManyOpenFiles, WriteJsonFileError, WriteJsonFileErrorBusy, WriteJsonFileErrorInvalidArgument, WriteJsonFileErrorIsDirectory, WriteJsonFileErrorNoSpace, WriteJsonFileErrorNotDirectory, WriteJsonFileErrorNotFound, WriteJsonFileErrorPermissionDenied, WriteJsonFileErrorReadOnly, WriteJsonFileErrorTooManyOpenFiles, WriteTextFileError, WriteTextFileErrorBusy, WriteTextFileErrorInvalidArgument, WriteTextFileErrorIsDirectory, WriteTextFileErrorNoSpace, WriteTextFileErrorNotDirectory, WriteTextFileErrorNotFound, WriteTextFileErrorPermissionDenied, WriteTextFileErrorReadOnly, WriteTextFileErrorTooManyOpenFiles, appendFile, appendTextFile, copy, createEntryInterface, createFileInterface, createFolderInterface, createUnknownEntryInterface, ensureDirectory, ensureFile, exists, file_exports, isFileInterface, isFileInterfaceFromUnknown, isFolderInterface, isFolderInterfaceFromUnknown, isUnknownEntryInterface, isUnknownEntryInterfaceFromUnknown, link, linkStat, makeDirectory, makeTemporaryDirectory, makeTemporaryFile, move, readDirectory, readFile, readJsonFile, readLink, readTextFile, realPath, relocate, remove, rename, setMode, setOwner, setTime, stat, symlink, truncate, walkDirectory, writeFile, writeJsonFile, writeTextFile };
@@ -0,0 +1,70 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ const require_implementor = require("../implementor.cjs");
3
+ let _duplojs_lang_common = require("@duplojs/lang/common");
4
+ _duplojs_lang_common = require_runtime.__toESM(_duplojs_lang_common, 1);
5
+ let _duplojs_lang_either = require("@duplojs/lang/either");
6
+ _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
7
+ //#region scripts/file/link.ts
8
+ var LinkErrorNotFound = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-not-found", Error) {};
9
+ var LinkErrorPermissionDenied = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-permission-denied", Error) {};
10
+ var LinkErrorAlreadyExists = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-already-exists", Error) {};
11
+ var LinkErrorNotDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-not-directory", Error) {};
12
+ var LinkErrorNoSpace = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-no-space", Error) {};
13
+ var LinkErrorReadOnly = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-read-only", Error) {};
14
+ var LinkErrorInvalidArgument = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-invalid-argument", Error) {};
15
+ var LinkErrorTooManyOpenFiles = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-too-many-open-files", Error) {};
16
+ var LinkErrorBusy = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-busy", Error) {};
17
+ var LinkErrorCrossDevice = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-cross-device", Error) {};
18
+ var LinkError = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-link-error", Error) {};
19
+ function handleNodeLinkError(error) {
20
+ let linkError = void 0;
21
+ if ("code" in error) {
22
+ if (error.code === "ENOENT") linkError = new LinkErrorNotFound(error);
23
+ else if (error.code === "EACCES" || error.code === "EPERM") linkError = new LinkErrorPermissionDenied(error);
24
+ else if (error.code === "EEXIST") linkError = new LinkErrorAlreadyExists(error);
25
+ else if (error.code === "ENOTDIR") linkError = new LinkErrorNotDirectory(error);
26
+ else if (error.code === "ENOSPC") linkError = new LinkErrorNoSpace(error);
27
+ else if (error.code === "EROFS") linkError = new LinkErrorReadOnly(error);
28
+ else if (error.code === "EINVAL") linkError = new LinkErrorInvalidArgument(error);
29
+ else if (error.code === "EMFILE" || error.code === "ENFILE") linkError = new LinkErrorTooManyOpenFiles(error);
30
+ else if (error.code === "EBUSY") linkError = new LinkErrorBusy(error);
31
+ else if (error.code === "EXDEV") linkError = new LinkErrorCrossDevice(error);
32
+ }
33
+ if (linkError === void 0) linkError = new LinkError(error);
34
+ return _duplojs_lang_either.left("file-system-link-error", linkError);
35
+ }
36
+ function handleDenoLinkError(error) {
37
+ let linkError = void 0;
38
+ if (error instanceof Deno.errors.NotFound) linkError = new LinkErrorNotFound(error);
39
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) linkError = new LinkErrorPermissionDenied(error);
40
+ else if (error instanceof Deno.errors.AlreadyExists) linkError = new LinkErrorAlreadyExists(error);
41
+ else if (error instanceof Deno.errors.NotADirectory) linkError = new LinkErrorNotDirectory(error);
42
+ else if (error instanceof Deno.errors.InvalidData) linkError = new LinkErrorInvalidArgument(error);
43
+ else if (error instanceof Deno.errors.Busy) linkError = new LinkErrorBusy(error);
44
+ if (linkError === void 0) linkError = new LinkError(error);
45
+ return _duplojs_lang_either.left("file-system-link-error", linkError);
46
+ }
47
+ const linkImplementation = require_implementor.implementFunction("link", {
48
+ NODE: async (existingPath, newPath) => require_implementor.nodeFileSystem.value.link(existingPath, newPath).then(() => _duplojs_lang_either.right("file-system-link")).catch(handleNodeLinkError),
49
+ DENO: (existingPath, newPath) => Deno.link(existingPath, newPath).then(() => _duplojs_lang_either.right("file-system-link")).catch(handleDenoLinkError)
50
+ });
51
+ function link(...args) {
52
+ if (args.length === 1) {
53
+ const [newPath] = args;
54
+ return (existingPath) => linkImplementation(existingPath, newPath);
55
+ }
56
+ return linkImplementation(...args);
57
+ }
58
+ //#endregion
59
+ exports.LinkError = LinkError;
60
+ exports.LinkErrorAlreadyExists = LinkErrorAlreadyExists;
61
+ exports.LinkErrorBusy = LinkErrorBusy;
62
+ exports.LinkErrorCrossDevice = LinkErrorCrossDevice;
63
+ exports.LinkErrorInvalidArgument = LinkErrorInvalidArgument;
64
+ exports.LinkErrorNoSpace = LinkErrorNoSpace;
65
+ exports.LinkErrorNotDirectory = LinkErrorNotDirectory;
66
+ exports.LinkErrorNotFound = LinkErrorNotFound;
67
+ exports.LinkErrorPermissionDenied = LinkErrorPermissionDenied;
68
+ exports.LinkErrorReadOnly = LinkErrorReadOnly;
69
+ exports.LinkErrorTooManyOpenFiles = LinkErrorTooManyOpenFiles;
70
+ exports.link = link;
@@ -0,0 +1,46 @@
1
+ import * as DEither from "@duplojs/lang/either";
2
+ import type * as DPath from "@duplojs/lang/path";
3
+ import * as DCommon from "@duplojs/lang/common";
4
+ declare const LinkErrorNotFound_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-not-found", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-not-found", unknown>>, unknown>;
5
+ export declare class LinkErrorNotFound extends LinkErrorNotFound_base {
6
+ }
7
+ declare const LinkErrorPermissionDenied_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-permission-denied", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-permission-denied", unknown>>, unknown>;
8
+ export declare class LinkErrorPermissionDenied extends LinkErrorPermissionDenied_base {
9
+ }
10
+ declare const LinkErrorAlreadyExists_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-already-exists", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-already-exists", unknown>>, unknown>;
11
+ export declare class LinkErrorAlreadyExists extends LinkErrorAlreadyExists_base {
12
+ }
13
+ declare const LinkErrorNotDirectory_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-not-directory", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-not-directory", unknown>>, unknown>;
14
+ export declare class LinkErrorNotDirectory extends LinkErrorNotDirectory_base {
15
+ }
16
+ declare const LinkErrorNoSpace_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-no-space", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-no-space", unknown>>, unknown>;
17
+ export declare class LinkErrorNoSpace extends LinkErrorNoSpace_base {
18
+ }
19
+ declare const LinkErrorReadOnly_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-read-only", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-read-only", unknown>>, unknown>;
20
+ export declare class LinkErrorReadOnly extends LinkErrorReadOnly_base {
21
+ }
22
+ declare const LinkErrorInvalidArgument_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-invalid-argument", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-invalid-argument", unknown>>, unknown>;
23
+ export declare class LinkErrorInvalidArgument extends LinkErrorInvalidArgument_base {
24
+ }
25
+ declare const LinkErrorTooManyOpenFiles_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-too-many-open-files", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-too-many-open-files", unknown>>, unknown>;
26
+ export declare class LinkErrorTooManyOpenFiles extends LinkErrorTooManyOpenFiles_base {
27
+ }
28
+ declare const LinkErrorBusy_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-busy", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-busy", unknown>>, unknown>;
29
+ export declare class LinkErrorBusy extends LinkErrorBusy_base {
30
+ }
31
+ declare const LinkErrorCrossDevice_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-cross-device", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-cross-device", unknown>>, unknown>;
32
+ export declare class LinkErrorCrossDevice extends LinkErrorCrossDevice_base {
33
+ }
34
+ declare const LinkError_base: abstract new (error: Error) => DCommon.DuploJSError<"file-system-link-error", Error> & import('@duplojs/lang/kind').Kind<import('@duplojs/lang/kind').Handler<import('@duplojs/lang/kind').Definition<"@DuplojsLangCommon/duplojs-error-file-system-link-error", unknown>>, unknown>;
35
+ export declare class LinkError extends LinkError_base {
36
+ }
37
+ export type LinkErrors = (LinkErrorNotFound | LinkErrorPermissionDenied | LinkErrorAlreadyExists | LinkErrorNotDirectory | LinkErrorNoSpace | LinkErrorReadOnly | LinkErrorInvalidArgument | LinkErrorTooManyOpenFiles | LinkErrorBusy | LinkErrorCrossDevice | LinkError);
38
+ export type LinkResult = (DEither.Right<"file-system-link", void> | DEither.Left<"file-system-link-error", LinkErrors>);
39
+ declare module '../implementor' {
40
+ interface ServerFunction {
41
+ link(existingPath: DPath.AnyPath, newPath: DPath.AnyPath): Promise<LinkResult>;
42
+ }
43
+ }
44
+ export declare function link(newPath: DPath.AnyPath): (existingPath: DPath.AnyPath) => Promise<LinkResult>;
45
+ export declare function link(existingPath: DPath.AnyPath, newPath: DPath.AnyPath): Promise<LinkResult>;
46
+ export {};
@@ -0,0 +1,56 @@
1
+ import { implementFunction, nodeFileSystem } from "../implementor.mjs";
2
+ import * as DCommon from "@duplojs/lang/common";
3
+ import * as DEither from "@duplojs/lang/either";
4
+ //#region scripts/file/link.ts
5
+ var LinkErrorNotFound = class extends DCommon.DuploJSError.parentClass("file-system-link-not-found", Error) {};
6
+ var LinkErrorPermissionDenied = class extends DCommon.DuploJSError.parentClass("file-system-link-permission-denied", Error) {};
7
+ var LinkErrorAlreadyExists = class extends DCommon.DuploJSError.parentClass("file-system-link-already-exists", Error) {};
8
+ var LinkErrorNotDirectory = class extends DCommon.DuploJSError.parentClass("file-system-link-not-directory", Error) {};
9
+ var LinkErrorNoSpace = class extends DCommon.DuploJSError.parentClass("file-system-link-no-space", Error) {};
10
+ var LinkErrorReadOnly = class extends DCommon.DuploJSError.parentClass("file-system-link-read-only", Error) {};
11
+ var LinkErrorInvalidArgument = class extends DCommon.DuploJSError.parentClass("file-system-link-invalid-argument", Error) {};
12
+ var LinkErrorTooManyOpenFiles = class extends DCommon.DuploJSError.parentClass("file-system-link-too-many-open-files", Error) {};
13
+ var LinkErrorBusy = class extends DCommon.DuploJSError.parentClass("file-system-link-busy", Error) {};
14
+ var LinkErrorCrossDevice = class extends DCommon.DuploJSError.parentClass("file-system-link-cross-device", Error) {};
15
+ var LinkError = class extends DCommon.DuploJSError.parentClass("file-system-link-error", Error) {};
16
+ function handleNodeLinkError(error) {
17
+ let linkError = void 0;
18
+ if ("code" in error) {
19
+ if (error.code === "ENOENT") linkError = new LinkErrorNotFound(error);
20
+ else if (error.code === "EACCES" || error.code === "EPERM") linkError = new LinkErrorPermissionDenied(error);
21
+ else if (error.code === "EEXIST") linkError = new LinkErrorAlreadyExists(error);
22
+ else if (error.code === "ENOTDIR") linkError = new LinkErrorNotDirectory(error);
23
+ else if (error.code === "ENOSPC") linkError = new LinkErrorNoSpace(error);
24
+ else if (error.code === "EROFS") linkError = new LinkErrorReadOnly(error);
25
+ else if (error.code === "EINVAL") linkError = new LinkErrorInvalidArgument(error);
26
+ else if (error.code === "EMFILE" || error.code === "ENFILE") linkError = new LinkErrorTooManyOpenFiles(error);
27
+ else if (error.code === "EBUSY") linkError = new LinkErrorBusy(error);
28
+ else if (error.code === "EXDEV") linkError = new LinkErrorCrossDevice(error);
29
+ }
30
+ if (linkError === void 0) linkError = new LinkError(error);
31
+ return DEither.left("file-system-link-error", linkError);
32
+ }
33
+ function handleDenoLinkError(error) {
34
+ let linkError = void 0;
35
+ if (error instanceof Deno.errors.NotFound) linkError = new LinkErrorNotFound(error);
36
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) linkError = new LinkErrorPermissionDenied(error);
37
+ else if (error instanceof Deno.errors.AlreadyExists) linkError = new LinkErrorAlreadyExists(error);
38
+ else if (error instanceof Deno.errors.NotADirectory) linkError = new LinkErrorNotDirectory(error);
39
+ else if (error instanceof Deno.errors.InvalidData) linkError = new LinkErrorInvalidArgument(error);
40
+ else if (error instanceof Deno.errors.Busy) linkError = new LinkErrorBusy(error);
41
+ if (linkError === void 0) linkError = new LinkError(error);
42
+ return DEither.left("file-system-link-error", linkError);
43
+ }
44
+ const linkImplementation = implementFunction("link", {
45
+ NODE: async (existingPath, newPath) => nodeFileSystem.value.link(existingPath, newPath).then(() => DEither.right("file-system-link")).catch(handleNodeLinkError),
46
+ DENO: (existingPath, newPath) => Deno.link(existingPath, newPath).then(() => DEither.right("file-system-link")).catch(handleDenoLinkError)
47
+ });
48
+ function link(...args) {
49
+ if (args.length === 1) {
50
+ const [newPath] = args;
51
+ return (existingPath) => linkImplementation(existingPath, newPath);
52
+ }
53
+ return linkImplementation(...args);
54
+ }
55
+ //#endregion
56
+ export { LinkError, LinkErrorAlreadyExists, LinkErrorBusy, LinkErrorCrossDevice, LinkErrorInvalidArgument, LinkErrorNoSpace, LinkErrorNotDirectory, LinkErrorNotFound, LinkErrorPermissionDenied, LinkErrorReadOnly, LinkErrorTooManyOpenFiles, link };