sveltekit-discriminated-fields 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +4 -0
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -167,6 +167,10 @@ type Payment = DiscriminatedData<typeof payment>;
167
167
 
168
168
  Useful when you need to reference the data type elsewhere, such as defining default values or passing data to other functions.
169
169
 
170
+ ## Note on Runtime Behavior
171
+
172
+ Type narrowing is compile-time only. At runtime, `'width' in shape` will return `true` even when `kindValue === 'circle'`, because all variant fields exist on the underlying object.
173
+
170
174
  ## License
171
175
 
172
176
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-discriminated-fields",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Type-safe discriminated union support for SvelteKit form fields",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,7 +16,8 @@
16
16
  "build": "tsc -p tsconfig.build.json",
17
17
  "check": "tsc --noEmit",
18
18
  "test:types": "tsc -p test/types/tsconfig.json",
19
- "test": "npm run test:types",
19
+ "test:runtime": "npm run build && tsc -p test/runtime/tsconfig.json && npx tsx test/runtime/has.test.ts",
20
+ "test": "npm run test:types && npm run test:runtime",
20
21
  "prepublishOnly": "npm run test && npm run build"
21
22
  },
22
23
  "keywords": [