@duplojs/server 0.1.0-beta.1 → 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.
- package/dist/_virtual/_rolldown/runtime.mjs +5 -1
- package/dist/command/argument.d.ts +2 -2
- package/dist/command/create.cjs +18 -10
- package/dist/command/create.d.ts +3 -3
- package/dist/command/create.mjs +18 -10
- package/dist/command/error.cjs +96 -43
- package/dist/command/error.d.ts +9 -1
- package/dist/command/error.mjs +95 -42
- package/dist/command/exec.d.ts +4 -3
- package/dist/command/help.cjs +28 -35
- package/dist/command/help.d.ts +1 -1
- package/dist/command/help.mjs +27 -34
- package/dist/command/index.cjs +4 -0
- package/dist/command/index.mjs +4 -2
- package/dist/command/options/base.cjs +21 -13
- package/dist/command/options/base.d.ts +6 -0
- package/dist/command/options/base.mjs +20 -14
- package/dist/command/options/defaults/array.d.ts +6 -4
- package/dist/command/options/defaults/boolean.cjs +21 -7
- package/dist/command/options/defaults/boolean.d.ts +6 -3
- package/dist/command/options/defaults/boolean.mjs +20 -8
- package/dist/command/options/defaults/simple.d.ts +6 -4
- package/dist/command/types/forbiddenInvalidIdentifier.d.ts +6 -0
- package/dist/command/types/index.d.ts +1 -0
- package/dist/common/environmentVariable/index.d.ts +1 -1
- package/dist/common/environmentVariable/overrideEnvironmentVariables.d.ts +1 -1
- package/dist/common/environmentVariable/parseEnvironmentFiles.d.ts +2 -1
- package/dist/common/index.cjs +3 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.mjs +3 -1
- package/dist/common/meta/getCurrentDirectoryName.cjs +10 -0
- package/dist/common/meta/getCurrentDirectoryName.d.ts +7 -0
- package/dist/common/meta/getCurrentDirectoryName.mjs +7 -0
- package/dist/common/meta/index.d.ts +7 -0
- package/dist/dataStructure/common/codec/defaults/json.cjs +12 -1
- package/dist/dataStructure/common/codec/defaults/json.d.ts +2 -2
- package/dist/dataStructure/common/codec/defaults/json.mjs +12 -1
- package/dist/dataStructure/common/codec/defaults/string.cjs +12 -1
- package/dist/dataStructure/common/codec/defaults/string.d.ts +2 -2
- package/dist/dataStructure/common/codec/defaults/string.mjs +12 -1
- package/dist/dataStructure/common/error/defaultInterpreter.cjs +3 -1
- package/dist/dataStructure/common/error/defaultInterpreter.d.ts +7 -2
- package/dist/dataStructure/common/error/defaultInterpreter.mjs +3 -1
- package/dist/dataStructure/constraint/{exist.cjs → fileExist.cjs} +5 -5
- package/dist/dataStructure/constraint/fileExist.d.ts +10 -0
- package/dist/dataStructure/constraint/{exist.mjs → fileExist.mjs} +4 -4
- package/dist/dataStructure/constraint/folderExist.cjs +19 -0
- package/dist/dataStructure/constraint/folderExist.d.ts +10 -0
- package/dist/dataStructure/constraint/folderExist.mjs +15 -0
- package/dist/dataStructure/constraint/index.d.ts +2 -1
- package/dist/dataStructure/constraint/mimeType.cjs +1 -1
- package/dist/dataStructure/constraint/mimeType.mjs +1 -1
- package/dist/dataStructure/constraint/types/constraints.d.ts +4 -2
- package/dist/dataStructure/fundamentalType/folder.cjs +11 -0
- package/dist/dataStructure/fundamentalType/folder.d.ts +8 -0
- package/dist/dataStructure/fundamentalType/folder.mjs +8 -0
- package/dist/dataStructure/fundamentalType/index.d.ts +1 -0
- package/dist/dataStructure/fundamentalType/types/fundamentalTypes.d.ts +2 -0
- package/dist/dataStructure/helper/file.d.ts +1 -1
- package/dist/dataStructure/helper/fileExist.cjs +7 -0
- package/dist/dataStructure/helper/fileExist.d.ts +2 -0
- package/dist/dataStructure/helper/fileExist.mjs +7 -0
- package/dist/dataStructure/helper/folder.cjs +10 -0
- package/dist/dataStructure/helper/folder.d.ts +3 -0
- package/dist/dataStructure/helper/folder.mjs +8 -0
- package/dist/dataStructure/helper/folderExist.cjs +7 -0
- package/dist/dataStructure/helper/folderExist.d.ts +2 -0
- package/dist/dataStructure/helper/folderExist.mjs +7 -0
- package/dist/dataStructure/helper/index.d.ts +3 -1
- package/dist/dataStructure/index.cjs +29 -8
- package/dist/dataStructure/index.mjs +19 -6
- package/dist/dataStructure/type/folder.cjs +14 -0
- package/dist/dataStructure/type/folder.d.ts +11 -0
- package/dist/dataStructure/type/folder.mjs +11 -0
- package/dist/dataStructure/type/index.d.ts +1 -0
- package/dist/dataStructure/type/types/types.d.ts +2 -0
- package/dist/file/appendFile.cjs +46 -22
- package/dist/file/appendFile.d.ts +37 -5
- package/dist/file/appendFile.mjs +36 -23
- package/dist/file/appendTextFile.cjs +44 -20
- package/dist/file/appendTextFile.d.ts +37 -5
- package/dist/file/appendTextFile.mjs +34 -21
- package/dist/file/copy.cjs +36 -14
- package/dist/file/copy.d.ts +37 -5
- package/dist/file/copy.mjs +26 -15
- package/dist/file/createEntryInterface.cjs +6 -3
- package/dist/file/createEntryInterface.d.ts +1 -1
- package/dist/file/createEntryInterface.mjs +4 -2
- package/dist/file/ensureDirectory.cjs +37 -17
- package/dist/file/ensureDirectory.d.ts +30 -4
- package/dist/file/ensureDirectory.mjs +29 -18
- package/dist/file/ensureFile.cjs +41 -19
- package/dist/file/ensureFile.d.ts +33 -4
- package/dist/file/ensureFile.mjs +32 -20
- package/dist/file/exists.cjs +28 -14
- package/dist/file/exists.d.ts +21 -4
- package/dist/file/exists.mjs +23 -15
- package/dist/file/fileInterface.cjs +3 -1
- package/dist/file/fileInterface.d.ts +10 -9
- package/dist/file/fileInterface.mjs +3 -2
- package/dist/file/folderInterface.cjs +3 -1
- package/dist/file/folderInterface.d.ts +9 -8
- package/dist/file/folderInterface.mjs +3 -2
- package/dist/file/index.cjs +512 -0
- package/dist/file/index.d.ts +0 -1
- package/dist/file/index.mjs +291 -35
- package/dist/file/link.cjs +48 -22
- package/dist/file/link.d.ts +40 -5
- package/dist/file/link.mjs +37 -23
- package/dist/file/linkStat.cjs +29 -15
- package/dist/file/linkStat.d.ts +24 -4
- package/dist/file/linkStat.mjs +24 -16
- package/dist/file/makeDirectory.cjs +45 -21
- package/dist/file/makeDirectory.d.ts +35 -4
- package/dist/file/makeDirectory.mjs +35 -22
- package/dist/file/makeTemporaryDirectory.cjs +33 -15
- package/dist/file/makeTemporaryDirectory.d.ts +25 -2
- package/dist/file/makeTemporaryDirectory.mjs +26 -16
- package/dist/file/makeTemporaryFile.cjs +37 -20
- package/dist/file/makeTemporaryFile.d.ts +28 -2
- package/dist/file/makeTemporaryFile.mjs +30 -21
- package/dist/file/move.cjs +49 -23
- package/dist/file/move.d.ts +40 -5
- package/dist/file/move.mjs +38 -24
- package/dist/file/readDirectory.cjs +33 -9
- package/dist/file/readDirectory.d.ts +26 -5
- package/dist/file/readDirectory.mjs +25 -10
- package/dist/file/readFile.cjs +35 -17
- package/dist/file/readFile.d.ts +27 -4
- package/dist/file/readFile.mjs +28 -18
- package/dist/file/readJsonFile.cjs +35 -17
- package/dist/file/readJsonFile.d.ts +27 -5
- package/dist/file/readJsonFile.mjs +28 -18
- package/dist/file/readLink.cjs +31 -15
- package/dist/file/readLink.d.ts +24 -4
- package/dist/file/readLink.mjs +25 -16
- package/dist/file/readTextFile.cjs +35 -17
- package/dist/file/readTextFile.d.ts +27 -4
- package/dist/file/readTextFile.mjs +28 -18
- package/dist/file/realPath.cjs +27 -13
- package/dist/file/realPath.d.ts +21 -4
- package/dist/file/realPath.mjs +22 -14
- package/dist/file/relocate.cjs +52 -25
- package/dist/file/relocate.d.ts +40 -5
- package/dist/file/relocate.mjs +41 -26
- package/dist/file/remove.cjs +45 -23
- package/dist/file/remove.d.ts +32 -4
- package/dist/file/remove.mjs +36 -24
- package/dist/file/rename.cjs +52 -25
- package/dist/file/rename.d.ts +40 -5
- package/dist/file/rename.mjs +41 -26
- package/dist/file/setMode.cjs +29 -15
- package/dist/file/setMode.d.ts +24 -5
- package/dist/file/setMode.mjs +24 -16
- package/dist/file/setOwner.cjs +31 -15
- package/dist/file/setOwner.d.ts +25 -5
- package/dist/file/setOwner.mjs +25 -16
- package/dist/file/setTime.cjs +31 -15
- package/dist/file/setTime.d.ts +24 -5
- package/dist/file/setTime.mjs +25 -16
- package/dist/file/stat.cjs +29 -15
- package/dist/file/stat.d.ts +24 -4
- package/dist/file/stat.mjs +24 -16
- package/dist/file/symlink.cjs +42 -20
- package/dist/file/symlink.d.ts +34 -5
- package/dist/file/symlink.mjs +33 -21
- package/dist/file/truncate.cjs +43 -21
- package/dist/file/truncate.d.ts +36 -4
- package/dist/file/truncate.mjs +34 -22
- package/dist/file/unknownEntryInterface.cjs +5 -1
- package/dist/file/unknownEntryInterface.d.ts +8 -6
- package/dist/file/unknownEntryInterface.mjs +4 -2
- package/dist/file/walkDirectory.cjs +38 -15
- package/dist/file/walkDirectory.d.ts +25 -4
- package/dist/file/walkDirectory.mjs +32 -15
- package/dist/file/writeFile.cjs +45 -21
- package/dist/file/writeFile.d.ts +37 -5
- package/dist/file/writeFile.mjs +35 -22
- package/dist/file/writeJsonFile.cjs +48 -27
- package/dist/file/writeJsonFile.d.ts +37 -6
- package/dist/file/writeJsonFile.mjs +39 -28
- package/dist/file/writeTextFile.cjs +45 -21
- package/dist/file/writeTextFile.d.ts +37 -5
- package/dist/file/writeTextFile.mjs +35 -22
- package/dist/implementor.cjs +8 -5
- package/dist/implementor.d.ts +4 -4
- package/dist/implementor.mjs +8 -5
- package/dist/index.cjs +2 -0
- package/dist/index.mjs +2 -1
- package/dist/override.d.ts +8 -0
- package/package.json +4 -4
- package/dist/dataStructure/constraint/exist.d.ts +0 -10
- package/dist/dataStructure/helper/exist.cjs +0 -7
- package/dist/dataStructure/helper/exist.d.ts +0 -2
- package/dist/dataStructure/helper/exist.mjs +0 -7
- package/dist/file/types/fileSystemEither.d.ts +0 -2
- package/dist/file/types/index.d.ts +0 -1
- /package/{README → README.md} +0 -0
package/dist/file/index.mjs
CHANGED
|
@@ -1,41 +1,294 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { appendFile } from "./appendFile.mjs";
|
|
3
|
-
import { appendTextFile } from "./appendTextFile.mjs";
|
|
4
|
-
import { copy } from "./copy.mjs";
|
|
5
|
-
import { stat } from "./stat.mjs";
|
|
6
|
-
import { rename } from "./rename.mjs";
|
|
7
|
-
import { exists } from "./exists.mjs";
|
|
8
|
-
import { move } from "./move.mjs";
|
|
9
|
-
import { remove } from "./remove.mjs";
|
|
10
|
-
import { relocate } from "./relocate.mjs";
|
|
11
|
-
import { createFileInterface, isFileInterface } from "./fileInterface.mjs";
|
|
12
|
-
import { readDirectory } from "./readDirectory.mjs";
|
|
13
|
-
import { createUnknownEntryInterface, isUnknownEntryInterface } from "./unknownEntryInterface.mjs";
|
|
14
|
-
import { walkDirectory } from "./walkDirectory.mjs";
|
|
15
|
-
import { createFolderInterface, isFolderInterface } from "./folderInterface.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
16
|
import { createEntryInterface } from "./createEntryInterface.mjs";
|
|
17
|
-
import { ensureDirectory } from "./ensureDirectory.mjs";
|
|
18
|
-
import { ensureFile } from "./ensureFile.mjs";
|
|
19
|
-
import { link } from "./link.mjs";
|
|
20
|
-
import { linkStat } from "./linkStat.mjs";
|
|
21
|
-
import { makeDirectory } from "./makeDirectory.mjs";
|
|
22
|
-
import { makeTemporaryDirectory } from "./makeTemporaryDirectory.mjs";
|
|
23
|
-
import { makeTemporaryFile } from "./makeTemporaryFile.mjs";
|
|
24
|
-
import { readFile } from "./readFile.mjs";
|
|
25
|
-
import { readJsonFile } from "./readJsonFile.mjs";
|
|
26
|
-
import { readLink } from "./readLink.mjs";
|
|
27
|
-
import { readTextFile } from "./readTextFile.mjs";
|
|
28
|
-
import { realPath } from "./realPath.mjs";
|
|
29
|
-
import { setMode } from "./setMode.mjs";
|
|
30
|
-
import { setOwner } from "./setOwner.mjs";
|
|
31
|
-
import { setTime } from "./setTime.mjs";
|
|
32
|
-
import { symlink } from "./symlink.mjs";
|
|
33
|
-
import { truncate } from "./truncate.mjs";
|
|
34
|
-
import { writeFile } from "./writeFile.mjs";
|
|
35
|
-
import { writeJsonFile } from "./writeJsonFile.mjs";
|
|
36
|
-
import { writeTextFile } from "./writeTextFile.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
37
|
//#region scripts/file/index.ts
|
|
38
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,
|
|
39
292
|
appendFile: () => appendFile,
|
|
40
293
|
appendTextFile: () => appendTextFile,
|
|
41
294
|
copy: () => copy,
|
|
@@ -47,8 +300,11 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
47
300
|
ensureFile: () => ensureFile,
|
|
48
301
|
exists: () => exists,
|
|
49
302
|
isFileInterface: () => isFileInterface,
|
|
303
|
+
isFileInterfaceFromUnknown: () => isFileInterfaceFromUnknown,
|
|
50
304
|
isFolderInterface: () => isFolderInterface,
|
|
305
|
+
isFolderInterfaceFromUnknown: () => isFolderInterfaceFromUnknown,
|
|
51
306
|
isUnknownEntryInterface: () => isUnknownEntryInterface,
|
|
307
|
+
isUnknownEntryInterfaceFromUnknown: () => isUnknownEntryInterfaceFromUnknown,
|
|
52
308
|
link: () => link,
|
|
53
309
|
linkStat: () => linkStat,
|
|
54
310
|
makeDirectory: () => makeDirectory,
|
|
@@ -76,4 +332,4 @@ var file_exports = /* @__PURE__ */ __exportAll({
|
|
|
76
332
|
writeTextFile: () => writeTextFile
|
|
77
333
|
});
|
|
78
334
|
//#endregion
|
|
79
|
-
export { appendFile, appendTextFile, copy, createEntryInterface, createFileInterface, createFolderInterface, createUnknownEntryInterface, ensureDirectory, ensureFile, exists, file_exports, isFileInterface, isFolderInterface, isUnknownEntryInterface, 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 };
|
|
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 };
|
package/dist/file/link.cjs
CHANGED
|
@@ -1,36 +1,51 @@
|
|
|
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/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) {};
|
|
6
19
|
function handleNodeLinkError(error) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
else if (error.code === "
|
|
11
|
-
else if (error.code === "
|
|
12
|
-
else if (error.code === "
|
|
13
|
-
else if (error.code === "
|
|
14
|
-
else if (error.code === "
|
|
15
|
-
else if (error.code === "
|
|
16
|
-
else if (error.code === "
|
|
17
|
-
else if (error.code === "
|
|
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);
|
|
18
32
|
}
|
|
19
|
-
|
|
33
|
+
if (linkError === void 0) linkError = new LinkError(error);
|
|
34
|
+
return _duplojs_lang_either.left("file-system-link-error", linkError);
|
|
20
35
|
}
|
|
21
36
|
function handleDenoLinkError(error) {
|
|
22
|
-
|
|
23
|
-
if (error instanceof Deno.errors.
|
|
24
|
-
if (error instanceof Deno.errors.
|
|
25
|
-
if (error instanceof Deno.errors.
|
|
26
|
-
if (error instanceof Deno.errors.
|
|
27
|
-
if (error instanceof Deno.errors.
|
|
28
|
-
|
|
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);
|
|
29
46
|
}
|
|
30
47
|
const linkImplementation = require_implementor.implementFunction("link", {
|
|
31
|
-
NODE: async (existingPath, newPath) =>
|
|
32
|
-
return (await require_implementor.nodeFileSystem.value).link(existingPath, newPath).then(() => _duplojs_lang_either.right("file-system-link")).catch(handleNodeLinkError);
|
|
33
|
-
},
|
|
48
|
+
NODE: async (existingPath, newPath) => require_implementor.nodeFileSystem.value.link(existingPath, newPath).then(() => _duplojs_lang_either.right("file-system-link")).catch(handleNodeLinkError),
|
|
34
49
|
DENO: (existingPath, newPath) => Deno.link(existingPath, newPath).then(() => _duplojs_lang_either.right("file-system-link")).catch(handleDenoLinkError)
|
|
35
50
|
});
|
|
36
51
|
function link(...args) {
|
|
@@ -41,4 +56,15 @@ function link(...args) {
|
|
|
41
56
|
return linkImplementation(...args);
|
|
42
57
|
}
|
|
43
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;
|
|
44
70
|
exports.link = link;
|
package/dist/file/link.d.ts
CHANGED
|
@@ -1,11 +1,46 @@
|
|
|
1
|
-
import { FileSystemEither } from './types';
|
|
2
1
|
import * as DEither from "@duplojs/lang/either";
|
|
3
2
|
import type * as DPath from "@duplojs/lang/path";
|
|
4
|
-
|
|
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>);
|
|
5
39
|
declare module '../implementor' {
|
|
6
40
|
interface ServerFunction {
|
|
7
|
-
link(existingPath:
|
|
41
|
+
link(existingPath: DPath.AnyPath, newPath: DPath.AnyPath): Promise<LinkResult>;
|
|
8
42
|
}
|
|
9
43
|
}
|
|
10
|
-
export declare function link(newPath:
|
|
11
|
-
export declare function link(existingPath:
|
|
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 {};
|
package/dist/file/link.mjs
CHANGED
|
@@ -1,34 +1,48 @@
|
|
|
1
1
|
import { implementFunction, nodeFileSystem } from "../implementor.mjs";
|
|
2
|
+
import * as DCommon from "@duplojs/lang/common";
|
|
2
3
|
import * as DEither from "@duplojs/lang/either";
|
|
3
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) {};
|
|
4
16
|
function handleNodeLinkError(error) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
else if (error.code === "
|
|
9
|
-
else if (error.code === "
|
|
10
|
-
else if (error.code === "
|
|
11
|
-
else if (error.code === "
|
|
12
|
-
else if (error.code === "
|
|
13
|
-
else if (error.code === "
|
|
14
|
-
else if (error.code === "
|
|
15
|
-
else if (error.code === "
|
|
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);
|
|
16
29
|
}
|
|
17
|
-
|
|
30
|
+
if (linkError === void 0) linkError = new LinkError(error);
|
|
31
|
+
return DEither.left("file-system-link-error", linkError);
|
|
18
32
|
}
|
|
19
33
|
function handleDenoLinkError(error) {
|
|
20
|
-
|
|
21
|
-
if (error instanceof Deno.errors.
|
|
22
|
-
if (error instanceof Deno.errors.
|
|
23
|
-
if (error instanceof Deno.errors.
|
|
24
|
-
if (error instanceof Deno.errors.
|
|
25
|
-
if (error instanceof Deno.errors.
|
|
26
|
-
|
|
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);
|
|
27
43
|
}
|
|
28
44
|
const linkImplementation = implementFunction("link", {
|
|
29
|
-
NODE: async (existingPath, newPath) =>
|
|
30
|
-
return (await nodeFileSystem.value).link(existingPath, newPath).then(() => DEither.right("file-system-link")).catch(handleNodeLinkError);
|
|
31
|
-
},
|
|
45
|
+
NODE: async (existingPath, newPath) => nodeFileSystem.value.link(existingPath, newPath).then(() => DEither.right("file-system-link")).catch(handleNodeLinkError),
|
|
32
46
|
DENO: (existingPath, newPath) => Deno.link(existingPath, newPath).then(() => DEither.right("file-system-link")).catch(handleDenoLinkError)
|
|
33
47
|
});
|
|
34
48
|
function link(...args) {
|
|
@@ -39,4 +53,4 @@ function link(...args) {
|
|
|
39
53
|
return linkImplementation(...args);
|
|
40
54
|
}
|
|
41
55
|
//#endregion
|
|
42
|
-
export { link };
|
|
56
|
+
export { LinkError, LinkErrorAlreadyExists, LinkErrorBusy, LinkErrorCrossDevice, LinkErrorInvalidArgument, LinkErrorNoSpace, LinkErrorNotDirectory, LinkErrorNotFound, LinkErrorPermissionDenied, LinkErrorReadOnly, LinkErrorTooManyOpenFiles, link };
|