@fuzdev/fuz_util 0.53.3 → 0.54.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.
@@ -143,7 +143,7 @@ export const deep_equal = (a, b) => {
143
143
  return false;
144
144
  for (let i = 0; i < a_keys_length; i++) {
145
145
  const key = a_keys[i];
146
- if (!(key in b))
146
+ if (!Object.hasOwn(b, key))
147
147
  return false;
148
148
  if (!deep_equal(a[key], b[key]))
149
149
  return false;
@@ -7,6 +7,7 @@
7
7
  *
8
8
  * @module
9
9
  */
10
+ import { z } from 'zod';
10
11
  /**
11
12
  * Resolves when the BLAKE3 WASM module is initialized and ready.
12
13
  * Initialization starts eagerly on import. Idempotent — safe to await multiple times.
@@ -20,4 +21,7 @@ export declare const blake3_ready: Promise<void>;
20
21
  * @returns 64-character hexadecimal hash string (32 bytes).
21
22
  */
22
23
  export declare const hash_blake3: (data: BufferSource | string) => string;
24
+ /** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
25
+ export declare const Blake3Hash: z.ZodString;
26
+ export type Blake3Hash = z.infer<typeof Blake3Hash>;
23
27
  //# sourceMappingURL=hash_blake3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hash_blake3.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/hash_blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAS,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,GAAG,MAAM,KAAG,MAAsC,CAAC"}
1
+ {"version":3,"file":"hash_blake3.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/hash_blake3.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAMtB;;;;GAIG;AACH,eAAO,MAAM,YAAY,eAAS,CAAC;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,YAAY,GAAG,MAAM,KAAG,MAAsC,CAAC;AAEjG,uFAAuF;AACvF,eAAO,MAAM,UAAU,aAEuD,CAAC;AAC/E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -7,6 +7,7 @@
7
7
  *
8
8
  * @module
9
9
  */
10
+ import { z } from 'zod';
10
11
  import { hash, init } from '@fuzdev/blake3_wasm';
11
12
  import { to_hex } from './hex.js';
12
13
  import { to_bytes } from './bytes.js';
@@ -23,3 +24,7 @@ export const blake3_ready = init();
23
24
  * @returns 64-character hexadecimal hash string (32 bytes).
24
25
  */
25
26
  export const hash_blake3 = (data) => to_hex(hash(to_bytes(data)));
27
+ /** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
28
+ export const Blake3Hash = z
29
+ .string()
30
+ .regex(/^[0-9a-f]{64}$/, 'Expected a 64-character lowercase hex blake3 hash');
@@ -34,7 +34,7 @@ export declare const PackageJson: z.ZodObject<{
34
34
  version: z.ZodString;
35
35
  private: z.ZodOptional<z.ZodBoolean>;
36
36
  description: z.ZodOptional<z.ZodString>;
37
- motto: z.ZodOptional<z.ZodString>;
37
+ tagline: z.ZodOptional<z.ZodString>;
38
38
  glyph: z.ZodOptional<z.ZodString>;
39
39
  logo: z.ZodOptional<z.ZodString>;
40
40
  logo_alt: z.ZodOptional<z.ZodString>;
@@ -55,26 +55,26 @@ export const PackageJson = z.looseObject({
55
55
  .meta({ description: 'disallow publishing to the configured registry' })
56
56
  .optional(),
57
57
  description: z.string().optional(),
58
- motto: z
58
+ tagline: z
59
59
  .string()
60
- .meta({ description: "a Gro extension that's a short phrase that represents this project" })
60
+ .meta({ description: "a Fuz extension that's a short phrase that represents this project" })
61
61
  .optional(),
62
62
  glyph: z
63
63
  .string()
64
64
  .meta({
65
- description: "a Gro extension that's a single unicode character that represents this project",
65
+ description: "a Fuz extension that's a single unicode character that represents this project",
66
66
  })
67
67
  .refine((v) => count_graphemes(v) === 1, 'must be a single unicode character')
68
68
  .optional(),
69
69
  logo: z
70
70
  .string()
71
71
  .meta({
72
- description: "a Gro extension that's a link relative to the `homepage` to an image that represents this project",
72
+ description: "a Fuz extension that's a link relative to the `homepage` to an image that represents this project",
73
73
  })
74
74
  .optional(),
75
75
  logo_alt: z
76
76
  .string()
77
- .meta({ description: "a Gro extension that's the alt text for the `logo`" })
77
+ .meta({ description: "a Fuz extension that's the alt text for the `logo`" })
78
78
  .optional(),
79
79
  license: z.string().optional(),
80
80
  scripts: z.record(z.string(), z.string()).optional(),
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@fuzdev/fuz_util",
3
- "version": "0.53.3",
3
+ "version": "0.54.0",
4
4
  "description": "utility belt for JS",
5
5
  "glyph": "🦕",
6
6
  "logo": "logo.svg",
7
7
  "logo_alt": "a green sauropod wearing a brown utility belt",
8
- "motto": "ancient not extinct",
8
+ "tagline": "ancient not extinct",
9
9
  "license": "MIT",
10
10
  "homepage": "https://util.fuz.dev/",
11
11
  "author": {
@@ -78,12 +78,13 @@
78
78
  "@fuzdev/blake3_wasm": "^0.1.0",
79
79
  "@fuzdev/fuz_code": "^0.45.1",
80
80
  "@fuzdev/fuz_css": "^0.55.0",
81
- "@fuzdev/fuz_ui": "^0.185.2",
81
+ "@fuzdev/fuz_ui": "^0.188.0",
82
82
  "@fuzdev/gro": "^0.197.0",
83
83
  "@jridgewell/trace-mapping": "^0.3.31",
84
- "@ryanatkn/eslint-config": "^0.10.0",
84
+ "@ryanatkn/eslint-config": "^0.10.1",
85
+ "@sveltejs/acorn-typescript": "^1.0.9",
85
86
  "@sveltejs/adapter-static": "^3.0.10",
86
- "@sveltejs/kit": "^2.50.1",
87
+ "@sveltejs/kit": "^2.54.0",
87
88
  "@sveltejs/package": "^2.5.7",
88
89
  "@sveltejs/vite-plugin-svelte": "^6.2.4",
89
90
  "@types/estree": "^1.0.8",
@@ -97,13 +98,14 @@
97
98
  "magic-string": "^0.30.21",
98
99
  "prettier": "^3.7.4",
99
100
  "prettier-plugin-svelte": "^3.4.1",
100
- "svelte": "^5.49.1",
101
+ "svelte": "^5.53.10",
101
102
  "svelte-check": "^4.3.6",
102
103
  "svelte2tsx": "^0.7.47",
103
104
  "tslib": "^2.8.1",
104
105
  "typescript": "^5.9.3",
105
106
  "typescript-eslint": "^8.48.1",
106
- "vitest": "^4.0.15",
107
+ "vite": "^7.3.1",
108
+ "vitest": "^4.0.18",
107
109
  "zimmerframe": "^1.1.4",
108
110
  "zod": "^4.3.6"
109
111
  },
@@ -147,7 +147,7 @@ export const deep_equal = (a: unknown, b: unknown): boolean => {
147
147
  if (a_keys_length !== Object.keys(b!).length) return false;
148
148
  for (let i = 0; i < a_keys_length; i++) {
149
149
  const key = a_keys[i]!;
150
- if (!(key in (b as any))) return false;
150
+ if (!Object.hasOwn(b as object, key)) return false;
151
151
  if (!deep_equal((a as any)[key], (b as any)[key])) return false;
152
152
  }
153
153
 
@@ -8,6 +8,7 @@
8
8
  * @module
9
9
  */
10
10
 
11
+ import {z} from 'zod';
11
12
  import {hash, init} from '@fuzdev/blake3_wasm';
12
13
 
13
14
  import {to_hex} from './hex.js';
@@ -27,3 +28,9 @@ export const blake3_ready = init();
27
28
  * @returns 64-character hexadecimal hash string (32 bytes).
28
29
  */
29
30
  export const hash_blake3 = (data: BufferSource | string): string => to_hex(hash(to_bytes(data)));
31
+
32
+ /** Zod schema for a BLAKE3 hex hash — 64 lowercase hex characters (256-bit output). */
33
+ export const Blake3Hash = z
34
+ .string()
35
+ .regex(/^[0-9a-f]{64}$/, 'Expected a 64-character lowercase hex blake3 hash');
36
+ export type Blake3Hash = z.infer<typeof Blake3Hash>;
@@ -72,14 +72,14 @@ export const PackageJson = z.looseObject({
72
72
  .meta({description: 'disallow publishing to the configured registry'})
73
73
  .optional(),
74
74
  description: z.string().optional(),
75
- motto: z
75
+ tagline: z
76
76
  .string()
77
- .meta({description: "a Gro extension that's a short phrase that represents this project"})
77
+ .meta({description: "a Fuz extension that's a short phrase that represents this project"})
78
78
  .optional(),
79
79
  glyph: z
80
80
  .string()
81
81
  .meta({
82
- description: "a Gro extension that's a single unicode character that represents this project",
82
+ description: "a Fuz extension that's a single unicode character that represents this project",
83
83
  })
84
84
  .refine((v) => count_graphemes(v) === 1, 'must be a single unicode character')
85
85
  .optional(),
@@ -87,12 +87,12 @@ export const PackageJson = z.looseObject({
87
87
  .string()
88
88
  .meta({
89
89
  description:
90
- "a Gro extension that's a link relative to the `homepage` to an image that represents this project",
90
+ "a Fuz extension that's a link relative to the `homepage` to an image that represents this project",
91
91
  })
92
92
  .optional(),
93
93
  logo_alt: z
94
94
  .string()
95
- .meta({description: "a Gro extension that's the alt text for the `logo`"})
95
+ .meta({description: "a Fuz extension that's the alt text for the `logo`"})
96
96
  .optional(),
97
97
  license: z.string().optional(),
98
98
  scripts: z.record(z.string(), z.string()).optional(),