We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delta
Between 0.5 and 0.6 the Delta type returned by diff changed. It used to be:
diff
export interface Delta { [key: string]: any; [key: number]: any; }
Now it's:
export type Delta = AddedDelta | ModifiedDelta | DeletedDelta | ObjectDelta | ArrayDelta | MovedDelta | TextDiffDelta | undefined;
Where many of those are typed partially with unknown.
unknown
This is undoubtedly an improvement, however I wonder if we could narrow unknown down at all?
My use case is trying to work with JSON safely , for example via fp-ts' Json type: https://github.com/gcanti/fp-ts/blob/2.16.5/src/Json.ts#L10.
Json
export type Json = boolean | number | string | null | JsonArray | JsonRecord
This enables infallible stringification.
I suspect Delta is already implicitly a subtype of Json, however if not it'd be good to know that. Cheers!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Between 0.5 and 0.6 the
Delta
type returned bydiff
changed. It used to be:Now it's:
Where many of those are typed partially with
unknown
.This is undoubtedly an improvement, however I wonder if we could narrow
unknown
down at all?My use case is trying to work with JSON safely , for example via fp-ts'
Json
type: https://github.com/gcanti/fp-ts/blob/2.16.5/src/Json.ts#L10.This enables infallible stringification.
I suspect
Delta
is already implicitly a subtype ofJson
, however if not it'd be good to know that. Cheers!The text was updated successfully, but these errors were encountered: