@vltpkg/query 1.6.0 → 1.6.2

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.
Files changed (2) hide show
  1. package/dist/id.js +12 -5
  2. package/package.json +9 -9
package/dist/id.js CHANGED
@@ -10,16 +10,23 @@ export const id = async (state) => {
10
10
  throw error('Missing identifier name');
11
11
  }
12
12
  /* c8 ignore stop */
13
- // Filter out any edges and their linked
14
- // nodes if they don't match the id value
13
+ // Filter out edges that don't match the id value and their
14
+ // nodes, unless a matching edge still links to them (aliases)
15
+ const unlinked = new Set();
15
16
  for (const edge of state.partial.edges) {
16
17
  if (edge.name !== value) {
17
18
  state.partial.edges.delete(edge);
18
- if (edge.to) {
19
- state.partial.nodes.delete(edge.to);
20
- }
19
+ if (edge.to)
20
+ unlinked.add(edge.to);
21
21
  }
22
22
  }
23
+ for (const edge of state.partial.edges) {
24
+ if (edge.to)
25
+ unlinked.delete(edge.to);
26
+ }
27
+ for (const node of unlinked) {
28
+ state.partial.nodes.delete(node);
29
+ }
23
30
  // Filter out importer nodes, this extra step is needed
24
31
  // to filter out nodes that have no edges linking to them
25
32
  for (const node of state.partial.nodes) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/query",
3
3
  "description": "Query syntax parser that retrieves items from a graph",
4
- "version": "1.6.0",
4
+ "version": "1.6.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,13 +13,13 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/dep-id": "1.6.0",
17
- "@vltpkg/dss-parser": "1.6.0",
18
- "@vltpkg/error-cause": "1.6.0",
19
- "@vltpkg/security-archive": "1.6.0",
20
- "@vltpkg/semver": "1.6.0",
21
- "@vltpkg/types": "1.6.0",
22
- "@vltpkg/user-agent": "1.6.0",
16
+ "@vltpkg/dep-id": "1.6.2",
17
+ "@vltpkg/dss-parser": "1.6.2",
18
+ "@vltpkg/error-cause": "1.6.2",
19
+ "@vltpkg/security-archive": "1.6.2",
20
+ "@vltpkg/semver": "1.6.2",
21
+ "@vltpkg/types": "1.6.2",
22
+ "@vltpkg/user-agent": "1.6.2",
23
23
  "minimatch": "^10.1.1",
24
24
  "p-retry": "^7.1.1",
25
25
  "postcss-selector-parser": "^7.1.1"
@@ -27,7 +27,7 @@
27
27
  "devDependencies": {
28
28
  "@eslint/js": "^9.39.1",
29
29
  "@types/node": "^22.19.2",
30
- "@vltpkg/spec": "1.6.0",
30
+ "@vltpkg/spec": "1.6.2",
31
31
  "eslint": "^9.39.1",
32
32
  "prettier": "^3.7.4",
33
33
  "tap": "^21.8.0",