@arcjet/stable-hash 1.0.0 → 1.1.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/edge-light.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./hasher.js";
2
- export declare const hash: (...hashers: import("./hasher.js").FieldHasher[]) => Promise<string>;
2
+ export declare const hash: (...hashers: ReadonlyArray<import("./hasher.js").FieldHasher>) => Promise<string>;
package/edge-light.js CHANGED
@@ -1,10 +1,6 @@
1
1
  import { makeHasher } from './hasher.js';
2
2
  export { bool, string, stringSliceOrdered, uint32 } from './hasher.js';
3
3
 
4
- // @ts-ignore: this value exists in Edge Light, as it implements the DOM type for it.
5
- // See <https://vercel.com/docs/functions/runtimes/edge#crypto-apis>.
6
- // This can be verified by adding `/// <reference lib="dom" />` above.
7
- // But we don’t want to load the entire DOM types or edge-light-specific types.
8
4
  const hash = makeHasher(crypto.subtle);
9
5
 
10
6
  export { hash, makeHasher };
package/hasher.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare function string(key: string, value: string): FieldHasher;
62
62
  * @returns
63
63
  * Hasher.
64
64
  */
65
- export declare function stringSliceOrdered(key: string, values: string[]): FieldHasher;
65
+ export declare function stringSliceOrdered(key: string, values: ReadonlyArray<string>): FieldHasher;
66
66
  /**
67
67
  * Create a hasher.
68
68
  *
@@ -71,5 +71,5 @@ export declare function stringSliceOrdered(key: string, values: string[]): Field
71
71
  * @returns
72
72
  * Hasher.
73
73
  */
74
- export declare function makeHasher(subtle: SubtleCryptoLike): (...hashers: FieldHasher[]) => Promise<string>;
74
+ export declare function makeHasher(subtle: SubtleCryptoLike): (...hashers: ReadonlyArray<FieldHasher>) => Promise<string>;
75
75
  export {};
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./hasher.js";
2
- export declare const hash: (...hashers: import("./hasher.js").FieldHasher[]) => Promise<string>;
2
+ export declare const hash: (...hashers: ReadonlyArray<import("./hasher.js").FieldHasher>) => Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcjet/stable-hash",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Arcjet stable hashing utility",
5
5
  "keywords": [
6
6
  "arcjet",
@@ -48,17 +48,16 @@
48
48
  "scripts": {
49
49
  "build": "rollup --config rollup.config.js",
50
50
  "lint": "eslint .",
51
- "prepublishOnly": "npm run build",
52
51
  "test-api": "node --test -- test/*.test.js",
53
52
  "test-coverage": "node --experimental-test-coverage --test -- test/*.test.js",
54
53
  "test": "npm run build && npm run lint && npm run test-coverage"
55
54
  },
56
55
  "dependencies": {},
57
56
  "devDependencies": {
58
- "@arcjet/eslint-config": "1.0.0",
59
- "@arcjet/rollup-config": "1.0.0",
60
- "@rollup/wasm-node": "4.55.1",
61
- "@types/node": "25.0.8",
57
+ "@arcjet/eslint-config": "1.1.0",
58
+ "@arcjet/rollup-config": "1.1.0",
59
+ "@rollup/wasm-node": "4.57.0",
60
+ "@types/node": "25.1.0",
62
61
  "eslint": "9.39.2",
63
62
  "typescript": "5.9.3"
64
63
  },
package/workerd.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./hasher.js";
2
- export declare const hash: (...hashers: import("./hasher.js").FieldHasher[]) => Promise<string>;
2
+ export declare const hash: (...hashers: ReadonlyArray<import("./hasher.js").FieldHasher>) => Promise<string>;
package/workerd.js CHANGED
@@ -1,10 +1,6 @@
1
1
  import { makeHasher } from './hasher.js';
2
2
  export { bool, string, stringSliceOrdered, uint32 } from './hasher.js';
3
3
 
4
- // @ts-ignore: this value exists in Workerd, as it implements the DOM type for it.
5
- // See <https://developers.cloudflare.com/workers/runtime-apis/web-crypto/>.
6
- // This can be verified by adding `/// <reference lib="dom" />` above.
7
- // But we don’t want to load the entire DOM types or workerd-specific types.
8
4
  const hash = makeHasher(crypto.subtle);
9
5
 
10
6
  export { hash, makeHasher };