@depup/jsonjoy.com__fs-node-to-fsa 4.56.11-depup.0

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/lib/util.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newNoModificationAllowedError = exports.newNotAllowedError = exports.newTypeMismatchError = exports.newNotFoundError = exports.assertCanWrite = exports.assertName = exports.ctx = exports.basename = void 0;
4
+ const fs_fsa_1 = require("@jsonjoy.com/fs-fsa");
5
+ var fs_node_utils_1 = require("@jsonjoy.com/fs-node-utils");
6
+ Object.defineProperty(exports, "basename", { enumerable: true, get: function () { return fs_node_utils_1.basename; } });
7
+ /**
8
+ * Creates a new {@link NodeFsaContext}.
9
+ */
10
+ const ctx = (partial = {}) => {
11
+ return {
12
+ separator: '/',
13
+ syncHandleAllowed: false,
14
+ mode: 'read',
15
+ locks: new fs_fsa_1.FileLockManager(),
16
+ ...partial,
17
+ };
18
+ };
19
+ exports.ctx = ctx;
20
+ const nameRegex = /^(\.{1,2})$|^(.*([\/\\]).*)$/;
21
+ const assertName = (name, method, klass) => {
22
+ const isInvalid = !name || nameRegex.test(name);
23
+ if (isInvalid)
24
+ throw new TypeError(`Failed to execute '${method}' on '${klass}': Name is not allowed.`);
25
+ };
26
+ exports.assertName = assertName;
27
+ const assertCanWrite = (mode) => {
28
+ if (mode !== 'readwrite')
29
+ throw new DOMException('The request is not allowed by the user agent or the platform in the current context.', 'NotAllowedError');
30
+ };
31
+ exports.assertCanWrite = assertCanWrite;
32
+ const newNotFoundError = () => new DOMException('A requested file or directory could not be found at the time an operation was processed.', 'NotFoundError');
33
+ exports.newNotFoundError = newNotFoundError;
34
+ const newTypeMismatchError = () => new DOMException('The path supplied exists, but was not an entry of requested type.', 'TypeMismatchError');
35
+ exports.newTypeMismatchError = newTypeMismatchError;
36
+ const newNotAllowedError = () => new DOMException('Permission not granted.', 'NotAllowedError');
37
+ exports.newNotAllowedError = newNotAllowedError;
38
+ const newNoModificationAllowedError = () => new DOMException('The file is locked and cannot be modified.', 'NoModificationAllowedError');
39
+ exports.newNoModificationAllowedError = newNoModificationAllowedError;
40
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AACA,gDAAsD;AAEtD,4DAAsD;AAA7C,yGAAA,QAAQ,OAAA;AAEjB;;GAEG;AACI,MAAM,GAAG,GAAG,CAAC,UAAmC,EAAE,EAAkB,EAAE;IAC3E,OAAO;QACL,SAAS,EAAE,GAAG;QACd,iBAAiB,EAAE,KAAK;QACxB,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,IAAI,wBAAe,EAAE;QAC5B,GAAG,OAAO;KACX,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,GAAG,OAQd;AAEF,MAAM,SAAS,GAAG,8BAA8B,CAAC;AAE1C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,MAAc,EAAE,KAAa,EAAE,EAAE;IACxE,MAAM,SAAS,GAAG,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,SAAS;QAAE,MAAM,IAAI,SAAS,CAAC,sBAAsB,MAAM,SAAS,KAAK,yBAAyB,CAAC,CAAC;AAC1G,CAAC,CAAC;AAHW,QAAA,UAAU,cAGrB;AAEK,MAAM,cAAc,GAAG,CAAC,IAA0B,EAAE,EAAE;IAC3D,IAAI,IAAI,KAAK,WAAW;QACtB,MAAM,IAAI,YAAY,CACpB,sFAAsF,EACtF,iBAAiB,CAClB,CAAC;AACN,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB;AAEK,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,IAAI,YAAY,CACd,0FAA0F,EAC1F,eAAe,CAChB,CAAC;AAJS,QAAA,gBAAgB,oBAIzB;AAEG,MAAM,oBAAoB,GAAG,GAAG,EAAE,CACvC,IAAI,YAAY,CAAC,mEAAmE,EAAE,mBAAmB,CAAC,CAAC;AADhG,QAAA,oBAAoB,wBAC4E;AAEtG,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,yBAAyB,EAAE,iBAAiB,CAAC,CAAC;AAA1F,QAAA,kBAAkB,sBAAwE;AAEhG,MAAM,6BAA6B,GAAG,GAAG,EAAE,CAChD,IAAI,YAAY,CAAC,4CAA4C,EAAE,4BAA4B,CAAC,CAAC;AADlF,QAAA,6BAA6B,iCACqD"}
package/package.json ADDED
@@ -0,0 +1,97 @@
1
+ {
2
+ "name": "@depup/jsonjoy.com__fs-node-to-fsa",
3
+ "version": "4.56.11-depup.0",
4
+ "description": "[DepUp] Adapter to convert Node.js fs API to File System Access API",
5
+ "author": {
6
+ "name": "streamich",
7
+ "url": "https://github.com/streamich"
8
+ },
9
+ "homepage": "https://github.com/streamich/memfs/tree/master/packages/fs-node-to-fsa",
10
+ "repository": "streamich/memfs",
11
+ "license": "Apache-2.0",
12
+ "funding": {
13
+ "type": "github",
14
+ "url": "https://github.com/sponsors/streamich"
15
+ },
16
+ "keywords": [
17
+ "depup",
18
+ "dependency-bumped",
19
+ "updated-deps",
20
+ "@jsonjoy.com/fs-node-to-fsa",
21
+ "fs",
22
+ "filesystem",
23
+ "fsa",
24
+ "file-system-access",
25
+ "node-to-fsa",
26
+ "adapter"
27
+ ],
28
+ "engines": {
29
+ "node": ">=10.0"
30
+ },
31
+ "main": "lib/index.js",
32
+ "types": "lib/index.d.ts",
33
+ "typings": "lib/index.d.ts",
34
+ "files": [
35
+ "LICENSE",
36
+ "lib/",
37
+ "changes.json",
38
+ "README.md"
39
+ ],
40
+ "scripts": {
41
+ "clean": "rimraf lib typedocs coverage gh-pages yarn-error.log",
42
+ "build": "tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib",
43
+ "jest": "node -r ts-node/register ./node_modules/.bin/jest",
44
+ "test": "jest --maxWorkers 7",
45
+ "test:ci": "yarn jest --maxWorkers 3 --no-cache",
46
+ "coverage": "yarn test --collectCoverage",
47
+ "typedoc": "typedoc",
48
+ "typecheck": "tsc -p ."
49
+ },
50
+ "jest": {
51
+ "preset": "ts-jest",
52
+ "testEnvironment": "node",
53
+ "moduleFileExtensions": [
54
+ "ts",
55
+ "js",
56
+ "tsx"
57
+ ],
58
+ "transform": {
59
+ "^.+\\.tsx?$": "ts-jest"
60
+ },
61
+ "transformIgnorePatterns": [
62
+ ".*/node_modules/.*"
63
+ ],
64
+ "testRegex": ".*/(__tests__|__jest__|demo)/.*\\.(test|spec)\\.tsx?$",
65
+ "rootDir": ".",
66
+ "testPathIgnorePatterns": [
67
+ "node_modules"
68
+ ]
69
+ },
70
+ "devDependencies": {
71
+ "@jsonjoy.com/fs-node": "4.56.11",
72
+ "@types/jest": "^29.0.0",
73
+ "@types/node": "^20.0.0",
74
+ "jest": "^29.0.0",
75
+ "memfs": "4.56.11",
76
+ "rimraf": "^5.0.0",
77
+ "ts-jest": "^29.4.2",
78
+ "ts-node": "^10.9.2",
79
+ "typescript": "^5.9.2"
80
+ },
81
+ "peerDependencies": {
82
+ "tslib": "2"
83
+ },
84
+ "dependencies": {
85
+ "@jsonjoy.com/fs-fsa": "4.56.11",
86
+ "@jsonjoy.com/fs-node-builtins": "4.56.11",
87
+ "@jsonjoy.com/fs-node-utils": "4.56.11"
88
+ },
89
+ "depup": {
90
+ "changes": {},
91
+ "depsUpdated": 0,
92
+ "originalPackage": "@jsonjoy.com/fs-node-to-fsa",
93
+ "originalVersion": "4.56.11",
94
+ "processedAt": "2026-03-17T16:32:07.093Z",
95
+ "smokeTest": "passed"
96
+ }
97
+ }