@duplojs/server 0.1.0-beta.1 → 0.1.0-beta.3

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 (178) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +5 -1
  2. package/dist/command/create.cjs +11 -9
  3. package/dist/command/create.mjs +11 -9
  4. package/dist/command/error.cjs +2 -2
  5. package/dist/command/error.mjs +1 -1
  6. package/dist/command/help.cjs +11 -9
  7. package/dist/command/help.mjs +10 -8
  8. package/dist/common/environmentVariable/parseEnvironmentFiles.d.ts +2 -1
  9. package/dist/common/index.cjs +3 -0
  10. package/dist/common/index.d.ts +1 -0
  11. package/dist/common/index.mjs +3 -1
  12. package/dist/common/meta/getCurrentDirectoryName.cjs +10 -0
  13. package/dist/common/meta/getCurrentDirectoryName.d.ts +7 -0
  14. package/dist/common/meta/getCurrentDirectoryName.mjs +7 -0
  15. package/dist/common/meta/index.d.ts +7 -0
  16. package/dist/dataStructure/common/codec/defaults/json.cjs +12 -1
  17. package/dist/dataStructure/common/codec/defaults/json.d.ts +2 -2
  18. package/dist/dataStructure/common/codec/defaults/json.mjs +12 -1
  19. package/dist/dataStructure/common/codec/defaults/string.cjs +12 -1
  20. package/dist/dataStructure/common/codec/defaults/string.d.ts +2 -2
  21. package/dist/dataStructure/common/codec/defaults/string.mjs +12 -1
  22. package/dist/dataStructure/common/error/defaultInterpreter.cjs +3 -1
  23. package/dist/dataStructure/common/error/defaultInterpreter.d.ts +7 -2
  24. package/dist/dataStructure/common/error/defaultInterpreter.mjs +3 -1
  25. package/dist/dataStructure/constraint/{exist.cjs → fileExist.cjs} +5 -5
  26. package/dist/dataStructure/constraint/fileExist.d.ts +10 -0
  27. package/dist/dataStructure/constraint/{exist.mjs → fileExist.mjs} +4 -4
  28. package/dist/dataStructure/constraint/folderExist.cjs +19 -0
  29. package/dist/dataStructure/constraint/folderExist.d.ts +10 -0
  30. package/dist/dataStructure/constraint/folderExist.mjs +15 -0
  31. package/dist/dataStructure/constraint/index.d.ts +2 -1
  32. package/dist/dataStructure/constraint/mimeType.cjs +1 -1
  33. package/dist/dataStructure/constraint/mimeType.mjs +1 -1
  34. package/dist/dataStructure/constraint/types/constraints.d.ts +4 -2
  35. package/dist/dataStructure/fundamentalType/folder.cjs +11 -0
  36. package/dist/dataStructure/fundamentalType/folder.d.ts +8 -0
  37. package/dist/dataStructure/fundamentalType/folder.mjs +8 -0
  38. package/dist/dataStructure/fundamentalType/index.d.ts +1 -0
  39. package/dist/dataStructure/fundamentalType/types/fundamentalTypes.d.ts +2 -0
  40. package/dist/dataStructure/helper/file.d.ts +1 -1
  41. package/dist/dataStructure/helper/fileExist.cjs +7 -0
  42. package/dist/dataStructure/helper/fileExist.d.ts +2 -0
  43. package/dist/dataStructure/helper/fileExist.mjs +7 -0
  44. package/dist/dataStructure/helper/folder.cjs +10 -0
  45. package/dist/dataStructure/helper/folder.d.ts +3 -0
  46. package/dist/dataStructure/helper/folder.mjs +8 -0
  47. package/dist/dataStructure/helper/folderExist.cjs +7 -0
  48. package/dist/dataStructure/helper/folderExist.d.ts +2 -0
  49. package/dist/dataStructure/helper/folderExist.mjs +7 -0
  50. package/dist/dataStructure/helper/index.d.ts +3 -1
  51. package/dist/dataStructure/index.cjs +29 -8
  52. package/dist/dataStructure/index.mjs +19 -6
  53. package/dist/dataStructure/type/folder.cjs +14 -0
  54. package/dist/dataStructure/type/folder.d.ts +11 -0
  55. package/dist/dataStructure/type/folder.mjs +11 -0
  56. package/dist/dataStructure/type/index.d.ts +1 -0
  57. package/dist/dataStructure/type/types/types.d.ts +2 -0
  58. package/dist/file/appendFile.cjs +36 -22
  59. package/dist/file/appendFile.d.ts +34 -2
  60. package/dist/file/appendFile.mjs +35 -22
  61. package/dist/file/appendTextFile.cjs +34 -20
  62. package/dist/file/appendTextFile.d.ts +34 -2
  63. package/dist/file/appendTextFile.mjs +33 -20
  64. package/dist/file/copy.cjs +26 -14
  65. package/dist/file/copy.d.ts +34 -2
  66. package/dist/file/copy.mjs +25 -14
  67. package/dist/file/createEntryInterface.cjs +2 -2
  68. package/dist/file/createEntryInterface.d.ts +1 -1
  69. package/dist/file/createEntryInterface.mjs +1 -1
  70. package/dist/file/ensureDirectory.cjs +29 -17
  71. package/dist/file/ensureDirectory.d.ts +28 -2
  72. package/dist/file/ensureDirectory.mjs +28 -17
  73. package/dist/file/ensureFile.cjs +32 -19
  74. package/dist/file/ensureFile.d.ts +31 -2
  75. package/dist/file/ensureFile.mjs +31 -19
  76. package/dist/file/exists.cjs +23 -14
  77. package/dist/file/exists.d.ts +19 -2
  78. package/dist/file/exists.mjs +22 -14
  79. package/dist/file/fileInterface.cjs +2 -0
  80. package/dist/file/fileInterface.d.ts +8 -6
  81. package/dist/file/fileInterface.mjs +2 -1
  82. package/dist/file/folderInterface.cjs +2 -0
  83. package/dist/file/folderInterface.d.ts +7 -5
  84. package/dist/file/folderInterface.mjs +2 -1
  85. package/dist/file/index.cjs +6 -0
  86. package/dist/file/index.d.ts +0 -1
  87. package/dist/file/index.mjs +7 -4
  88. package/dist/file/link.cjs +37 -22
  89. package/dist/file/link.d.ts +37 -2
  90. package/dist/file/link.mjs +36 -22
  91. package/dist/file/linkStat.cjs +23 -15
  92. package/dist/file/linkStat.d.ts +22 -2
  93. package/dist/file/linkStat.mjs +23 -15
  94. package/dist/file/makeDirectory.cjs +35 -21
  95. package/dist/file/makeDirectory.d.ts +33 -2
  96. package/dist/file/makeDirectory.mjs +34 -21
  97. package/dist/file/makeTemporaryDirectory.cjs +26 -15
  98. package/dist/file/makeTemporaryDirectory.d.ts +25 -2
  99. package/dist/file/makeTemporaryDirectory.mjs +25 -15
  100. package/dist/file/makeTemporaryFile.cjs +29 -20
  101. package/dist/file/makeTemporaryFile.d.ts +28 -2
  102. package/dist/file/makeTemporaryFile.mjs +29 -20
  103. package/dist/file/move.cjs +38 -23
  104. package/dist/file/move.d.ts +37 -2
  105. package/dist/file/move.mjs +37 -23
  106. package/dist/file/readDirectory.cjs +27 -9
  107. package/dist/file/readDirectory.d.ts +26 -5
  108. package/dist/file/readDirectory.mjs +24 -9
  109. package/dist/file/readFile.cjs +28 -17
  110. package/dist/file/readFile.d.ts +25 -2
  111. package/dist/file/readFile.mjs +27 -17
  112. package/dist/file/readJsonFile.cjs +28 -17
  113. package/dist/file/readJsonFile.d.ts +25 -3
  114. package/dist/file/readJsonFile.mjs +27 -17
  115. package/dist/file/readLink.cjs +25 -15
  116. package/dist/file/readLink.d.ts +22 -2
  117. package/dist/file/readLink.mjs +24 -15
  118. package/dist/file/readTextFile.cjs +28 -17
  119. package/dist/file/readTextFile.d.ts +25 -2
  120. package/dist/file/readTextFile.mjs +27 -17
  121. package/dist/file/realPath.cjs +22 -13
  122. package/dist/file/realPath.d.ts +19 -2
  123. package/dist/file/realPath.mjs +21 -13
  124. package/dist/file/relocate.cjs +41 -25
  125. package/dist/file/relocate.d.ts +37 -2
  126. package/dist/file/relocate.mjs +40 -25
  127. package/dist/file/remove.cjs +36 -23
  128. package/dist/file/remove.d.ts +30 -2
  129. package/dist/file/remove.mjs +35 -23
  130. package/dist/file/rename.cjs +41 -25
  131. package/dist/file/rename.d.ts +37 -2
  132. package/dist/file/rename.mjs +40 -25
  133. package/dist/file/setMode.cjs +23 -15
  134. package/dist/file/setMode.d.ts +21 -2
  135. package/dist/file/setMode.mjs +23 -15
  136. package/dist/file/setOwner.cjs +25 -15
  137. package/dist/file/setOwner.d.ts +22 -2
  138. package/dist/file/setOwner.mjs +24 -15
  139. package/dist/file/setTime.cjs +25 -15
  140. package/dist/file/setTime.d.ts +21 -2
  141. package/dist/file/setTime.mjs +24 -15
  142. package/dist/file/stat.cjs +23 -15
  143. package/dist/file/stat.d.ts +22 -2
  144. package/dist/file/stat.mjs +23 -15
  145. package/dist/file/symlink.cjs +33 -20
  146. package/dist/file/symlink.d.ts +31 -2
  147. package/dist/file/symlink.mjs +32 -20
  148. package/dist/file/truncate.cjs +33 -21
  149. package/dist/file/truncate.d.ts +34 -2
  150. package/dist/file/truncate.mjs +33 -21
  151. package/dist/file/unknownEntryInterface.cjs +2 -0
  152. package/dist/file/unknownEntryInterface.d.ts +7 -5
  153. package/dist/file/unknownEntryInterface.mjs +2 -1
  154. package/dist/file/walkDirectory.cjs +28 -15
  155. package/dist/file/walkDirectory.d.ts +23 -2
  156. package/dist/file/walkDirectory.mjs +27 -14
  157. package/dist/file/writeFile.cjs +35 -21
  158. package/dist/file/writeFile.d.ts +34 -2
  159. package/dist/file/writeFile.mjs +34 -21
  160. package/dist/file/writeJsonFile.cjs +38 -27
  161. package/dist/file/writeJsonFile.d.ts +36 -5
  162. package/dist/file/writeJsonFile.mjs +38 -27
  163. package/dist/file/writeTextFile.cjs +35 -21
  164. package/dist/file/writeTextFile.d.ts +34 -2
  165. package/dist/file/writeTextFile.mjs +34 -21
  166. package/dist/implementor.cjs +8 -5
  167. package/dist/implementor.d.ts +4 -4
  168. package/dist/implementor.mjs +8 -5
  169. package/dist/index.cjs +2 -0
  170. package/dist/index.mjs +2 -1
  171. package/package.json +4 -4
  172. package/dist/dataStructure/constraint/exist.d.ts +0 -10
  173. package/dist/dataStructure/helper/exist.cjs +0 -7
  174. package/dist/dataStructure/helper/exist.d.ts +0 -2
  175. package/dist/dataStructure/helper/exist.mjs +0 -7
  176. package/dist/file/types/fileSystemEither.d.ts +0 -2
  177. package/dist/file/types/index.d.ts +0 -1
  178. /package/{README → README.md} +0 -0
