sinclairzx81 / typebox

Json Schema Type Builder with Static Type Resolution for TypeScript
Other
4.56k stars 148 forks source link

Should `IsValueType` guard consider `Date`? #899

Closed petrkozorezov closed 3 weeks ago

petrkozorezov commented 3 weeks ago

Currently, diff for objects with dates crashed with error 'Unable to create diff edits for unknown value'.

sinclairzx81 commented 3 weeks ago

@petrkozorezov Hi, sorry for the delay in reply.

Unfortunately, built in JavaScript containers (such as Map, Set) as well as Date objects are not supported by the Diff/Patch functions. The reason is because it's not possible to patch class instances. However, there may be potential to support Map and Set in future, but as of now the Diff and Patch functions are limited to only values that can be serialized as Json.

Will close up this issue as being out of scope (for now). But happy to discuss things further if you have any follow up comments. Cheers S