cspell-io 8.2.3 → 8.2.4
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/esm/VirtualFS.d.ts
CHANGED
|
@@ -134,11 +134,13 @@ export interface VfsStat extends Stats {
|
|
|
134
134
|
isDirectory(): boolean;
|
|
135
135
|
isFile(): boolean;
|
|
136
136
|
isUnknown(): boolean;
|
|
137
|
+
isSymbolicLink(): boolean;
|
|
137
138
|
}
|
|
138
139
|
export interface VfsDirEntry extends DirEntry {
|
|
139
140
|
isDirectory(): boolean;
|
|
140
141
|
isFile(): boolean;
|
|
141
142
|
isUnknown(): boolean;
|
|
143
|
+
isSymbolicLink(): boolean;
|
|
142
144
|
}
|
|
143
145
|
export {};
|
|
144
146
|
//# sourceMappingURL=VirtualFS.d.ts.map
|
package/dist/esm/VirtualFS.js
CHANGED
|
@@ -30,7 +30,8 @@ class CVirtualFS {
|
|
|
30
30
|
if (this.loggingEnabled) {
|
|
31
31
|
const id = event.traceID.toFixed(13).replace(/\d{4}(?=\d)/g, '$&.');
|
|
32
32
|
const msg = event.message ? `\n\t\t${event.message}` : '';
|
|
33
|
-
|
|
33
|
+
const method = rPad(`${event.method}-${event.event}`, 16);
|
|
34
|
+
this.log(`${method} ID:${id} ts:${event.ts.toFixed(13)} ${chopUrl(event.url)}${msg}`);
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
37
|
registerFileSystemProvider(...providers) {
|
|
@@ -331,6 +332,9 @@ class CFileType {
|
|
|
331
332
|
isUnknown() {
|
|
332
333
|
return !this.fileType;
|
|
333
334
|
}
|
|
335
|
+
isSymbolicLink() {
|
|
336
|
+
return !!(this.fileType & FileType.SymbolicLink);
|
|
337
|
+
}
|
|
334
338
|
}
|
|
335
339
|
class CVfsStat extends CFileType {
|
|
336
340
|
stat;
|
|
@@ -367,6 +371,13 @@ class CVfsDirEntry extends CFileType {
|
|
|
367
371
|
this._url = new URL(this.entry.name, this.entry.dir);
|
|
368
372
|
return this._url;
|
|
369
373
|
}
|
|
374
|
+
toJSON() {
|
|
375
|
+
return {
|
|
376
|
+
name: this.name,
|
|
377
|
+
dir: this.dir,
|
|
378
|
+
fileType: this.fileType,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
370
381
|
}
|
|
371
382
|
function chopUrl(url) {
|
|
372
383
|
if (!url)
|
|
@@ -376,8 +387,11 @@ function chopUrl(url) {
|
|
|
376
387
|
const n = parts.indexOf('node_modules');
|
|
377
388
|
if (n > 0) {
|
|
378
389
|
const tail = parts.slice(Math.max(parts.length - 3, n + 1));
|
|
379
|
-
return parts.slice(0, n + 1).join('/') + '
|
|
390
|
+
return parts.slice(0, n + 1).join('/') + '/…/' + tail.join('/');
|
|
380
391
|
}
|
|
381
392
|
return href;
|
|
382
393
|
}
|
|
394
|
+
function rPad(str, len, ch = ' ') {
|
|
395
|
+
return str + ch.repeat(Math.max(0, len - str.length));
|
|
396
|
+
}
|
|
383
397
|
//# sourceMappingURL=VirtualFS.js.map
|
|
@@ -208,6 +208,7 @@ function direntToDirEntry(dir, dirent) {
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
function toFileType(statLike) {
|
|
211
|
-
|
|
211
|
+
const t = statLike.isFile() ? FileType.File : statLike.isDirectory() ? FileType.Directory : FileType.Unknown;
|
|
212
|
+
return statLike.isSymbolicLink() ? t | FileType.SymbolicLink : t;
|
|
212
213
|
}
|
|
213
214
|
//# sourceMappingURL=file.js.map
|
package/dist/esm/models/Stats.js
CHANGED
|
@@ -12,5 +12,9 @@ export var FileType;
|
|
|
12
12
|
* A directory.
|
|
13
13
|
*/
|
|
14
14
|
FileType[FileType["Directory"] = 2] = "Directory";
|
|
15
|
+
/**
|
|
16
|
+
* A symbolic link.
|
|
17
|
+
*/
|
|
18
|
+
FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink";
|
|
15
19
|
})(FileType || (FileType = {}));
|
|
16
20
|
//# sourceMappingURL=Stats.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cspell-io",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.4",
|
|
4
4
|
"description": "A library of useful I/O functions used across various cspell tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"typescript": "^5.3.3"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@cspell/cspell-service-bus": "8.2.
|
|
54
|
+
"@cspell/cspell-service-bus": "8.2.4"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d3c5ff685b3aa2bf984f557d81380f2c994547e0"
|
|
57
57
|
}
|