@@ -4,6 +4,7 @@ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
4
  const defaultErrorInterpreterDataStructureDictionary = {
5
5
  ...DDataStructure.defaultErrorInterpreterDataStructureDictionary,
6
6
  "@DuplojsServerDataStructure/file-type": () => "Expected a valid file.",
7
+ "@DuplojsServerDataStructure/folder-type": () => "Expected a valid folder.",
7
8
  "@DuplojsServerDataStructure/size-constraint": (source) => {
8
9
  const { min, max } = source.definition;
9
10
  if (min !== void 0 && max !== void 0) return `Expected a file size between ${min} and ${max} bytes.`;
@@ -12,7 +13,8 @@ const defaultErrorInterpreterDataStructureDictionary = {
12
13
  return "Expected a valid file size.";
13
14
  },
14
15
  "@DuplojsServerDataStructure/mime-type-constraint": (source) => `Expected a file with a MIME type matching ${source.definition.regex.toString()}.`,
15
- "@DuplojsServerDataStructure/exist-constraint": () => "Expected the file to exist."
16
+ "@DuplojsServerDataStructure/file-exist-constraint": () => "Expected the file to exist.",
17
+ "@DuplojsServerDataStructure/folder-exist-constraint": () => "Expected the folder to exist."
16
18
  };
17
19
  const defaultErrorInterpreterCodecDictionary = [...DDataStructure.defaultErrorInterpreterCodecDictionary, [codecsJson.definition.file, (_codec, issue) => {
18
20
  if (issue.from === "predicate") return DDataStructure.encodeIssueKind.has(issue) ? "The JSON file codec must produce a valid file path string." : "Expected a valid file path string for the JSON file codec.";
@@ -4,9 +4,9 @@ let _duplojs_lang_either = require("@duplojs/lang/either");
4
4
  _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
5
5
  let _duplojs_lang_dataStructure = require("@duplojs/lang/dataStructure");
6
6
  _duplojs_lang_dataStructure = require_runtime.__toESM(_duplojs_lang_dataStructure, 1);
7
- //#region scripts/dataStructure/constraint/exist.ts
8
- const existConstraintKind = require_kind.createKind("exist-constraint");
9
- const ExistConstraint = _duplojs_lang_dataStructure.createConstraint(existConstraintKind, ({ init }) => () => init({}, {
7
+ //#region scripts/dataStructure/constraint/fileExist.ts
8
+ const fileExistConstraintKind = require_kind.createKind("file-exist-constraint");
9
+ const FileExistConstraint = _duplojs_lang_dataStructure.createConstraint(fileExistConstraintKind, ({ init }) => () => init({}, {
10
10
  executeCheck: async (_self, data) => {
11
11
  const result = _duplojs_lang_either.rightPipe(await data.stat(), (stat) => stat.isFile ? stat : _duplojs_lang_either.fail());
12
12
  if (_duplojs_lang_either.isLeft(result)) return _duplojs_lang_dataStructure.ErrorSymbol;
@@ -15,5 +15,5 @@ const ExistConstraint = _duplojs_lang_dataStructure.createConstraint(existConstr
15
15
  isAsynchronous: () => true
16
16
  }));
17
17
  //#endregion
18
- exports.ExistConstraint = ExistConstraint;
19
- exports.existConstraintKind = existConstraintKind;
18
+ exports.FileExistConstraint = FileExistConstraint;
19
+ exports.fileExistConstraintKind = fileExistConstraintKind;
@@ -0,0 +1,10 @@
1
+ import type * as DCommon from "@duplojs/lang/common";
2
+ import type * as DKind from "@duplojs/lang/kind";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ import type * as DSFile from '../../file';
5
+ export declare const fileExistConstraintKind: DKind.Handler<DKind.Definition<"@DuplojsServerDataStructure/file-exist-constraint", unknown>>;
6
+ export interface FileExistConstraintDefinition extends DDataStructure.ConstraintDefinition {
7
+ }
8
+ export interface FileExistConstraint extends DCommon.UnionToIntersection<DDataStructure.Constraint<DSFile.FileInterface, DSFile.FileInterface, FileExistConstraintDefinition> & DKind.Kind<typeof fileExistConstraintKind>> {
9
+ }
10
+ export declare const FileExistConstraint: () => FileExistConstraint;
@@ -1,9 +1,9 @@
1
1
  import { createKind } from "../kind.mjs";
2
2
  import * as DEither from "@duplojs/lang/either";
3
3
  import * as DDataStructure from "@duplojs/lang/dataStructure";
4
- //#region scripts/dataStructure/constraint/exist.ts
5
- const existConstraintKind = createKind("exist-constraint");
6
- const ExistConstraint = DDataStructure.createConstraint(existConstraintKind, ({ init }) => () => init({}, {
4
+ //#region scripts/dataStructure/constraint/fileExist.ts
5
+ const fileExistConstraintKind = createKind("file-exist-constraint");
6
+ const FileExistConstraint = DDataStructure.createConstraint(fileExistConstraintKind, ({ init }) => () => init({}, {
7
7
  executeCheck: async (_self, data) => {
8
8
  const result = DEither.rightPipe(await data.stat(), (stat) => stat.isFile ? stat : DEither.fail());
9
9
  if (DEither.isLeft(result)) return DDataStructure.ErrorSymbol;
@@ -12,4 +12,4 @@ const ExistConstraint = DDataStructure.createConstraint(existConstraintKind, ({
12
12
  isAsynchronous: () => true
13
13
  }));
14
14
  //#endregion
15
- export { ExistConstraint, existConstraintKind };
15
+ export { FileExistConstraint, fileExistConstraintKind };
@@ -0,0 +1,19 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_kind = require("../kind.cjs");
3
+ let _duplojs_lang_either = require("@duplojs/lang/either");
4
+ _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
5
+ let _duplojs_lang_dataStructure = require("@duplojs/lang/dataStructure");
6
+ _duplojs_lang_dataStructure = require_runtime.__toESM(_duplojs_lang_dataStructure, 1);
7
+ //#region scripts/dataStructure/constraint/folderExist.ts
8
+ const folderExistConstraintKind = require_kind.createKind("folder-exist-constraint");
9
+ const FolderExistConstraint = _duplojs_lang_dataStructure.createConstraint(folderExistConstraintKind, ({ init }) => () => init({}, {
10
+ executeCheck: async (_self, data) => {
11
+ const result = _duplojs_lang_either.rightPipe(await data.stat(), (stat) => stat.isDirectory ? stat : _duplojs_lang_either.fail());
12
+ if (_duplojs_lang_either.isLeft(result)) return _duplojs_lang_dataStructure.ErrorSymbol;
13
+ return _duplojs_lang_dataStructure.SuccessSymbol;
14
+ },
15
+ isAsynchronous: () => true
16
+ }));
17
+ //#endregion
18
+ exports.FolderExistConstraint = FolderExistConstraint;
19
+ exports.folderExistConstraintKind = folderExistConstraintKind;
@@ -0,0 +1,10 @@
1
+ import type * as DCommon from "@duplojs/lang/common";
2
+ import type * as DKind from "@duplojs/lang/kind";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ import type * as DSFile from '../../file';
5
+ export declare const folderExistConstraintKind: DKind.Handler<DKind.Definition<"@DuplojsServerDataStructure/folder-exist-constraint", unknown>>;
6
+ export interface FolderExistConstraintDefinition extends DDataStructure.ConstraintDefinition {
7
+ }
8
+ export interface FolderExistConstraint extends DCommon.UnionToIntersection<DDataStructure.Constraint<DSFile.FolderInterface, DSFile.FolderInterface, FolderExistConstraintDefinition> & DKind.Kind<typeof folderExistConstraintKind>> {
9
+ }
10
+ export declare const FolderExistConstraint: () => FolderExistConstraint;
@@ -0,0 +1,15 @@
1
+ import { createKind } from "../kind.mjs";
2
+ import * as DEither from "@duplojs/lang/either";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ //#region scripts/dataStructure/constraint/folderExist.ts
5
+ const folderExistConstraintKind = createKind("folder-exist-constraint");
6
+ const FolderExistConstraint = DDataStructure.createConstraint(folderExistConstraintKind, ({ init }) => () => init({}, {
7
+ executeCheck: async (_self, data) => {
8
+ const result = DEither.rightPipe(await data.stat(), (stat) => stat.isDirectory ? stat : DEither.fail());
9
+ if (DEither.isLeft(result)) return DDataStructure.ErrorSymbol;
10
+ return DDataStructure.SuccessSymbol;
11
+ },
12
+ isAsynchronous: () => true
13
+ }));
14
+ //#endregion
15
+ export { FolderExistConstraint, folderExistConstraintKind };
@@ -1,4 +1,5 @@
1
- export * from './exist';
1
+ export * from './fileExist';
2
+ export * from './folderExist';
2
3
  export * from './mimeType';
3
4
  export * from './size';
4
5
  export type * from './types';
@@ -8,7 +8,7 @@ _duplojs_lang_dataStructure = require_runtime.__toESM(_duplojs_lang_dataStructur
8
8
  const mimeTypeConstraintKind = require_kind.createKind("mime-type-constraint");
9
9
  const MimeTypeConstraint = _duplojs_lang_dataStructure.createConstraint(mimeTypeConstraintKind, ({ init }) => (mimeType) => init({ regex: _duplojs_lang_common.toRegExp(mimeType) }, {
10
10
  executeCheck: (self, data) => {
11
- if (self.definition.regex.test(data.getMimeType() ?? "")) return _duplojs_lang_dataStructure.ErrorSymbol;
11
+ if (!self.definition.regex.test(data.getMimeType() ?? "")) return _duplojs_lang_dataStructure.ErrorSymbol;
12
12
  return _duplojs_lang_dataStructure.SuccessSymbol;
13
13
  },
14
14
  isAsynchronous: () => false
@@ -5,7 +5,7 @@ import * as DDataStructure from "@duplojs/lang/dataStructure";
5
5
  const mimeTypeConstraintKind = createKind("mime-type-constraint");
6
6
  const MimeTypeConstraint = DDataStructure.createConstraint(mimeTypeConstraintKind, ({ init }) => (mimeType) => init({ regex: DCommon.toRegExp(mimeType) }, {
7
7
  executeCheck: (self, data) => {
8
- if (self.definition.regex.test(data.getMimeType() ?? "")) return DDataStructure.ErrorSymbol;
8
+ if (!self.definition.regex.test(data.getMimeType() ?? "")) return DDataStructure.ErrorSymbol;
9
9
  return DDataStructure.SuccessSymbol;
10
10
  },
11
11
  isAsynchronous: () => false
@@ -1,9 +1,11 @@
1
- import { ExistConstraint } from '../exist';
1
+ import { FileExistConstraint } from '../fileExist';
2
+ import { FolderExistConstraint } from '../folderExist';
2
3
  import { MimeTypeConstraint } from '../mimeType';
3
4
  import { SizeConstraint } from '../size';
4
5
  declare module "@duplojs/lang/dataStructure" {
5
6
  interface ConstraintsStore {
6
- exist: ExistConstraint;
7
+ fileExist: FileExistConstraint;
8
+ folderExist: FolderExistConstraint;
7
9
  size: SizeConstraint;
8
10
  mimeType: MimeTypeConstraint;
9
11
  }
@@ -0,0 +1,11 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_folderInterface = require("../../file/folderInterface.cjs");
3
+ const require_kind = require("../kind.cjs");
4
+ let _duplojs_lang_dataStructure = require("@duplojs/lang/dataStructure");
5
+ _duplojs_lang_dataStructure = require_runtime.__toESM(_duplojs_lang_dataStructure, 1);
6
+ //#region scripts/dataStructure/fundamentalType/folder.ts
7
+ const folderFundamentalTypeKind = require_kind.createKind("folder-fundamental-type");
8
+ const TheFolder = _duplojs_lang_dataStructure.createFundamentalType(folderFundamentalTypeKind, (self, data) => require_folderInterface.isFolderInterface(data) ? _duplojs_lang_dataStructure.SuccessSymbol : _duplojs_lang_dataStructure.ErrorSymbol);
9
+ //#endregion
10
+ exports.TheFolder = TheFolder;
11
+ exports.folderFundamentalTypeKind = folderFundamentalTypeKind;
@@ -0,0 +1,8 @@
1
+ import type * as DCommon from "@duplojs/lang/common";
2
+ import type * as DKind from "@duplojs/lang/kind";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ import * as DSFile from '../../file';
5
+ export declare const folderFundamentalTypeKind: DKind.Handler<DKind.Definition<"@DuplojsServerDataStructure/folder-fundamental-type", unknown>>;
6
+ export interface TheFolder extends DCommon.UnionToIntersection<DDataStructure.FundamentalType<DSFile.FolderInterface> & DKind.Kind<typeof folderFundamentalTypeKind>> {
7
+ }
8
+ export declare const TheFolder: TheFolder;
@@ -0,0 +1,8 @@
1
+ import { isFolderInterface } from "../../file/folderInterface.mjs";
2
+ import { createKind } from "../kind.mjs";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ //#region scripts/dataStructure/fundamentalType/folder.ts
5
+ const folderFundamentalTypeKind = createKind("folder-fundamental-type");
6
+ const TheFolder = DDataStructure.createFundamentalType(folderFundamentalTypeKind, (self, data) => isFolderInterface(data) ? DDataStructure.SuccessSymbol : DDataStructure.ErrorSymbol);
7
+ //#endregion
8
+ export { TheFolder, folderFundamentalTypeKind };
@@ -1,2 +1,3 @@
1
1
  export * from './file';
2
+ export * from './folder';
2
3
  export type * from './types';
@@ -1,6 +1,8 @@
1
1
  import { TheFile } from '../file';
2
+ import { TheFolder } from '../folder';
2
3
  declare module "@duplojs/lang/dataStructure" {
3
4
  interface FundamentalTypesStore {
4
5
  serverFile: TheFile;
6
+ serverFolder: TheFolder;
5
7
  }
6
8
  }
@@ -1,3 +1,3 @@
1
1
  import * as DDataStructure from "@duplojs/lang/dataStructure";
2
2
  import type * as DSFile from '../../file';
3
- export declare function file<const GenericConstraints extends readonly DDataStructure.Constraint<DSFile.FileInterface>[] = readonly []>(constraints?: GenericConstraints): NoInfer<DDataStructure.TypeStructure<DSFile.FileInterface, readonly [...GenericConstraints]>>;
3
+ export declare function file<const GenericConstraints extends readonly DDataStructure.Constraint<DSFile.FileInterface>[] = readonly []>(constraints?: GenericConstraints): NoInfer<DDataStructure.TypeStructure<DSFile.FileInterface<DSFile.EntryPath>, readonly [...GenericConstraints]>>;
@@ -0,0 +1,7 @@
1
+ const require_fileExist = require("../constraint/fileExist.cjs");
2
+ //#region scripts/dataStructure/helper/fileExist.ts
3
+ function fileExist() {
4
+ return require_fileExist.FileExistConstraint();
5
+ }
6
+ //#endregion
7
+ exports.fileExist = fileExist;
@@ -0,0 +1,2 @@
1
+ import { FileExistConstraint } from '../constraint';
2
+ export declare function fileExist(): FileExistConstraint;
@@ -0,0 +1,7 @@
1
+ import { FileExistConstraint } from "../constraint/fileExist.mjs";
2
+ //#region scripts/dataStructure/helper/fileExist.ts
3
+ function fileExist() {
4
+ return FileExistConstraint();
5
+ }
6
+ //#endregion
7
+ export { fileExist };
@@ -0,0 +1,10 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_folder = require("../type/folder.cjs");
3
+ let _duplojs_lang_dataStructure = require("@duplojs/lang/dataStructure");
4
+ _duplojs_lang_dataStructure = require_runtime.__toESM(_duplojs_lang_dataStructure, 1);
5
+ //#region scripts/dataStructure/helper/folder.ts
6
+ function folder(constraints = []) {
7
+ return _duplojs_lang_dataStructure.TypeStructure(require_folder.FolderType(), constraints);
8
+ }
9
+ //#endregion
10
+ exports.folder = folder;
@@ -0,0 +1,3 @@
1
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
2
+ import type * as DSFile from '../../file';
3
+ export declare function folder<const GenericConstraints extends readonly DDataStructure.Constraint<DSFile.FolderInterface>[] = readonly []>(constraints?: GenericConstraints): NoInfer<DDataStructure.TypeStructure<DSFile.FolderInterface<DSFile.EntryPath>, readonly [...GenericConstraints]>>;
@@ -0,0 +1,8 @@
1
+ import { FolderType } from "../type/folder.mjs";
2
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
3
+ //#region scripts/dataStructure/helper/folder.ts
4
+ function folder(constraints = []) {
5
+ return DDataStructure.TypeStructure(FolderType(), constraints);
6
+ }
7
+ //#endregion
8
+ export { folder };
@@ -0,0 +1,7 @@
1
+ const require_folderExist = require("../constraint/folderExist.cjs");
2
+ //#region scripts/dataStructure/helper/folderExist.ts
3
+ function folderExist() {
4
+ return require_folderExist.FolderExistConstraint();
5
+ }
6
+ //#endregion
7
+ exports.folderExist = folderExist;
@@ -0,0 +1,2 @@
1
+ import { FolderExistConstraint } from '../constraint';
2
+ export declare function folderExist(): FolderExistConstraint;
@@ -0,0 +1,7 @@
1
+ import { FolderExistConstraint } from "../constraint/folderExist.mjs";
2
+ //#region scripts/dataStructure/helper/folderExist.ts
3
+ function folderExist() {
4
+ return FolderExistConstraint();
5
+ }
6
+ //#endregion
7
+ export { folderExist };
@@ -1,4 +1,6 @@
1
- export * from './exist';
1
+ export * from './fileExist';
2
2
  export * from './file';
3
+ export * from './folder';
4
+ export * from './folderExist';
3
5
  export * from './mimeType';
4
6
  export * from './size';
@@ -1,45 +1,61 @@
1
1
  const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
2
  const require_kind = require("./kind.cjs");
3
3
  const require_file = require("./fundamentalType/file.cjs");
4
+ const require_folder = require("./fundamentalType/folder.cjs");
4
5
  const require_json = require("./common/codec/defaults/json.cjs");
5
6
  const require_string = require("./common/codec/defaults/string.cjs");
6
7
  const require_defaultInterpreter = require("./common/error/defaultInterpreter.cjs");
7
- const require_exist = require("./constraint/exist.cjs");
8
+ const require_fileExist = require("./constraint/fileExist.cjs");
9
+ const require_folderExist = require("./constraint/folderExist.cjs");
8
10
  const require_mimeType = require("./constraint/mimeType.cjs");
9
11
  const require_size = require("./constraint/size.cjs");
10
- const require_exist$1 = require("./helper/exist.cjs");
12
+ const require_fileExist$1 = require("./helper/fileExist.cjs");
11
13
  const require_file$1 = require("./type/file.cjs");
14
+ const require_folder$1 = require("./type/folder.cjs");
12
15
  const require_file$2 = require("./helper/file.cjs");
16
+ const require_folder$2 = require("./helper/folder.cjs");
17
+ const require_folderExist$1 = require("./helper/folderExist.cjs");
13
18
  const require_mimeType$1 = require("./helper/mimeType.cjs");
14
19
  const require_size$1 = require("./helper/size.cjs");
15
20
  //#region scripts/dataStructure/index.ts
16
21
  var dataStructure_exports = /* @__PURE__ */ require_runtime.__exportAll({
17
- ExistConstraint: () => require_exist.ExistConstraint,
22
+ FileExistConstraint: () => require_fileExist.FileExistConstraint,
18
23
  FileType: () => require_file$1.FileType,
24
+ FolderExistConstraint: () => require_folderExist.FolderExistConstraint,
25
+ FolderType: () => require_folder$1.FolderType,
19
26
  MimeTypeConstraint: () => require_mimeType.MimeTypeConstraint,
20
27
  SizeConstraint: () => require_size.SizeConstraint,
21
28
  TheFile: () => require_file.TheFile,
29
+ TheFolder: () => require_folder.TheFolder,
22
30
  codecsJson: () => require_json.codecsJson,
23
31
  codecsString: () => require_string.codecsString,
24
32
  createKind: () => require_kind.createKind,
25
33
  defaultErrorInterpreterCodecDictionary: () => require_defaultInterpreter.defaultErrorInterpreterCodecDictionary,
26
34
  defaultErrorInterpreterDataStructureDictionary: () => require_defaultInterpreter.defaultErrorInterpreterDataStructureDictionary,
27
- exist: () => require_exist$1.exist,
28
- existConstraintKind: () => require_exist.existConstraintKind,
29
35
  file: () => require_file$2.file,
36
+ fileExist: () => require_fileExist$1.fileExist,
37
+ fileExistConstraintKind: () => require_fileExist.fileExistConstraintKind,
30
38
  fileFundamentalTypeKind: () => require_file.fileFundamentalTypeKind,
31
39
  fileTypeKind: () => require_file$1.fileTypeKind,
40
+ folder: () => require_folder$2.folder,
41
+ folderExist: () => require_folderExist$1.folderExist,
42
+ folderExistConstraintKind: () => require_folderExist.folderExistConstraintKind,
43
+ folderFundamentalTypeKind: () => require_folder.folderFundamentalTypeKind,
44
+ folderTypeKind: () => require_folder$1.folderTypeKind,
32
45
  mimeType: () => require_mimeType$1.mimeType,
33
46
  mimeTypeConstraintKind: () => require_mimeType.mimeTypeConstraintKind,
34
47
  size: () => require_size$1.size,
35
48
  sizeConstraintKind: () => require_size.sizeConstraintKind
36
49
  });
37
50
  //#endregion
38
- exports.ExistConstraint = require_exist.ExistConstraint;
51
+ exports.FileExistConstraint = require_fileExist.FileExistConstraint;
39
52
  exports.FileType = require_file$1.FileType;
53
+ exports.FolderExistConstraint = require_folderExist.FolderExistConstraint;
54
+ exports.FolderType = require_folder$1.FolderType;
40
55
  exports.MimeTypeConstraint = require_mimeType.MimeTypeConstraint;
41
56
  exports.SizeConstraint = require_size.SizeConstraint;
42
57
  exports.TheFile = require_file.TheFile;
58
+ exports.TheFolder = require_folder.TheFolder;
43
59
  exports.codecsJson = require_json.codecsJson;
44
60
  exports.codecsString = require_string.codecsString;
45
61
  exports.createKind = require_kind.createKind;
@@ -51,11 +67,16 @@ Object.defineProperty(exports, "dataStructure_exports", {
51
67
  });
52
68
  exports.defaultErrorInterpreterCodecDictionary = require_defaultInterpreter.defaultErrorInterpreterCodecDictionary;
53
69
  exports.defaultErrorInterpreterDataStructureDictionary = require_defaultInterpreter.defaultErrorInterpreterDataStructureDictionary;
54
- exports.exist = require_exist$1.exist;
55
- exports.existConstraintKind = require_exist.existConstraintKind;
56
70
  exports.file = require_file$2.file;
71
+ exports.fileExist = require_fileExist$1.fileExist;
72
+ exports.fileExistConstraintKind = require_fileExist.fileExistConstraintKind;
57
73
  exports.fileFundamentalTypeKind = require_file.fileFundamentalTypeKind;
58
74
  exports.fileTypeKind = require_file$1.fileTypeKind;
75
+ exports.folder = require_folder$2.folder;
76
+ exports.folderExist = require_folderExist$1.folderExist;
77
+ exports.folderExistConstraintKind = require_folderExist.folderExistConstraintKind;
78
+ exports.folderFundamentalTypeKind = require_folder.folderFundamentalTypeKind;
79
+ exports.folderTypeKind = require_folder$1.folderTypeKind;
59
80
  exports.mimeType = require_mimeType$1.mimeType;
60
81
  exports.mimeTypeConstraintKind = require_mimeType.mimeTypeConstraintKind;
61
82
  exports.size = require_size$1.size;
@@ -1,38 +1,51 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
2
  import { createKind } from "./kind.mjs";
3
3
  import { TheFile, fileFundamentalTypeKind } from "./fundamentalType/file.mjs";
4
+ import { TheFolder, folderFundamentalTypeKind } from "./fundamentalType/folder.mjs";
4
5
  import { codecsJson } from "./common/codec/defaults/json.mjs";
5
6
  import { codecsString } from "./common/codec/defaults/string.mjs";
6
7
  import { defaultErrorInterpreterCodecDictionary, defaultErrorInterpreterDataStructureDictionary } from "./common/error/defaultInterpreter.mjs";
7
- import { ExistConstraint, existConstraintKind } from "./constraint/exist.mjs";
8
+ import { FileExistConstraint, fileExistConstraintKind } from "./constraint/fileExist.mjs";
9
+ import { FolderExistConstraint, folderExistConstraintKind } from "./constraint/folderExist.mjs";
8
10
  import { MimeTypeConstraint, mimeTypeConstraintKind } from "./constraint/mimeType.mjs";
9
11
  import { SizeConstraint, sizeConstraintKind } from "./constraint/size.mjs";
10
- import { exist } from "./helper/exist.mjs";
12
+ import { fileExist } from "./helper/fileExist.mjs";
11
13
  import { FileType, fileTypeKind } from "./type/file.mjs";
14
+ import { FolderType, folderTypeKind } from "./type/folder.mjs";
12
15
  import { file } from "./helper/file.mjs";
16
+ import { folder } from "./helper/folder.mjs";
17
+ import { folderExist } from "./helper/folderExist.mjs";
13
18
  import { mimeType } from "./helper/mimeType.mjs";
14
19
  import { size } from "./helper/size.mjs";
15
20
  //#region scripts/dataStructure/index.ts
16
21
  var dataStructure_exports = /* @__PURE__ */ __exportAll({
17
- ExistConstraint: () => ExistConstraint,
22
+ FileExistConstraint: () => FileExistConstraint,
18
23
  FileType: () => FileType,
24
+ FolderExistConstraint: () => FolderExistConstraint,
25
+ FolderType: () => FolderType,
19
26
  MimeTypeConstraint: () => MimeTypeConstraint,
20
27
  SizeConstraint: () => SizeConstraint,
21
28
  TheFile: () => TheFile,
29
+ TheFolder: () => TheFolder,
22
30
  codecsJson: () => codecsJson,
23
31
  codecsString: () => codecsString,
24
32
  createKind: () => createKind,
25
33
  defaultErrorInterpreterCodecDictionary: () => defaultErrorInterpreterCodecDictionary,
26
34
  defaultErrorInterpreterDataStructureDictionary: () => defaultErrorInterpreterDataStructureDictionary,
27
- exist: () => exist,
28
- existConstraintKind: () => existConstraintKind,
29
35
  file: () => file,
36
+ fileExist: () => fileExist,
37
+ fileExistConstraintKind: () => fileExistConstraintKind,
30
38
  fileFundamentalTypeKind: () => fileFundamentalTypeKind,
31
39
  fileTypeKind: () => fileTypeKind,
40
+ folder: () => folder,
41
+ folderExist: () => folderExist,
42
+ folderExistConstraintKind: () => folderExistConstraintKind,
43
+ folderFundamentalTypeKind: () => folderFundamentalTypeKind,
44
+ folderTypeKind: () => folderTypeKind,
32
45
  mimeType: () => mimeType,
33
46
  mimeTypeConstraintKind: () => mimeTypeConstraintKind,
34
47
  size: () => size,
35
48
  sizeConstraintKind: () => sizeConstraintKind
36
49
  });
37
50
  //#endregion
38
- export { ExistConstraint, FileType, MimeTypeConstraint, SizeConstraint, TheFile, codecsJson, codecsString, createKind, dataStructure_exports, defaultErrorInterpreterCodecDictionary, defaultErrorInterpreterDataStructureDictionary, exist, existConstraintKind, file, fileFundamentalTypeKind, fileTypeKind, mimeType, mimeTypeConstraintKind, size, sizeConstraintKind };
51
+ export { FileExistConstraint, FileType, FolderExistConstraint, FolderType, MimeTypeConstraint, SizeConstraint, TheFile, TheFolder, codecsJson, codecsString, createKind, dataStructure_exports, defaultErrorInterpreterCodecDictionary, defaultErrorInterpreterDataStructureDictionary, file, fileExist, fileExistConstraintKind, fileFundamentalTypeKind, fileTypeKind, folder, folderExist, folderExistConstraintKind, folderFundamentalTypeKind, folderTypeKind, mimeType, mimeTypeConstraintKind, size, sizeConstraintKind };
@@ -0,0 +1,14 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_kind = require("../kind.cjs");
3
+ const require_folder = require("../fundamentalType/folder.cjs");
4
+ let _duplojs_lang_dataStructure = require("@duplojs/lang/dataStructure");
5
+ _duplojs_lang_dataStructure = require_runtime.__toESM(_duplojs_lang_dataStructure, 1);
6
+ //#region scripts/dataStructure/type/folder.ts
7
+ const folderTypeKind = require_kind.createKind("folder-type");
8
+ const FolderType = _duplojs_lang_dataStructure.createType(require_folder.TheFolder, folderTypeKind, ({ init }) => () => init({}, {
9
+ executeCheck: () => _duplojs_lang_dataStructure.SuccessSymbol,
10
+ isAsynchronous: () => false
11
+ }));
12
+ //#endregion
13
+ exports.FolderType = FolderType;
14
+ exports.folderTypeKind = folderTypeKind;
@@ -0,0 +1,11 @@
1
+ import type * as DCommon from "@duplojs/lang/common";
2
+ import type * as DKind from "@duplojs/lang/kind";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ import type * as DSFile from '../../file';
5
+ import * as FundamentalType from "../fundamentalType";
6
+ export declare const folderTypeKind: DKind.Handler<DKind.Definition<"@DuplojsServerDataStructure/folder-type", unknown>>;
7
+ export interface FolderTypeDefinition extends DDataStructure.TypeDefinition {
8
+ }
9
+ export interface FolderType extends DCommon.UnionToIntersection<DDataStructure.Type<FundamentalType.TheFolder, DSFile.FolderInterface, FolderTypeDefinition> & DKind.Kind<typeof folderTypeKind>> {
10
+ }
11
+ export declare const FolderType: () => FolderType;
@@ -0,0 +1,11 @@
1
+ import { createKind } from "../kind.mjs";
2
+ import { TheFolder } from "../fundamentalType/folder.mjs";
3
+ import * as DDataStructure from "@duplojs/lang/dataStructure";
4
+ //#region scripts/dataStructure/type/folder.ts
5
+ const folderTypeKind = createKind("folder-type");
6
+ const FolderType = DDataStructure.createType(TheFolder, folderTypeKind, ({ init }) => () => init({}, {
7
+ executeCheck: () => DDataStructure.SuccessSymbol,
8
+ isAsynchronous: () => false
9
+ }));
10
+ //#endregion
11
+ export { FolderType, folderTypeKind };
@@ -1,2 +1,3 @@
1
1
  export * from './file';
2
+ export * from './folder';
2
3
  export type * from './types';
@@ -1,6 +1,8 @@
1
1
  import { FileType } from '../file';
2
+ import { FolderType } from '../folder';
2
3
  declare module "@duplojs/lang/dataStructure" {
3
4
  interface TypesStore {
4
5
  serverFile: FileType;
6
+ serverFolder: FolderType;
5
7
  }
6
8
  }
@@ -1,35 +1,49 @@
1
1
  const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
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);
3
5
  let _duplojs_lang_either = require("@duplojs/lang/either");
4
6
  _duplojs_lang_either = require_runtime.__toESM(_duplojs_lang_either, 1);
5
7
  //#region scripts/file/appendFile.ts
8
+ var AppendFileErrorNotFound = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-not-found", Error) {};
9
+ var AppendFileErrorPermissionDenied = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-permission-denied", Error) {};
10
+ var AppendFileErrorIsDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-is-directory", Error) {};
11
+ var AppendFileErrorNotDirectory = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-not-directory", Error) {};
12
+ var AppendFileErrorNoSpace = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-no-space", Error) {};
13
+ var AppendFileErrorReadOnly = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-read-only", Error) {};
14
+ var AppendFileErrorInvalidArgument = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-invalid-argument", Error) {};
15
+ var AppendFileErrorTooManyOpenFiles = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-too-many-open-files", Error) {};
16
+ var AppendFileErrorBusy = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-busy", Error) {};
17
+ var AppendFileError = class extends _duplojs_lang_common.DuploJSError.parentClass("file-system-append-file-error", Error) {};
6
18
  function handleNodeAppendFileError(error) {
7
- if (typeof error === "object" && error !== null && "code" in error) {
8
- if (error.code === "ENOENT") return _duplojs_lang_either.left("file-system-append-file-not-found", error);
9
- else if (error.code === "EACCES" || error.code === "EPERM") return _duplojs_lang_either.left("file-system-append-file-permission-denied", error);
10
- else if (error.code === "EISDIR") return _duplojs_lang_either.left("file-system-append-file-is-directory", error);
11
- else if (error.code === "ENOTDIR") return _duplojs_lang_either.left("file-system-append-file-not-directory", error);
12
- else if (error.code === "ENOSPC") return _duplojs_lang_either.left("file-system-append-file-no-space", error);
13
- else if (error.code === "EROFS") return _duplojs_lang_either.left("file-system-append-file-read-only", error);
14
- else if (error.code === "EINVAL") return _duplojs_lang_either.left("file-system-append-file-invalid-argument", error);
15
- else if (error.code === "EMFILE" || error.code === "ENFILE") return _duplojs_lang_either.left("file-system-append-file-too-many-open-files", error);
16
- else if (error.code === "EBUSY") return _duplojs_lang_either.left("file-system-append-file-busy", error);
17
- }
18
- return _duplojs_lang_either.left("file-system-append-file-error", error);
19
+ let appendFileError = void 0;
20
+ if ("code" in error) {
21
+ if (error.code === "ENOENT") appendFileError = new AppendFileErrorNotFound(error);
22
+ else if (error.code === "EACCES" || error.code === "EPERM") appendFileError = new AppendFileErrorPermissionDenied(error);
23
+ else if (error.code === "EISDIR") appendFileError = new AppendFileErrorIsDirectory(error);
24
+ else if (error.code === "ENOTDIR") appendFileError = new AppendFileErrorNotDirectory(error);
25
+ else if (error.code === "ENOSPC") appendFileError = new AppendFileErrorNoSpace(error);
26
+ else if (error.code === "EROFS") appendFileError = new AppendFileErrorReadOnly(error);
27
+ else if (error.code === "EINVAL") appendFileError = new AppendFileErrorInvalidArgument(error);
28
+ else if (error.code === "EMFILE" || error.code === "ENFILE") appendFileError = new AppendFileErrorTooManyOpenFiles(error);
29
+ else if (error.code === "EBUSY") appendFileError = new AppendFileErrorBusy(error);
30
+ else appendFileError = new AppendFileError(error);
31
+ } else appendFileError = new AppendFileError(error);
32
+ return _duplojs_lang_either.left("file-system-append-file-error", appendFileError);
19
33
  }
20
34
  function handleDenoAppendFileError(error) {
21
- if (error instanceof Deno.errors.NotFound) return _duplojs_lang_either.left("file-system-append-file-not-found", error);
22
- if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) return _duplojs_lang_either.left("file-system-append-file-permission-denied", error);
23
- if (error instanceof Deno.errors.IsADirectory) return _duplojs_lang_either.left("file-system-append-file-is-directory", error);
24
- if (error instanceof Deno.errors.NotADirectory) return _duplojs_lang_either.left("file-system-append-file-not-directory", error);
25
- if (error instanceof Deno.errors.InvalidData) return _duplojs_lang_either.left("file-system-append-file-invalid-argument", error);
26
- if (error instanceof Deno.errors.Busy) return _duplojs_lang_either.left("file-system-append-file-busy", error);
27
- return _duplojs_lang_either.left("file-system-append-file-error", error);
35
+ let appendFileError = void 0;
36
+ if (error instanceof Deno.errors.NotFound) appendFileError = new AppendFileErrorNotFound(error);
37
+ else if (error instanceof Deno.errors.PermissionDenied || error instanceof Deno.errors.NotCapable) appendFileError = new AppendFileErrorPermissionDenied(error);
38
+ else if (error instanceof Deno.errors.IsADirectory) appendFileError = new AppendFileErrorIsDirectory(error);
39
+ else if (error instanceof Deno.errors.NotADirectory) appendFileError = new AppendFileErrorNotDirectory(error);
40
+ else if (error instanceof Deno.errors.InvalidData) appendFileError = new AppendFileErrorInvalidArgument(error);
41
+ else if (error instanceof Deno.errors.Busy) appendFileError = new AppendFileErrorBusy(error);
42
+ else appendFileError = new AppendFileError(error);
43
+ return _duplojs_lang_either.left("file-system-append-file-error", appendFileError);
28
44
  }
29
45
  const appendFileImplementation = require_implementor.implementFunction("appendFile", {
30
- NODE: async (path, data) => {
31
- return (await require_implementor.nodeFileSystem.value).appendFile(path, data).then(() => _duplojs_lang_either.right("file-system-append-file")).catch(handleNodeAppendFileError);
32
- },
46
+ NODE: async (path, data) => require_implementor.nodeFileSystem.value.appendFile(path, data).then(() => _duplojs_lang_either.right("file-system-append-file")).catch(handleNodeAppendFileError),
33
47
  DENO: (path, data) => Deno.writeFile(path, data, { append: true }).then(() => _duplojs_lang_either.right("file-system-append-file")).catch(handleDenoAppendFileError)
34
48
  });
35
49
  function appendFile(...args) {