@statewalker/webrun-files-composite 0.10.4 → 0.10.5
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/cjs/index.cjs +8 -16
- package/dist/esm/index.js +8 -16
- package/package.json +3 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// ../webrun-files/dist/esm/index.js
|
|
3
3
|
/**
|
|
4
4
|
* The order every `FilesApi.list()` yields: paths compared by Unicode code
|
|
5
5
|
* point, which is the same as comparing their UTF-8 bytes — the order of
|
|
@@ -162,8 +162,7 @@ function basename(path, ext) {
|
|
|
162
162
|
if (ext && name.endsWith(ext)) return name.substring(0, name.length - ext.length);
|
|
163
163
|
return name;
|
|
164
164
|
}
|
|
165
|
-
|
|
166
|
-
//#region src/composite-files-api.ts
|
|
165
|
+
// src/composite-files-api.ts
|
|
167
166
|
/**
|
|
168
167
|
* Composite `FilesApi` that routes calls to one of several backends based
|
|
169
168
|
* on a path prefix. Mounts are matched by **longest prefix wins**, so a
|
|
@@ -417,8 +416,7 @@ function isStrictlyInside(path, ancestor) {
|
|
|
417
416
|
async function* fromArray(items) {
|
|
418
417
|
yield* items;
|
|
419
418
|
}
|
|
420
|
-
|
|
421
|
-
//#region src/cow-files-api.ts
|
|
419
|
+
// src/cow-files-api.ts
|
|
422
420
|
/**
|
|
423
421
|
* Copy-on-write view: a writable layer over a read-only `base`. The `base`
|
|
424
422
|
* is **never** mutated — every change (write, delete, move) is recorded in
|
|
@@ -584,8 +582,7 @@ var CowFilesApi = class {
|
|
|
584
582
|
function cow(base, writable, opts) {
|
|
585
583
|
return new CowFilesApi(base, writable, opts);
|
|
586
584
|
}
|
|
587
|
-
|
|
588
|
-
//#region src/glob-to-regexp.ts
|
|
585
|
+
// src/glob-to-regexp.ts
|
|
589
586
|
/**
|
|
590
587
|
* Compiles a glob pattern into a `RegExp`.
|
|
591
588
|
*
|
|
@@ -664,8 +661,7 @@ function globToRegExp(glob, opts = {}) {
|
|
|
664
661
|
if (!flags?.includes("g")) reStr = `^${reStr}$`;
|
|
665
662
|
return new RegExp(reStr, flags);
|
|
666
663
|
}
|
|
667
|
-
|
|
668
|
-
//#region src/filtered-files-api.ts
|
|
664
|
+
// src/filtered-files-api.ts
|
|
669
665
|
/**
|
|
670
666
|
* Builds a {@link PathFilter} that hides any path whose normalized form
|
|
671
667
|
* equals one of the provided prefixes or lives under `${prefix}/`.
|
|
@@ -875,8 +871,7 @@ var FilteredFilesApi = class {
|
|
|
875
871
|
return this.source.copy(source, target);
|
|
876
872
|
}
|
|
877
873
|
};
|
|
878
|
-
|
|
879
|
-
//#region src/guarded-files-api.ts
|
|
874
|
+
// src/guarded-files-api.ts
|
|
880
875
|
/**
|
|
881
876
|
* `FilesApi` decorator that runs every call through an ordered list of
|
|
882
877
|
* {@link FileGuard}s. A guard fires when its `operations` set intersects the
|
|
@@ -982,8 +977,7 @@ var GuardedFilesApi = class {
|
|
|
982
977
|
return this.source.copy(source, target);
|
|
983
978
|
}
|
|
984
979
|
};
|
|
985
|
-
|
|
986
|
-
//#region src/overlay-files-api.ts
|
|
980
|
+
// src/overlay-files-api.ts
|
|
987
981
|
/**
|
|
988
982
|
* Read-only union of several `FilesApi` layers. A path is resolved
|
|
989
983
|
* **top → bottom**: the first layer that has it wins for
|
|
@@ -1068,8 +1062,7 @@ var OverlayFilesApi = class {
|
|
|
1068
1062
|
function overlay(top, ...lower) {
|
|
1069
1063
|
return new OverlayFilesApi([top, ...lower]);
|
|
1070
1064
|
}
|
|
1071
|
-
|
|
1072
|
-
//#region src/read-only-files-api.ts
|
|
1065
|
+
// src/read-only-files-api.ts
|
|
1073
1066
|
/**
|
|
1074
1067
|
* Wraps a `FilesApi` in a read-only view: every mutating operation
|
|
1075
1068
|
* (`write`, `mkdir`, `remove`, `move`, `copy`) throws, while reads
|
|
@@ -1101,7 +1094,6 @@ function readOnly(api) {
|
|
|
1101
1094
|
message: "read-only"
|
|
1102
1095
|
}]);
|
|
1103
1096
|
}
|
|
1104
|
-
//#endregion
|
|
1105
1097
|
exports.CompositeFilesApi = CompositeFilesApi;
|
|
1106
1098
|
exports.FilteredFilesApi = FilteredFilesApi;
|
|
1107
1099
|
exports.GuardedFilesApi = GuardedFilesApi;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../webrun-files/dist/esm/index.js
|
|
2
2
|
/**
|
|
3
3
|
* The order every `FilesApi.list()` yields: paths compared by Unicode code
|
|
4
4
|
* point, which is the same as comparing their UTF-8 bytes — the order of
|
|
@@ -161,8 +161,7 @@ function basename(path, ext) {
|
|
|
161
161
|
if (ext && name.endsWith(ext)) return name.substring(0, name.length - ext.length);
|
|
162
162
|
return name;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
//#region src/composite-files-api.ts
|
|
164
|
+
// src/composite-files-api.ts
|
|
166
165
|
/**
|
|
167
166
|
* Composite `FilesApi` that routes calls to one of several backends based
|
|
168
167
|
* on a path prefix. Mounts are matched by **longest prefix wins**, so a
|
|
@@ -416,8 +415,7 @@ function isStrictlyInside(path, ancestor) {
|
|
|
416
415
|
async function* fromArray(items) {
|
|
417
416
|
yield* items;
|
|
418
417
|
}
|
|
419
|
-
|
|
420
|
-
//#region src/cow-files-api.ts
|
|
418
|
+
// src/cow-files-api.ts
|
|
421
419
|
/**
|
|
422
420
|
* Copy-on-write view: a writable layer over a read-only `base`. The `base`
|
|
423
421
|
* is **never** mutated — every change (write, delete, move) is recorded in
|
|
@@ -583,8 +581,7 @@ var CowFilesApi = class {
|
|
|
583
581
|
function cow(base, writable, opts) {
|
|
584
582
|
return new CowFilesApi(base, writable, opts);
|
|
585
583
|
}
|
|
586
|
-
|
|
587
|
-
//#region src/glob-to-regexp.ts
|
|
584
|
+
// src/glob-to-regexp.ts
|
|
588
585
|
/**
|
|
589
586
|
* Compiles a glob pattern into a `RegExp`.
|
|
590
587
|
*
|
|
@@ -663,8 +660,7 @@ function globToRegExp(glob, opts = {}) {
|
|
|
663
660
|
if (!flags?.includes("g")) reStr = `^${reStr}$`;
|
|
664
661
|
return new RegExp(reStr, flags);
|
|
665
662
|
}
|
|
666
|
-
|
|
667
|
-
//#region src/filtered-files-api.ts
|
|
663
|
+
// src/filtered-files-api.ts
|
|
668
664
|
/**
|
|
669
665
|
* Builds a {@link PathFilter} that hides any path whose normalized form
|
|
670
666
|
* equals one of the provided prefixes or lives under `${prefix}/`.
|
|
@@ -874,8 +870,7 @@ var FilteredFilesApi = class {
|
|
|
874
870
|
return this.source.copy(source, target);
|
|
875
871
|
}
|
|
876
872
|
};
|
|
877
|
-
|
|
878
|
-
//#region src/guarded-files-api.ts
|
|
873
|
+
// src/guarded-files-api.ts
|
|
879
874
|
/**
|
|
880
875
|
* `FilesApi` decorator that runs every call through an ordered list of
|
|
881
876
|
* {@link FileGuard}s. A guard fires when its `operations` set intersects the
|
|
@@ -981,8 +976,7 @@ var GuardedFilesApi = class {
|
|
|
981
976
|
return this.source.copy(source, target);
|
|
982
977
|
}
|
|
983
978
|
};
|
|
984
|
-
|
|
985
|
-
//#region src/overlay-files-api.ts
|
|
979
|
+
// src/overlay-files-api.ts
|
|
986
980
|
/**
|
|
987
981
|
* Read-only union of several `FilesApi` layers. A path is resolved
|
|
988
982
|
* **top → bottom**: the first layer that has it wins for
|
|
@@ -1067,8 +1061,7 @@ var OverlayFilesApi = class {
|
|
|
1067
1061
|
function overlay(top, ...lower) {
|
|
1068
1062
|
return new OverlayFilesApi([top, ...lower]);
|
|
1069
1063
|
}
|
|
1070
|
-
|
|
1071
|
-
//#region src/read-only-files-api.ts
|
|
1064
|
+
// src/read-only-files-api.ts
|
|
1072
1065
|
/**
|
|
1073
1066
|
* Wraps a `FilesApi` in a read-only view: every mutating operation
|
|
1074
1067
|
* (`write`, `mkdir`, `remove`, `move`, `copy`) throws, while reads
|
|
@@ -1100,5 +1093,4 @@ function readOnly(api) {
|
|
|
1100
1093
|
message: "read-only"
|
|
1101
1094
|
}]);
|
|
1102
1095
|
}
|
|
1103
|
-
//#endregion
|
|
1104
1096
|
export { CompositeFilesApi, FilteredFilesApi, GuardedFilesApi, cow, globToRegExp, newGlobPathFilter, newPathFilter, newRegexpPathFilter, overlay, readOnly };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statewalker/webrun-files-composite",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Composite FilesApi with mount points and access guards",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"src"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@statewalker/webrun-files": "^0.10.
|
|
37
|
+
"@statewalker/webrun-files": "^0.10.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^26.6.4",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"typescript": "^7.0.2",
|
|
44
44
|
"vitest": "^4.1.4 || ^5.0.3",
|
|
45
45
|
"@statewalker/webrun-files-tests": "^3.0.0",
|
|
46
|
-
"@statewalker/webrun-files-mem": "^0.10.
|
|
46
|
+
"@statewalker/webrun-files-mem": "^0.10.5"
|
|
47
47
|
},
|
|
48
48
|
"sideEffects": false,
|
|
49
49
|
"publishConfig": {
|