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
In many cases, you want to be able to serialize errors (usually w/ JSON.stringify), however currently the object root property is lost as it's a symbol.
It was originally a string (__root) but was changed to a symbol to avoid clashes with user properties. In hindsight I think it's worth going back to a string property and a) giving it a better namespace and b) throwing if a validator is passed in with a conflicting name.
NOTE: As a reminder, we return a "root" error as a property like this (rather than { name?: string } | string), so the returned interface is always an object making it easier to consume).
In many cases, you want to be able to serialize errors (usually w/ JSON.stringify), however currently the object root property is lost as it's a symbol.
It was originally a string (
__root
) but was changed to a symbol to avoid clashes with user properties. In hindsight I think it's worth going back to a string property and a) giving it a better namespace and b) throwing if a validator is passed in with a conflicting name.e.g.
Implementation details
listErrors
no longer needs to useownEnumerableEntries
https://github.com/richardscarrott/ok-computer/blob/master/src/ok-computer.ts#L76array
; although arrays obviously don't non-index properties...The text was updated successfully, but these errors were encountered: