@vltpkg/types 1.1.1 → 1.2.0

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/index.d.ts CHANGED
@@ -382,6 +382,11 @@ export declare const integrityRE: RegExp;
382
382
  export declare const isIntegrity: (i: unknown) => i is Integrity;
383
383
  export declare const asIntegrity: (i: unknown) => Integrity;
384
384
  export declare const assertIntegrity: (i: unknown) => asserts i is Integrity;
385
+ /**
386
+ * Hex form of a sha512 integrity digest, or undefined if not a valid
387
+ * sha512 integrity. Names tarball cache and global store entries.
388
+ */
389
+ export declare const integrityHex: (i: unknown) => string | undefined;
385
390
  export declare const keyIDRE: RegExp;
386
391
  export declare const isKeyID: (k: unknown) => k is KeyID;
387
392
  export declare const asKeyID: (k: unknown) => KeyID;
package/dist/index.js CHANGED
@@ -537,6 +537,13 @@ export const asIntegrity = (i) => {
537
537
  export const assertIntegrity = i => {
538
538
  asIntegrity(i);
539
539
  };
540
+ /**
541
+ * Hex form of a sha512 integrity digest, or undefined if not a valid
542
+ * sha512 integrity. Names tarball cache and global store entries.
543
+ */
544
+ export const integrityHex = (i) => isIntegrity(i) ?
545
+ Buffer.from(i.slice(7), 'base64').toString('hex')
546
+ : undefined;
540
547
  export const keyIDRE = /^SHA256:[a-zA-Z0-9/+]{43}$/;
541
548
  export const isKeyID = (k) => typeof k === 'string' && keyIDRE.test(k);
542
549
  export const asKeyID = (k) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/types",
3
3
  "description": "definitions for some of vlt's core types",
4
- "version": "1.1.1",
4
+ "version": "1.2.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,17 +13,17 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/dep-id": "1.1.1",
17
- "@vltpkg/error-cause": "1.1.1",
18
- "@vltpkg/semver": "1.1.1",
19
- "@vltpkg/spec": "1.1.1"
16
+ "@vltpkg/dep-id": "1.2.0",
17
+ "@vltpkg/error-cause": "1.2.0",
18
+ "@vltpkg/semver": "1.2.0",
19
+ "@vltpkg/spec": "1.2.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@eslint/js": "^9.39.1",
23
23
  "@types/node": "^22.19.2",
24
24
  "eslint": "^9.39.1",
25
25
  "prettier": "^3.7.4",
26
- "tap": "^21.5.0",
26
+ "tap": "^21.8.0",
27
27
  "typedoc": "~0.27.9",
28
28
  "typescript": "5.7.3",
29
29
  "typescript-eslint": "^8.49.0"