@spotlab/range 0.1.0 → 0.3.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/types.d.ts CHANGED
@@ -1,12 +1,16 @@
1
- import { z } from 'zod';
2
1
  /**
3
2
  * A canonical 4-character hand token (e.g. `AsKd`), branded so a bare `string`
4
3
  * cannot be passed where a validated hand is required. Mirrors the Rust
5
- * crate's `Hand` newtype and the app's own hand-written brand in
6
- * `src/tauri/branded.ts`.
4
+ * crate's `Hand` newtype.
5
+ *
6
+ * Type-only: the brand has no runtime presence, so importing this package
7
+ * pulls in no validation library. Values come branded from this package's
8
+ * own exports (`parseRange`, `handsOfCombo`, ...); a consumer holding a token
9
+ * it has validated itself can cast (`token as Hand`).
7
10
  */
8
- export declare const Hand: z.core.$ZodBranded<z.ZodString, "Hand", "out">;
9
- export type Hand = z.infer<typeof Hand>;
11
+ export type Hand = string & {
12
+ readonly __brand: "Hand";
13
+ };
10
14
  /**
11
15
  * A single concrete hand mapped to its weight in `[0, 1]`. Mirrors the Rust
12
16
  * crate's `HandFrequency` wire type.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spotlab/range",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "A poker range-string parser and serializer, compiled from Rust to wasm: combo/hand grammar, canonical hand tokens, and weighted-range arithmetic.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,14 +35,11 @@
35
35
  "README.md",
36
36
  "LICENSE"
37
37
  ],
38
- "dependencies": {
39
- "zod": "^4.0.0"
40
- },
41
38
  "devDependencies": {
42
39
  "typescript": "^6.0.0",
43
40
  "vite": "^8.3.1",
44
41
  "vite-plugin-dts": "^5.1.2",
45
- "vitest": "^4.1.4"
42
+ "vitest": "^5.0.0"
46
43
  },
47
44
  "publishConfig": {
48
45
  "access": "public"