Skip to content

Next#6

Open
bas080 wants to merge 14 commits intomasterfrom
next
Open

Next#6
bas080 wants to merge 14 commits intomasterfrom
next

Conversation

@bas080
Copy link
Copy Markdown
Owner

@bas080 bas080 commented Apr 6, 2026

No description provided.

bas080 and others added 14 commits April 6, 2026 01:34
- stringify(program, leafSerializer) accepts custom leaf serialization
- parse(program, leafDeserializer) accepts custom leaf deserialization
- leaf values wrapped as ['leaf', serializedString] nodes
- supports Date, RegExp, BigInt, Set, Map, and undefined via superjson
- preserves undefined in objects using internal sentinel mechanism
- simplify defaultLeafDeserializer to remove unreachable branch
- add test for default deserializer when not provided
- add test for fallback to default deserializer when null passed
- add test to exercise defensive undefined parameter handling
- achieves 100% branch coverage
- remove unused Symbol('replaced') that was vestigial from replacer pattern
- move awaitId tracking into state object passed to transformValue
- reset awaitId per stringify() call for proper isolation
- simplifies code path and removes global mutable state per-call
- JSON.parse reviver can only receive null (not undefined)
- replace isNil(value) with direct null check
- remove unused is-nil import
- document transformValue behavior for stringify
- document resolveAwaitedValues behavior for parse
- document restoreUndefined purpose
- improve code readability through strategic comments
document the leaf (de)serializer API:
- explain default JSON limitation
- show how to extend with superjson
- provide complete example with Date, RegExp, BigInt, Map, Set
- clarify leaf wrapper format for safety
- add test to verify ['leaf', 1, 2, 3] is properly quoted and unquoted
- fix: add 'leaf' to keywords list so it's quoted when appearing as array data
- ensures leaf marker is not confused with actual leaf data
…e coverage

- Added getTypeInfo() helper for better error messages
- Improved assertion messages with type information
- Added property test for type distinctness (different primitives have different serializations)
- Added property test for serialization stability (idempotence)
- Better error handling and reporting in all property tests
- Now running 6 property tests with comprehensive coverage
- All 60 tests passing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant