@vltpkg/dep-id 1.0.7 → 1.0.9
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/browser.js +10 -7
- package/package.json +4 -4
package/dist/browser.js
CHANGED
|
@@ -225,19 +225,21 @@ export const splitDepID = (id) => {
|
|
|
225
225
|
seenSplitDepIDs.set(id, res);
|
|
226
226
|
return res;
|
|
227
227
|
};
|
|
228
|
+
const seenBaseDepIDs = new Map();
|
|
228
229
|
/**
|
|
229
230
|
* Retrieves the base {@link DepID} for a given depID,
|
|
230
231
|
* ignoring any extra information that may be present.
|
|
231
232
|
*/
|
|
232
233
|
export const baseDepID = (id) => {
|
|
234
|
+
const seen = seenBaseDepIDs.get(id);
|
|
235
|
+
if (seen)
|
|
236
|
+
return seen;
|
|
233
237
|
const [type, first, second] = splitDepID(id);
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return joinDepIDTuple([type, first]);
|
|
240
|
-
}
|
|
238
|
+
const res = type === 'git' || type === 'registry' ?
|
|
239
|
+
joinDepIDTuple([type, first, second])
|
|
240
|
+
: joinDepIDTuple([type, first]);
|
|
241
|
+
seenBaseDepIDs.set(id, res);
|
|
242
|
+
return res;
|
|
241
243
|
};
|
|
242
244
|
const seenHydrated = new Map();
|
|
243
245
|
/**
|
|
@@ -515,4 +517,5 @@ export const resetCaches = () => {
|
|
|
515
517
|
seenHydratedTuples.clear();
|
|
516
518
|
seenSplitDepIDs.clear();
|
|
517
519
|
seenTuples.clear();
|
|
520
|
+
seenBaseDepIDs.clear();
|
|
518
521
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vltpkg/dep-id",
|
|
3
3
|
"description": "create and hydrate dependency IDs",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/vltpkg/vltpkg.git",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"url": "http://vlt.sh"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@vltpkg/error-cause": "1.0.
|
|
17
|
-
"@vltpkg/spec": "1.0.
|
|
18
|
-
"@vltpkg/types": "1.0.
|
|
16
|
+
"@vltpkg/error-cause": "1.0.9",
|
|
17
|
+
"@vltpkg/spec": "1.0.9",
|
|
18
|
+
"@vltpkg/types": "1.0.9"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@eslint/js": "^9.39.1",
|