You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve `Variant` type inference with `PropertyKey` constraint
6
+
7
+
The `Variant` helper now accepts `PropertyKey` (string | number | symbol) as variant keys instead of just strings, enabling more flexible discriminated union patterns.
8
+
9
+
**Before:**
10
+
```typescript
11
+
// Only string keys were properly typed
12
+
const MyVariant =TSchema.Variant({
13
+
"Success": { value: TSchema.Integer },
14
+
"Error": { message: TSchema.ByteArray }
15
+
})
16
+
```
17
+
18
+
**After:**
19
+
```typescript
20
+
// Now supports symbols and numbers as variant keys
21
+
const MyVariant =TSchema.Variant({
22
+
Success: { value: TSchema.Integer },
23
+
Error: { message: TSchema.ByteArray }
24
+
})
25
+
// Type inference is improved, especially with const assertions
26
+
```
27
+
28
+
Replace `@ts-expect-error` with `as any` following Effect patterns
29
+
30
+
Improved code quality by replacing forbidden `@ts-expect-error` directives with explicit `as any` type assertions, consistent with Effect Schema's approach for dynamic object construction.
31
+
32
+
Add comprehensive Cardano Address type support
33
+
34
+
Added full CBOR encoding support for Cardano address structures with Aiken compatibility:
Add Aiken-compatible CBOR encoding with encodeMapAsPairs option and comprehensive test suite. PlutusData maps can now encode as arrays of pairs (Aiken style) or CBOR maps (CML style). Includes 72 Aiken reference tests and 40 TypeScript compatibility tests verifying identical encoding. Also fixes branded schema pattern in Data.ts for cleaner type inference and updates TSchema error handling test.
0 commit comments