@zgeoff/chex 0.3.15 → 0.3.17
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgeoff/chex",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"description": "Run each shared docs and repo check as one subcommand, with the lefthook pre-push baseline that calls them",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"checks",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"typecheck": "tsrs --fast"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@zgeoff/std": "0.4.
|
|
80
|
+
"@zgeoff/std": "0.4.5",
|
|
81
81
|
"oxc-parser": "0.158.0",
|
|
82
82
|
"ts-pattern": "5.9.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/bun": "1.4.4",
|
|
86
|
-
"@zgeoff/rig": "0.2.
|
|
87
|
-
"@zgeoff/std": "0.4.
|
|
86
|
+
"@zgeoff/rig": "0.2.7",
|
|
87
|
+
"@zgeoff/std": "0.4.5",
|
|
88
88
|
"@zgeoff/testing": "0.3.1",
|
|
89
89
|
"@zgeoff/tools-scripts": "0.0.0",
|
|
90
90
|
"msw": "2.15.0",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { lstatSync } from 'node:fs';
|
|
2
2
|
import { dirname, join, relative, sep } from 'node:path';
|
|
3
3
|
|
|
4
|
-
// Returns a probe for a file under the repo root. A path
|
|
5
|
-
//
|
|
4
|
+
// Returns a probe for a file under the repo root. A path reads as absent when a folder below the root
|
|
5
|
+
// is a link (git tracks no file beyond a link) or when it is a folder itself (a deleted path comes
|
|
6
|
+
// back only as a file or a link). Neither is a restored copy.
|
|
6
7
|
export function makeFileProbe(root: string): (path: string) => boolean {
|
|
7
8
|
return (path) => {
|
|
8
9
|
const folders = relative(root, dirname(path))
|
|
@@ -16,6 +17,12 @@ export function makeFileProbe(root: string): (path: string) => boolean {
|
|
|
16
17
|
})?.isSymbolicLink() === true,
|
|
17
18
|
);
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
if (linked) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const entry = lstatSync(path, { throwIfNoEntry: false });
|
|
25
|
+
|
|
26
|
+
return entry !== undefined && !entry.isDirectory();
|
|
20
27
|
};
|
|
21
28
|
}
|