@vltpkg/query 1.0.0-rc.2 → 1.0.0-rc.23
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 +36 -47
- package/dist/esm/attribute.d.ts +0 -15
- package/dist/esm/attribute.d.ts.map +0 -1
- package/dist/esm/attribute.js +0 -133
- package/dist/esm/attribute.js.map +0 -1
- package/dist/esm/combinator.d.ts +0 -6
- package/dist/esm/combinator.d.ts.map +0 -1
- package/dist/esm/combinator.js +0 -112
- package/dist/esm/combinator.js.map +0 -1
- package/dist/esm/id.d.ts +0 -6
- package/dist/esm/id.d.ts.map +0 -1
- package/dist/esm/id.js +0 -36
- package/dist/esm/id.js.map +0 -1
- package/dist/esm/index.d.ts +0 -48
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -408
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/esm/parser.d.ts +0 -15
- package/dist/esm/parser.d.ts.map +0 -1
- package/dist/esm/parser.js +0 -93
- package/dist/esm/parser.js.map +0 -1
- package/dist/esm/pseudo/abandoned.d.ts +0 -7
- package/dist/esm/pseudo/abandoned.d.ts.map +0 -1
- package/dist/esm/pseudo/abandoned.js +0 -6
- package/dist/esm/pseudo/abandoned.js.map +0 -1
- package/dist/esm/pseudo/attr.d.ts +0 -19
- package/dist/esm/pseudo/attr.d.ts.map +0 -1
- package/dist/esm/pseudo/attr.js +0 -58
- package/dist/esm/pseudo/attr.js.map +0 -1
- package/dist/esm/pseudo/built.d.ts +0 -8
- package/dist/esm/pseudo/built.d.ts.map +0 -1
- package/dist/esm/pseudo/built.js +0 -16
- package/dist/esm/pseudo/built.js.map +0 -1
- package/dist/esm/pseudo/confused.d.ts +0 -9
- package/dist/esm/pseudo/confused.d.ts.map +0 -1
- package/dist/esm/pseudo/confused.js +0 -19
- package/dist/esm/pseudo/confused.js.map +0 -1
- package/dist/esm/pseudo/cve.d.ts +0 -13
- package/dist/esm/pseudo/cve.d.ts.map +0 -1
- package/dist/esm/pseudo/cve.js +0 -44
- package/dist/esm/pseudo/cve.js.map +0 -1
- package/dist/esm/pseudo/cwe.d.ts +0 -13
- package/dist/esm/pseudo/cwe.d.ts.map +0 -1
- package/dist/esm/pseudo/cwe.js +0 -43
- package/dist/esm/pseudo/cwe.js.map +0 -1
- package/dist/esm/pseudo/debug.d.ts +0 -7
- package/dist/esm/pseudo/debug.d.ts.map +0 -1
- package/dist/esm/pseudo/debug.js +0 -6
- package/dist/esm/pseudo/debug.js.map +0 -1
- package/dist/esm/pseudo/deprecated.d.ts +0 -7
- package/dist/esm/pseudo/deprecated.d.ts.map +0 -1
- package/dist/esm/pseudo/deprecated.js +0 -6
- package/dist/esm/pseudo/deprecated.js.map +0 -1
- package/dist/esm/pseudo/dev.d.ts +0 -6
- package/dist/esm/pseudo/dev.d.ts.map +0 -1
- package/dist/esm/pseudo/dev.js +0 -15
- package/dist/esm/pseudo/dev.js.map +0 -1
- package/dist/esm/pseudo/dynamic.d.ts +0 -7
- package/dist/esm/pseudo/dynamic.d.ts.map +0 -1
- package/dist/esm/pseudo/dynamic.js +0 -6
- package/dist/esm/pseudo/dynamic.js.map +0 -1
- package/dist/esm/pseudo/empty.d.ts +0 -7
- package/dist/esm/pseudo/empty.d.ts.map +0 -1
- package/dist/esm/pseudo/empty.js +0 -14
- package/dist/esm/pseudo/empty.js.map +0 -1
- package/dist/esm/pseudo/entropic.d.ts +0 -7
- package/dist/esm/pseudo/entropic.d.ts.map +0 -1
- package/dist/esm/pseudo/entropic.js +0 -6
- package/dist/esm/pseudo/entropic.js.map +0 -1
- package/dist/esm/pseudo/env.d.ts +0 -7
- package/dist/esm/pseudo/env.d.ts.map +0 -1
- package/dist/esm/pseudo/env.js +0 -6
- package/dist/esm/pseudo/env.js.map +0 -1
- package/dist/esm/pseudo/eval.d.ts +0 -7
- package/dist/esm/pseudo/eval.d.ts.map +0 -1
- package/dist/esm/pseudo/eval.js +0 -6
- package/dist/esm/pseudo/eval.js.map +0 -1
- package/dist/esm/pseudo/fs.d.ts +0 -7
- package/dist/esm/pseudo/fs.d.ts.map +0 -1
- package/dist/esm/pseudo/fs.js +0 -6
- package/dist/esm/pseudo/fs.js.map +0 -1
- package/dist/esm/pseudo/helpers.d.ts +0 -39
- package/dist/esm/pseudo/helpers.d.ts.map +0 -1
- package/dist/esm/pseudo/helpers.js +0 -77
- package/dist/esm/pseudo/helpers.js.map +0 -1
- package/dist/esm/pseudo/host.d.ts +0 -20
- package/dist/esm/pseudo/host.d.ts.map +0 -1
- package/dist/esm/pseudo/host.js +0 -80
- package/dist/esm/pseudo/host.js.map +0 -1
- package/dist/esm/pseudo/license.d.ts +0 -13
- package/dist/esm/pseudo/license.d.ts.map +0 -1
- package/dist/esm/pseudo/license.js +0 -75
- package/dist/esm/pseudo/license.js.map +0 -1
- package/dist/esm/pseudo/link.d.ts +0 -9
- package/dist/esm/pseudo/link.d.ts.map +0 -1
- package/dist/esm/pseudo/link.js +0 -25
- package/dist/esm/pseudo/link.js.map +0 -1
- package/dist/esm/pseudo/malware.d.ts +0 -24
- package/dist/esm/pseudo/malware.d.ts.map +0 -1
- package/dist/esm/pseudo/malware.js +0 -187
- package/dist/esm/pseudo/malware.js.map +0 -1
- package/dist/esm/pseudo/minified.d.ts +0 -7
- package/dist/esm/pseudo/minified.d.ts.map +0 -1
- package/dist/esm/pseudo/minified.js +0 -6
- package/dist/esm/pseudo/minified.js.map +0 -1
- package/dist/esm/pseudo/missing.d.ts +0 -8
- package/dist/esm/pseudo/missing.d.ts.map +0 -1
- package/dist/esm/pseudo/missing.js +0 -15
- package/dist/esm/pseudo/missing.js.map +0 -1
- package/dist/esm/pseudo/native.d.ts +0 -7
- package/dist/esm/pseudo/native.d.ts.map +0 -1
- package/dist/esm/pseudo/native.js +0 -6
- package/dist/esm/pseudo/native.js.map +0 -1
- package/dist/esm/pseudo/network.d.ts +0 -7
- package/dist/esm/pseudo/network.d.ts.map +0 -1
- package/dist/esm/pseudo/network.js +0 -6
- package/dist/esm/pseudo/network.js.map +0 -1
- package/dist/esm/pseudo/obfuscated.d.ts +0 -7
- package/dist/esm/pseudo/obfuscated.d.ts.map +0 -1
- package/dist/esm/pseudo/obfuscated.js +0 -6
- package/dist/esm/pseudo/obfuscated.js.map +0 -1
- package/dist/esm/pseudo/optional.d.ts +0 -6
- package/dist/esm/pseudo/optional.d.ts.map +0 -1
- package/dist/esm/pseudo/optional.js +0 -15
- package/dist/esm/pseudo/optional.js.map +0 -1
- package/dist/esm/pseudo/outdated.d.ts +0 -54
- package/dist/esm/pseudo/outdated.d.ts.map +0 -1
- package/dist/esm/pseudo/outdated.js +0 -212
- package/dist/esm/pseudo/outdated.js.map +0 -1
- package/dist/esm/pseudo/overridden.d.ts +0 -8
- package/dist/esm/pseudo/overridden.d.ts.map +0 -1
- package/dist/esm/pseudo/overridden.js +0 -17
- package/dist/esm/pseudo/overridden.js.map +0 -1
- package/dist/esm/pseudo/path.d.ts +0 -19
- package/dist/esm/pseudo/path.d.ts.map +0 -1
- package/dist/esm/pseudo/path.js +0 -113
- package/dist/esm/pseudo/path.js.map +0 -1
- package/dist/esm/pseudo/peer.d.ts +0 -6
- package/dist/esm/pseudo/peer.d.ts.map +0 -1
- package/dist/esm/pseudo/peer.js +0 -15
- package/dist/esm/pseudo/peer.js.map +0 -1
- package/dist/esm/pseudo/prerelease.d.ts +0 -18
- package/dist/esm/pseudo/prerelease.d.ts.map +0 -1
- package/dist/esm/pseudo/prerelease.js +0 -41
- package/dist/esm/pseudo/prerelease.js.map +0 -1
- package/dist/esm/pseudo/private.d.ts +0 -7
- package/dist/esm/pseudo/private.d.ts.map +0 -1
- package/dist/esm/pseudo/private.js +0 -16
- package/dist/esm/pseudo/private.js.map +0 -1
- package/dist/esm/pseudo/prod.d.ts +0 -6
- package/dist/esm/pseudo/prod.d.ts.map +0 -1
- package/dist/esm/pseudo/prod.js +0 -15
- package/dist/esm/pseudo/prod.js.map +0 -1
- package/dist/esm/pseudo/published.d.ts +0 -40
- package/dist/esm/pseudo/published.d.ts.map +0 -1
- package/dist/esm/pseudo/published.js +0 -180
- package/dist/esm/pseudo/published.js.map +0 -1
- package/dist/esm/pseudo/root.d.ts +0 -7
- package/dist/esm/pseudo/root.d.ts.map +0 -1
- package/dist/esm/pseudo/root.js +0 -18
- package/dist/esm/pseudo/root.js.map +0 -1
- package/dist/esm/pseudo/scanned.d.ts +0 -9
- package/dist/esm/pseudo/scanned.d.ts.map +0 -1
- package/dist/esm/pseudo/scanned.js +0 -17
- package/dist/esm/pseudo/scanned.js.map +0 -1
- package/dist/esm/pseudo/score.d.ts +0 -16
- package/dist/esm/pseudo/score.d.ts.map +0 -1
- package/dist/esm/pseudo/score.js +0 -133
- package/dist/esm/pseudo/score.js.map +0 -1
- package/dist/esm/pseudo/scripts.d.ts +0 -10
- package/dist/esm/pseudo/scripts.d.ts.map +0 -1
- package/dist/esm/pseudo/scripts.js +0 -44
- package/dist/esm/pseudo/scripts.js.map +0 -1
- package/dist/esm/pseudo/semver.d.ts +0 -17
- package/dist/esm/pseudo/semver.d.ts.map +0 -1
- package/dist/esm/pseudo/semver.js +0 -167
- package/dist/esm/pseudo/semver.js.map +0 -1
- package/dist/esm/pseudo/severity.d.ts +0 -15
- package/dist/esm/pseudo/severity.d.ts.map +0 -1
- package/dist/esm/pseudo/severity.js +0 -160
- package/dist/esm/pseudo/severity.js.map +0 -1
- package/dist/esm/pseudo/shell.d.ts +0 -7
- package/dist/esm/pseudo/shell.d.ts.map +0 -1
- package/dist/esm/pseudo/shell.js +0 -6
- package/dist/esm/pseudo/shell.js.map +0 -1
- package/dist/esm/pseudo/shrinkwrap.d.ts +0 -7
- package/dist/esm/pseudo/shrinkwrap.d.ts.map +0 -1
- package/dist/esm/pseudo/shrinkwrap.js +0 -6
- package/dist/esm/pseudo/shrinkwrap.js.map +0 -1
- package/dist/esm/pseudo/spec.d.ts +0 -17
- package/dist/esm/pseudo/spec.d.ts.map +0 -1
- package/dist/esm/pseudo/spec.js +0 -102
- package/dist/esm/pseudo/spec.js.map +0 -1
- package/dist/esm/pseudo/squat.d.ts +0 -15
- package/dist/esm/pseudo/squat.d.ts.map +0 -1
- package/dist/esm/pseudo/squat.js +0 -172
- package/dist/esm/pseudo/squat.js.map +0 -1
- package/dist/esm/pseudo/suspicious.d.ts +0 -7
- package/dist/esm/pseudo/suspicious.d.ts.map +0 -1
- package/dist/esm/pseudo/suspicious.js +0 -6
- package/dist/esm/pseudo/suspicious.js.map +0 -1
- package/dist/esm/pseudo/tracker.d.ts +0 -7
- package/dist/esm/pseudo/tracker.d.ts.map +0 -1
- package/dist/esm/pseudo/tracker.js +0 -6
- package/dist/esm/pseudo/tracker.js.map +0 -1
- package/dist/esm/pseudo/trivial.d.ts +0 -7
- package/dist/esm/pseudo/trivial.d.ts.map +0 -1
- package/dist/esm/pseudo/trivial.js +0 -6
- package/dist/esm/pseudo/trivial.js.map +0 -1
- package/dist/esm/pseudo/type.d.ts +0 -8
- package/dist/esm/pseudo/type.d.ts.map +0 -1
- package/dist/esm/pseudo/type.js +0 -22
- package/dist/esm/pseudo/type.js.map +0 -1
- package/dist/esm/pseudo/undesirable.d.ts +0 -7
- package/dist/esm/pseudo/undesirable.d.ts.map +0 -1
- package/dist/esm/pseudo/undesirable.js +0 -6
- package/dist/esm/pseudo/undesirable.js.map +0 -1
- package/dist/esm/pseudo/unknown.d.ts +0 -7
- package/dist/esm/pseudo/unknown.d.ts.map +0 -1
- package/dist/esm/pseudo/unknown.js +0 -6
- package/dist/esm/pseudo/unknown.js.map +0 -1
- package/dist/esm/pseudo/unmaintained.d.ts +0 -7
- package/dist/esm/pseudo/unmaintained.d.ts.map +0 -1
- package/dist/esm/pseudo/unmaintained.js +0 -6
- package/dist/esm/pseudo/unmaintained.js.map +0 -1
- package/dist/esm/pseudo/unpopular.d.ts +0 -7
- package/dist/esm/pseudo/unpopular.d.ts.map +0 -1
- package/dist/esm/pseudo/unpopular.js +0 -6
- package/dist/esm/pseudo/unpopular.js.map +0 -1
- package/dist/esm/pseudo/unstable.d.ts +0 -7
- package/dist/esm/pseudo/unstable.d.ts.map +0 -1
- package/dist/esm/pseudo/unstable.js +0 -6
- package/dist/esm/pseudo/unstable.js.map +0 -1
- package/dist/esm/pseudo/workspace.d.ts +0 -6
- package/dist/esm/pseudo/workspace.d.ts.map +0 -1
- package/dist/esm/pseudo/workspace.js +0 -20
- package/dist/esm/pseudo/workspace.js.map +0 -1
- package/dist/esm/pseudo.d.ts +0 -6
- package/dist/esm/pseudo.d.ts.map +0 -1
- package/dist/esm/pseudo.js +0 -361
- package/dist/esm/pseudo.js.map +0 -1
- package/dist/esm/types.d.ts +0 -118
- package/dist/esm/types.d.ts.map +0 -1
- package/dist/esm/types.js +0 -2
- package/dist/esm/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,79 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/query",
|
|
3
3
|
"description": "Query syntax parser that retrieves items from a graph",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.23",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
8
8
|
"directory": "src/query"
|
|
9
9
|
},
|
|
10
|
-
"author":
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"liveDev": true,
|
|
14
|
-
"dialects": [
|
|
15
|
-
"esm"
|
|
16
|
-
],
|
|
17
|
-
"exports": {
|
|
18
|
-
"./package.json": "./package.json",
|
|
19
|
-
".": "./src/index.ts"
|
|
20
|
-
}
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "vlt technology inc.",
|
|
12
|
+
"email": "support@vlt.sh"
|
|
21
13
|
},
|
|
22
14
|
"dependencies": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"@vltpkg/
|
|
27
|
-
"@vltpkg/
|
|
28
|
-
"@vltpkg/
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"@vltpkg/semver": "1.0.0-rc.2"
|
|
15
|
+
"@vltpkg/dep-id": "1.0.0-rc.23",
|
|
16
|
+
"@vltpkg/dss-parser": "1.0.0-rc.23",
|
|
17
|
+
"@vltpkg/error-cause": "1.0.0-rc.23",
|
|
18
|
+
"@vltpkg/security-archive": "1.0.0-rc.23",
|
|
19
|
+
"@vltpkg/semver": "1.0.0-rc.23",
|
|
20
|
+
"@vltpkg/types": "1.0.0-rc.23",
|
|
21
|
+
"minimatch": "^10.1.1",
|
|
22
|
+
"p-retry": "^7.1.1",
|
|
23
|
+
"postcss-selector-parser": "^7.1.1"
|
|
33
24
|
},
|
|
34
25
|
"devDependencies": {
|
|
35
|
-
"@eslint/js": "^9.
|
|
36
|
-
"@types/node": "^22.
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
26
|
+
"@eslint/js": "^9.39.1",
|
|
27
|
+
"@types/node": "^22.19.2",
|
|
28
|
+
"@vltpkg/spec": "1.0.0-rc.23",
|
|
29
|
+
"eslint": "^9.39.1",
|
|
30
|
+
"prettier": "^3.7.4",
|
|
31
|
+
"tap": "^21.5.0",
|
|
41
32
|
"typedoc": "~0.27.9",
|
|
42
33
|
"typescript": "5.7.3",
|
|
43
|
-
"typescript-eslint": "^8.
|
|
44
|
-
"@vltpkg/spec": "1.0.0-rc.2"
|
|
34
|
+
"typescript-eslint": "^8.49.0"
|
|
45
35
|
},
|
|
46
36
|
"license": "BSD-2-Clause-Patent",
|
|
47
37
|
"engines": {
|
|
48
|
-
"node": ">=22"
|
|
38
|
+
"node": ">=22.22.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
|
|
42
|
+
"format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
|
|
43
|
+
"lint": "eslint . --fix",
|
|
44
|
+
"lint:check": "eslint .",
|
|
45
|
+
"prepack": "tsc -p tsconfig.publish.json && ../../scripts/update-dist-exports.ts",
|
|
46
|
+
"snap": "tap",
|
|
47
|
+
"test": "tap",
|
|
48
|
+
"posttest": "tsc --noEmit",
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
49
50
|
},
|
|
50
51
|
"tap": {
|
|
51
52
|
"extends": "../../tap-config.yaml"
|
|
52
53
|
},
|
|
53
54
|
"prettier": "../../.prettierrc.js",
|
|
54
|
-
"module": "./dist/
|
|
55
|
+
"module": "./dist/index.js",
|
|
55
56
|
"type": "module",
|
|
56
57
|
"exports": {
|
|
57
58
|
"./package.json": "./package.json",
|
|
58
59
|
".": {
|
|
59
60
|
"import": {
|
|
60
|
-
"
|
|
61
|
-
"default": "./dist/esm/index.js"
|
|
61
|
+
"default": "./dist/index.js"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"files": [
|
|
66
66
|
"dist"
|
|
67
|
-
]
|
|
68
|
-
|
|
69
|
-
"format": "prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache",
|
|
70
|
-
"format:check": "prettier --check . --ignore-path ../../.prettierignore --cache",
|
|
71
|
-
"lint": "eslint . --fix",
|
|
72
|
-
"lint:check": "eslint .",
|
|
73
|
-
"snap": "tap",
|
|
74
|
-
"test": "tap",
|
|
75
|
-
"posttest": "tsc --noEmit",
|
|
76
|
-
"tshy": "tshy",
|
|
77
|
-
"typecheck": "tsc --noEmit"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
67
|
+
]
|
|
68
|
+
}
|
package/dist/esm/attribute.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NodeLike } from '@vltpkg/types';
|
|
2
|
-
import type { ParserState } from './types.ts';
|
|
3
|
-
export type ComparatorFn = (attr: string, value?: string) => boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Retrieve the {@link Manifest} values found at the given `properties`
|
|
6
|
-
* location for a given {@link Node}.
|
|
7
|
-
*/
|
|
8
|
-
export declare const getManifestPropertyValues: (node: NodeLike, properties: string[], attribute: string) => string[] | undefined;
|
|
9
|
-
export declare const filterAttributes: (state: ParserState, comparator: ComparatorFn | undefined, value: string, propertyName: string, insensitive: boolean, prefixProperties?: string[]) => ParserState;
|
|
10
|
-
export declare const attributeSelectorsMap: Map<string, ComparatorFn>;
|
|
11
|
-
/**
|
|
12
|
-
* Parse attributes selectors, e.g: `[name]`, `[name=value]`, etc
|
|
13
|
-
*/
|
|
14
|
-
export declare const attribute: (state: ParserState) => Promise<ParserState>;
|
|
15
|
-
//# sourceMappingURL=attribute.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attribute.d.ts","sourceRoot":"","sources":["../../src/attribute.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAuB,MAAM,eAAe,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,OAAO,CAAA;AAOpE;;;GAGG;AACH,eAAO,MAAM,yBAAyB,SAC9B,QAAQ,cACF,MAAM,EAAE,aACT,MAAM,KAChB,MAAM,EAAE,GAAG,SA+Db,CAAA;AAID,eAAO,MAAM,gBAAgB,UACpB,WAAW,cACN,YAAY,GAAG,SAAS,SAC7B,MAAM,gBACC,MAAM,eACP,OAAO,qBACF,MAAM,EAAE,KACzB,WAsCF,CAAA;AAcD,eAAO,MAAM,qBAAqB,2BAEjC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,UACb,WAAW,KACjB,OAAO,CAAC,WAAW,CA6BrB,CAAA"}
|
package/dist/esm/attribute.js
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { asAttributeNode } from '@vltpkg/dss-parser';
|
|
2
|
-
import { error } from '@vltpkg/error-cause';
|
|
3
|
-
import { removeDanglingEdges } from "./pseudo/helpers.js";
|
|
4
|
-
// JSONField has a mapped type constituent that would coerce to [object Object]
|
|
5
|
-
// when stringified, which is what we want in this case.
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
7
|
-
const jsonFieldToString = (v) => String(v);
|
|
8
|
-
/**
|
|
9
|
-
* Retrieve the {@link Manifest} values found at the given `properties`
|
|
10
|
-
* location for a given {@link Node}.
|
|
11
|
-
*/
|
|
12
|
-
export const getManifestPropertyValues = (node, properties, attribute) => {
|
|
13
|
-
if (!node.manifest)
|
|
14
|
-
return;
|
|
15
|
-
const traverse = new Set([node.manifest]);
|
|
16
|
-
const props = new Set();
|
|
17
|
-
for (const key of properties) {
|
|
18
|
-
for (const prop of traverse) {
|
|
19
|
-
/* c8 ignore start - should be impossible */
|
|
20
|
-
if (!prop) {
|
|
21
|
-
throw error('failed to find nested property in :attr', {
|
|
22
|
-
found: properties,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
/* c8 ignore stop */
|
|
26
|
-
// expand the result list to include nested array values
|
|
27
|
-
if (Array.isArray(prop)) {
|
|
28
|
-
for (const p of prop) {
|
|
29
|
-
traverse.add(p);
|
|
30
|
-
}
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
// guard for inspecting keys of objects next
|
|
34
|
-
if (typeof prop === 'string' ||
|
|
35
|
-
typeof prop === 'number' ||
|
|
36
|
-
typeof prop === 'boolean') {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
// assign next value when found
|
|
40
|
-
if (key in prop) {
|
|
41
|
-
const nextValue = prop[key];
|
|
42
|
-
if (nextValue) {
|
|
43
|
-
if (key === attribute) {
|
|
44
|
-
props.add(nextValue);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
traverse.delete(prop);
|
|
48
|
-
traverse.add(nextValue);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// if no value was found after trying a given key
|
|
55
|
-
// then there's nothing to be collected
|
|
56
|
-
if (!props.size)
|
|
57
|
-
return;
|
|
58
|
-
// expand the result to include array values
|
|
59
|
-
const collect = new Set();
|
|
60
|
-
for (const prop of props) {
|
|
61
|
-
if (Array.isArray(prop)) {
|
|
62
|
-
for (const p of prop) {
|
|
63
|
-
collect.add(p ? jsonFieldToString(p) : '');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
collect.add(jsonFieldToString(prop));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return [...collect];
|
|
71
|
-
};
|
|
72
|
-
// decorator style of function that will filter `ParserState` results
|
|
73
|
-
// based on a provided `comparator` function
|
|
74
|
-
export const filterAttributes = (state, comparator, value, propertyName, insensitive, prefixProperties = []) => {
|
|
75
|
-
const check = (attr) => comparator?.(insensitive ?
|
|
76
|
-
jsonFieldToString(attr).toLowerCase()
|
|
77
|
-
: jsonFieldToString(attr), insensitive ? value.toLowerCase() : value);
|
|
78
|
-
const deleteNode = (node) => {
|
|
79
|
-
for (const edge of node.edgesIn) {
|
|
80
|
-
state.partial.edges.delete(edge);
|
|
81
|
-
}
|
|
82
|
-
state.partial.nodes.delete(node);
|
|
83
|
-
};
|
|
84
|
-
for (const node of state.partial.nodes) {
|
|
85
|
-
const prefixes = prefixProperties.length ? prefixProperties : [propertyName];
|
|
86
|
-
const attrs = getManifestPropertyValues(node, prefixes, propertyName);
|
|
87
|
-
// if no attribute value was found, that means the attribute won't match
|
|
88
|
-
if (!attrs?.length) {
|
|
89
|
-
deleteNode(node);
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
// if the node attribute value won't match, then remove the node
|
|
93
|
-
if (comparator && !attrs.some(check)) {
|
|
94
|
-
deleteNode(node);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
removeDanglingEdges(state);
|
|
98
|
-
return state;
|
|
99
|
-
};
|
|
100
|
-
// ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
|
|
101
|
-
const attributeSelectors = {
|
|
102
|
-
'=': (attr, value = '') => attr === value,
|
|
103
|
-
'^=': (attr, value = '') => attr.startsWith(value),
|
|
104
|
-
'$=': (attr, value = '') => attr.endsWith(value),
|
|
105
|
-
'~=': (attr, value = '') => new Set(attr.match(/\w+/g)).has(value),
|
|
106
|
-
'*=': (attr, value = '') => attr.includes(value),
|
|
107
|
-
'|=': (attr, value = '') => attr === value || attr.startsWith(`${value}-`),
|
|
108
|
-
undefined: (attr) => !!attr,
|
|
109
|
-
};
|
|
110
|
-
export const attributeSelectorsMap = new Map(Object.entries(attributeSelectors));
|
|
111
|
-
/**
|
|
112
|
-
* Parse attributes selectors, e.g: `[name]`, `[name=value]`, etc
|
|
113
|
-
*/
|
|
114
|
-
export const attribute = async (state) => {
|
|
115
|
-
await state.cancellable();
|
|
116
|
-
const curr = asAttributeNode(state.current);
|
|
117
|
-
const operatorFn = attributeSelectorsMap.get(String(curr.operator));
|
|
118
|
-
if (!operatorFn) {
|
|
119
|
-
if (state.loose) {
|
|
120
|
-
return state;
|
|
121
|
-
}
|
|
122
|
-
throw error(`Unsupported attribute operator: ${curr.operator}`, {
|
|
123
|
-
found: state.current,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
const value = curr.value || '';
|
|
127
|
-
const propertyName = curr.attribute;
|
|
128
|
-
const insensitive = !!curr.insensitive;
|
|
129
|
-
// Increment the commonCounter for specificity
|
|
130
|
-
state.specificity.commonCounter += 1;
|
|
131
|
-
return filterAttributes(state, operatorFn, value, propertyName, insensitive);
|
|
132
|
-
};
|
|
133
|
-
//# sourceMappingURL=attribute.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attribute.js","sourceRoot":"","sources":["../../src/attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE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AAC,OAAO;SACrB,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;IAC9B,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAA;IACnC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAA;IAEtC,8CAA8C;IAC9C,KAAK,CAAC,WAAW,CAAC,aAAa,IAAI,CAAC,CAAA;IAEpC,OAAO,gBAAgB,CACrB,KAAK,EACL,UAAU,EACV,KAAK,EACL,YAAY,EACZ,WAAW,CACZ,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { asAttributeNode } from '@vltpkg/dss-parser'\nimport { error } from '@vltpkg/error-cause'\nimport { removeDanglingEdges } from './pseudo/helpers.ts'\nimport type { NodeLike, JSONField, Manifest } from '@vltpkg/types'\nimport type { ParserState } from './types.ts'\n\nexport type ComparatorFn = (attr: string, value?: string) => boolean\n\n// JSONField has a mapped type constituent that would coerce to [object Object]\n// when stringified, which is what we want in this case.\n// eslint-disable-next-line @typescript-eslint/no-base-to-string\nconst jsonFieldToString = (v: JSONField) => String(v)\n\n/**\n * Retrieve the {@link Manifest} values found at the given `properties`\n * location for a given {@link Node}.\n */\nexport const getManifestPropertyValues = (\n node: NodeLike,\n properties: string[],\n attribute: string,\n): string[] | undefined => {\n if (!node.manifest) return\n\n const traverse = new Set<JSONField>([node.manifest as JSONField])\n const props = new Set<JSONField>()\n for (const key of properties) {\n for (const prop of traverse) {\n /* c8 ignore start - should be impossible */\n if (!prop) {\n throw error('failed to find nested property in :attr', {\n found: properties,\n })\n }\n /* c8 ignore stop */\n\n // expand the result list to include nested array values\n if (Array.isArray(prop)) {\n for (const p of prop) {\n traverse.add(p)\n }\n continue\n }\n\n // guard for inspecting keys of objects next\n if (\n typeof prop === 'string' ||\n typeof prop === 'number' ||\n typeof prop === 'boolean'\n ) {\n continue\n }\n\n // assign next value when found\n if (key in prop) {\n const nextValue = prop[key]\n if (nextValue) {\n if (key === attribute) {\n props.add(nextValue)\n } else {\n traverse.delete(prop)\n traverse.add(nextValue)\n }\n }\n }\n }\n }\n // if no value was found after trying a given key\n // then there's nothing to be collected\n if (!props.size) return\n\n // expand the result to include array values\n const collect = new Set<string>()\n for (const prop of props) {\n if (Array.isArray(prop)) {\n for (const p of prop) {\n collect.add(p ? jsonFieldToString(p) : '')\n }\n } else {\n collect.add(jsonFieldToString(prop))\n }\n }\n\n return [...collect]\n}\n\n// decorator style of function that will filter `ParserState` results\n// based on a provided `comparator` function\nexport const filterAttributes = (\n state: ParserState,\n comparator: ComparatorFn | undefined,\n value: string,\n propertyName: string,\n insensitive: boolean,\n prefixProperties: string[] = [],\n): ParserState => {\n const check = (attr: JSONField) =>\n comparator?.(\n insensitive ?\n jsonFieldToString(attr).toLowerCase()\n : jsonFieldToString(attr),\n insensitive ? value.toLowerCase() : value,\n )\n const deleteNode = (node: NodeLike) => {\n for (const edge of node.edgesIn) {\n state.partial.edges.delete(edge)\n }\n state.partial.nodes.delete(node)\n }\n\n for (const node of state.partial.nodes) {\n const prefixes =\n prefixProperties.length ? prefixProperties : [propertyName]\n const attrs = getManifestPropertyValues(\n node,\n prefixes,\n propertyName,\n )\n\n // if no attribute value was found, that means the attribute won't match\n if (!attrs?.length) {\n deleteNode(node)\n continue\n }\n\n // if the node attribute value won't match, then remove the node\n if (comparator && !attrs.some(check)) {\n deleteNode(node)\n }\n }\n\n removeDanglingEdges(state)\n return state\n}\n\n// ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors\nconst attributeSelectors: Record<string, ComparatorFn> = {\n '=': (attr: string, value = '') => attr === value,\n '^=': (attr: string, value = '') => attr.startsWith(value),\n '$=': (attr: string, value = '') => attr.endsWith(value),\n '~=': (attr: string, value = '') =>\n new Set<string>(attr.match(/\\w+/g)).has(value),\n '*=': (attr: string, value = '') => attr.includes(value),\n '|=': (attr: string, value = '') =>\n attr === value || attr.startsWith(`${value}-`),\n undefined: (attr: string) => !!attr,\n}\nexport const attributeSelectorsMap = new Map<string, ComparatorFn>(\n Object.entries(attributeSelectors),\n)\n\n/**\n * Parse attributes selectors, e.g: `[name]`, `[name=value]`, etc\n */\nexport const attribute = async (\n state: ParserState,\n): Promise<ParserState> => {\n await state.cancellable()\n\n const curr = asAttributeNode(state.current)\n const operatorFn = attributeSelectorsMap.get(String(curr.operator))\n if (!operatorFn) {\n if (state.loose) {\n return state\n }\n\n throw error(`Unsupported attribute operator: ${curr.operator}`, {\n found: state.current,\n })\n }\n\n const value = curr.value || ''\n const propertyName = curr.attribute\n const insensitive = !!curr.insensitive\n\n // Increment the commonCounter for specificity\n state.specificity.commonCounter += 1\n\n return filterAttributes(\n state,\n operatorFn,\n value,\n propertyName,\n insensitive,\n )\n}\n"]}
|
package/dist/esm/combinator.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combinator.d.ts","sourceRoot":"","sources":["../../src/combinator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,YAAY,CAAA;AA6GvD;;GAEG;AACH,eAAO,MAAM,UAAU,UAAiB,WAAW,yBAgBlD,CAAA"}
|
package/dist/esm/combinator.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { asCombinatorNode } from '@vltpkg/dss-parser';
|
|
2
|
-
import { error } from '@vltpkg/error-cause';
|
|
3
|
-
/**
|
|
4
|
-
* Returns a new set of nodes, containing all direct dependencies
|
|
5
|
-
* of the current list of nodes used.
|
|
6
|
-
*
|
|
7
|
-
* ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Child_combinator
|
|
8
|
-
*/
|
|
9
|
-
const childCombinator = async (state) => {
|
|
10
|
-
const traverse = new Set(state.partial.nodes);
|
|
11
|
-
state.partial.edges.clear();
|
|
12
|
-
state.partial.nodes.clear();
|
|
13
|
-
// visit direct children of the current list of nodes
|
|
14
|
-
// collecting refs to these children and the edges that
|
|
15
|
-
// connected them.
|
|
16
|
-
for (const node of traverse) {
|
|
17
|
-
for (const edge of node.edgesOut.values()) {
|
|
18
|
-
if (edge.to) {
|
|
19
|
-
state.partial.edges.add(edge);
|
|
20
|
-
state.partial.nodes.add(edge.to);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return state;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Returns a new set of nodes, containing nodes that are also children
|
|
28
|
-
* of all parent nodes to the current list of nodes used.
|
|
29
|
-
*
|
|
30
|
-
* Note: The subsequent-sibling comparator has a behavior that is
|
|
31
|
-
* somehow approximative of that of its css counterpart, given that
|
|
32
|
-
* in the context of dependency graphs the order of appearance is
|
|
33
|
-
* not necessarily controlled by the end user. The approach for
|
|
34
|
-
* this comparator is to match all siblings of a node.
|
|
35
|
-
*
|
|
36
|
-
* ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-sibling_combinator
|
|
37
|
-
*/
|
|
38
|
-
const subsequentSiblingCombinator = async (state) => {
|
|
39
|
-
const traverse = new Set(state.partial.nodes);
|
|
40
|
-
state.partial.edges.clear();
|
|
41
|
-
state.partial.nodes.clear();
|
|
42
|
-
// visits direct parents of the current list of node and then
|
|
43
|
-
// visit their children, collecting refs to all children and edges
|
|
44
|
-
// that are not in the original list of nodes.
|
|
45
|
-
for (const node of traverse) {
|
|
46
|
-
for (const edge of node.edgesIn) {
|
|
47
|
-
const parents = edge.from.edgesOut.values();
|
|
48
|
-
for (const edge of parents) {
|
|
49
|
-
if (edge.to && edge.to !== node) {
|
|
50
|
-
state.partial.edges.add(edge);
|
|
51
|
-
state.partial.nodes.add(edge.to);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return state;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Returns a new set of nodes containing all nodes that are descendents
|
|
60
|
-
* to items in the current list of nodes.
|
|
61
|
-
*
|
|
62
|
-
* ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator
|
|
63
|
-
*/
|
|
64
|
-
const descendentCombinator = async (state) => {
|
|
65
|
-
// spaces between tags selectors are a noop
|
|
66
|
-
if (state.prev?.type === 'tag' || state.next?.type === 'tag') {
|
|
67
|
-
return state;
|
|
68
|
-
}
|
|
69
|
-
const traverse = new Set(state.partial.nodes);
|
|
70
|
-
state.partial.edges.clear();
|
|
71
|
-
state.partial.nodes.clear();
|
|
72
|
-
// breadth-first traversal of the graph, starting from the current
|
|
73
|
-
// list of nodes, collecting all nodes and edges along the way
|
|
74
|
-
for (const node of traverse) {
|
|
75
|
-
const children = new Set();
|
|
76
|
-
for (const edge of node.edgesOut.values()) {
|
|
77
|
-
if (edge.to) {
|
|
78
|
-
children.add(edge.to);
|
|
79
|
-
state.partial.edges.add(edge);
|
|
80
|
-
state.partial.nodes.add(edge.to);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
for (const child of children) {
|
|
84
|
-
traverse.add(child);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return state;
|
|
88
|
-
};
|
|
89
|
-
const combinatorSelectors = {
|
|
90
|
-
'>': childCombinator,
|
|
91
|
-
'~': subsequentSiblingCombinator,
|
|
92
|
-
' ': descendentCombinator,
|
|
93
|
-
};
|
|
94
|
-
const combinatorSelectorsMap = new Map(Object.entries(combinatorSelectors));
|
|
95
|
-
/**
|
|
96
|
-
* Parse css-style combinators, e.g: `>`, `~` and ` `
|
|
97
|
-
*/
|
|
98
|
-
export const combinator = async (state) => {
|
|
99
|
-
await state.cancellable();
|
|
100
|
-
const curr = asCombinatorNode(state.current);
|
|
101
|
-
const parserFn = curr.value && combinatorSelectorsMap.get(curr.value);
|
|
102
|
-
if (!parserFn) {
|
|
103
|
-
if (state.loose) {
|
|
104
|
-
return state;
|
|
105
|
-
}
|
|
106
|
-
throw error(`Unsupported combinator: ${state.current.value}`, {
|
|
107
|
-
found: state.current,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
return parserFn(state);
|
|
111
|
-
};
|
|
112
|
-
//# sourceMappingURL=combinator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combinator.js","sourceRoot":"","sources":["../../src/combinator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAI3C;;;;;GAKG;AACH,MAAM,eAAe,GAAG,KAAK,EAAE,KAAkB,EAAE,EAAE;IACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IAC3B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;IAE3B,qDAAqD;IACrD,uDAAuD;IACvD,kBAAkB;IAClB,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;gBACZ,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;gBAC7B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,2BAA2B,GAAG,KAAK,EAAE,KAAkB,EAAE,EAAE;IAC/D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAC7C,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CA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AAE,EAAE;YAC5D,KAAK,EAAE,KAAK,CAAC,OAAO;SACrB,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC,CAAA","sourcesContent":["import { asCombinatorNode } from '@vltpkg/dss-parser'\nimport { error } from '@vltpkg/error-cause'\nimport type { EdgeLike, NodeLike } from '@vltpkg/types'\nimport type { ParserState, ParserFn } from './types.ts'\n\n/**\n * Returns a new set of nodes, containing all direct dependencies\n * of the current list of nodes used.\n *\n * ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Child_combinator\n */\nconst childCombinator = async (state: ParserState) => {\n const traverse = new Set(state.partial.nodes)\n state.partial.edges.clear()\n state.partial.nodes.clear()\n\n // visit direct children of the current list of nodes\n // collecting refs to these children and the edges that\n // connected them.\n for (const node of traverse) {\n for (const edge of node.edgesOut.values()) {\n if (edge.to) {\n state.partial.edges.add(edge)\n state.partial.nodes.add(edge.to)\n }\n }\n }\n\n return state\n}\n\n/**\n * Returns a new set of nodes, containing nodes that are also children\n * of all parent nodes to the current list of nodes used.\n *\n * Note: The subsequent-sibling comparator has a behavior that is\n * somehow approximative of that of its css counterpart, given that\n * in the context of dependency graphs the order of appearance is\n * not necessarily controlled by the end user. The approach for\n * this comparator is to match all siblings of a node.\n *\n * ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Subsequent-sibling_combinator\n */\nconst subsequentSiblingCombinator = async (state: ParserState) => {\n const traverse = new Set(state.partial.nodes)\n state.partial.edges.clear()\n state.partial.nodes.clear()\n\n // visits direct parents of the current list of node and then\n // visit their children, collecting refs to all children and edges\n // that are not in the original list of nodes.\n for (const node of traverse) {\n for (const edge of node.edgesIn) {\n const parents: IterableIterator<EdgeLike> =\n edge.from.edgesOut.values()\n for (const edge of parents) {\n if (edge.to && edge.to !== node) {\n state.partial.edges.add(edge)\n state.partial.nodes.add(edge.to)\n }\n }\n }\n }\n\n return state\n}\n\n/**\n * Returns a new set of nodes containing all nodes that are descendents\n * to items in the current list of nodes.\n *\n * ref: https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator\n */\nconst descendentCombinator = async (state: ParserState) => {\n // spaces between tags selectors are a noop\n if (state.prev?.type === 'tag' || state.next?.type === 'tag') {\n return state\n }\n\n const traverse = new Set<NodeLike>(state.partial.nodes)\n state.partial.edges.clear()\n state.partial.nodes.clear()\n\n // breadth-first traversal of the graph, starting from the current\n // list of nodes, collecting all nodes and edges along the way\n for (const node of traverse) {\n const children = new Set<NodeLike>()\n for (const edge of node.edgesOut.values()) {\n if (edge.to) {\n children.add(edge.to)\n state.partial.edges.add(edge)\n state.partial.nodes.add(edge.to)\n }\n }\n for (const child of children) {\n traverse.add(child)\n }\n }\n\n return state\n}\n\nconst combinatorSelectors = {\n '>': childCombinator,\n '~': subsequentSiblingCombinator,\n ' ': descendentCombinator,\n}\n\nconst combinatorSelectorsMap = new Map<string, ParserFn>(\n Object.entries(combinatorSelectors),\n)\n\n/**\n * Parse css-style combinators, e.g: `>`, `~` and ` `\n */\nexport const combinator = async (state: ParserState) => {\n await state.cancellable()\n\n const curr = asCombinatorNode(state.current)\n const parserFn =\n curr.value && combinatorSelectorsMap.get(curr.value)\n if (!parserFn) {\n if (state.loose) {\n return state\n }\n\n throw error(`Unsupported combinator: ${state.current.value}`, {\n found: state.current,\n })\n }\n return parserFn(state)\n}\n"]}
|
package/dist/esm/id.d.ts
DELETED
package/dist/esm/id.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,EAAE,UACN,WAAW,KACjB,OAAO,CAAC,WAAW,CAoCrB,CAAA"}
|
package/dist/esm/id.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { asIdentifierNode } from '@vltpkg/dss-parser';
|
|
2
|
-
import { error } from '@vltpkg/error-cause';
|
|
3
|
-
/**
|
|
4
|
-
* Parse ids, e.g: `#foo`
|
|
5
|
-
*/
|
|
6
|
-
export const id = async (state) => {
|
|
7
|
-
const { value } = asIdentifierNode(state.current);
|
|
8
|
-
/* c8 ignore start - should not be possible */
|
|
9
|
-
if (!value) {
|
|
10
|
-
throw error('Missing identifier name');
|
|
11
|
-
}
|
|
12
|
-
/* c8 ignore stop */
|
|
13
|
-
// Filter out any edges and their linked
|
|
14
|
-
// nodes if they don't match the id value
|
|
15
|
-
for (const edge of state.partial.edges) {
|
|
16
|
-
if (edge.name !== value) {
|
|
17
|
-
state.partial.edges.delete(edge);
|
|
18
|
-
if (edge.to) {
|
|
19
|
-
state.partial.nodes.delete(edge.to);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
// Filter out importer nodes, this extra step is needed
|
|
24
|
-
// to filter out nodes that have no edges linking to them
|
|
25
|
-
for (const node of state.partial.nodes) {
|
|
26
|
-
if (node.edgesIn.size === 0 &&
|
|
27
|
-
node.name !== value &&
|
|
28
|
-
state.partial.nodes.has(node)) {
|
|
29
|
-
state.partial.nodes.delete(node);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
// Increment the idCounter for specificity
|
|
33
|
-
state.specificity.idCounter += 1;
|
|
34
|
-
return state;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=id.js.map
|
package/dist/esm/id.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAG3C;;GAEG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,KAAK,EACrB,KAAkB,EACI,EAAE;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAEjD,8CAA8C;IAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAA;IACxC,CAAC;IACD,oBAAoB;IAEpB,wCAAwC;IACxC,yCAAyC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACxB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;gBACZ,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACrC,CAAC;QACH,CAAC;IACH,CAAC;IAED,uDAAuD;IACvD,yDAAyD;IACzD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACvC,IACE,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;YACvB,IAAI,CAAC,IAAI,KAAK,KAAK;YACnB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAC7B,CAAC;YACD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAClC,CAAC;IACH,CAAC;IAED,0CAA0C;IAC1C,KAAK,CAAC,WAAW,CAAC,SAAS,IAAI,CAAC,CAAA;IAEhC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { asIdentifierNode } from '@vltpkg/dss-parser'\nimport { error } from '@vltpkg/error-cause'\nimport type { ParserState } from './types.ts'\n\n/**\n * Parse ids, e.g: `#foo`\n */\nexport const id = async (\n state: ParserState,\n): Promise<ParserState> => {\n const { value } = asIdentifierNode(state.current)\n\n /* c8 ignore start - should not be possible */\n if (!value) {\n throw error('Missing identifier name')\n }\n /* c8 ignore stop */\n\n // Filter out any edges and their linked\n // nodes if they don't match the id value\n for (const edge of state.partial.edges) {\n if (edge.name !== value) {\n state.partial.edges.delete(edge)\n if (edge.to) {\n state.partial.nodes.delete(edge.to)\n }\n }\n }\n\n // Filter out importer nodes, this extra step is needed\n // to filter out nodes that have no edges linking to them\n for (const node of state.partial.nodes) {\n if (\n node.edgesIn.size === 0 &&\n node.name !== value &&\n state.partial.nodes.has(node)\n ) {\n state.partial.nodes.delete(node)\n }\n }\n\n // Increment the idCounter for specificity\n state.specificity.idCounter += 1\n\n return state\n}\n"]}
|
package/dist/esm/index.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { EdgeLike, NodeLike } from '@vltpkg/types';
|
|
2
|
-
import type { SecurityArchiveLike } from '@vltpkg/security-archive';
|
|
3
|
-
import type { HostContextsMap, ParsedSelectorToken, ParserState, QueryResponse } from './types.ts';
|
|
4
|
-
import type { DepID } from '@vltpkg/dep-id';
|
|
5
|
-
export * from './types.ts';
|
|
6
|
-
export type SearchOptions = {
|
|
7
|
-
signal: AbortSignal;
|
|
8
|
-
scopeIDs?: DepID[];
|
|
9
|
-
};
|
|
10
|
-
export declare const walk: (state: ParserState) => Promise<ParserState>;
|
|
11
|
-
export type QueryOptions = {
|
|
12
|
-
edges: Set<EdgeLike>;
|
|
13
|
-
nodes: Set<NodeLike>;
|
|
14
|
-
importers: Set<NodeLike>;
|
|
15
|
-
retries?: number;
|
|
16
|
-
securityArchive: SecurityArchiveLike | undefined;
|
|
17
|
-
hostContexts?: HostContextsMap;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* The Query class is used to search the graph for nodes and edges
|
|
21
|
-
* using the Dependency Selector Syntax (DSS).
|
|
22
|
-
*/
|
|
23
|
-
export declare class Query {
|
|
24
|
-
#private;
|
|
25
|
-
/**
|
|
26
|
-
* Helper method to determine if a given query string is using any of
|
|
27
|
-
* the known security selectors. This is useful so that operations can
|
|
28
|
-
* skip hydrating the security archive if it's not needed.
|
|
29
|
-
*/
|
|
30
|
-
static hasSecuritySelectors(query: string): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Sorts an array of QueryResponse objects by specificity. Objects with
|
|
33
|
-
* higher idCounter values come first, if idCounter values are equal,
|
|
34
|
-
* then objects with higher commonCounter values come first. Otherwise,
|
|
35
|
-
* the original order is preserved.
|
|
36
|
-
*/
|
|
37
|
-
static specificitySort(responses: QueryResponse[]): QueryResponse[];
|
|
38
|
-
constructor({ edges, nodes, importers, retries, securityArchive, hostContexts, }: QueryOptions);
|
|
39
|
-
/**
|
|
40
|
-
* Search the graph for nodes and edges that match the given query.
|
|
41
|
-
*/
|
|
42
|
-
search(query: string, { signal, scopeIDs, }: SearchOptions): Promise<QueryResponse>;
|
|
43
|
-
/**
|
|
44
|
-
* Parses a query string in order to retrieve an array of tokens.
|
|
45
|
-
*/
|
|
46
|
-
static getQueryTokens(query: string): ParsedSelectorToken[];
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAKnE,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,WAAW,EAEX,aAAa,EAGd,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAE3C,cAAc,YAAY,CAAA;AAE1B,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAA;CACnB,CAAA;AA+CD,eAA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