Types of just-diff and just-diff-apply do not match
- Dominant language
- JavaScript
- Stars
- 6.2k
- Forks
- 209
- PR merge metrics
- No merged PRs in 30d
Description
If I use the `diff` function from `just-diff` with the `jsonPatchPathConverter` function provided there, and then use `diffApply` from `just-diff-apply` on the result with its `jsonPathPathConverter`, I receive a `TypeError` on `path`.
### Minimal example:
```ts
const obj1 = {};
const obj2 = {};
const diffObj = diff(obj1, obj2, jsonPatchPathConverter);
diffApply(obj1, diffObj, jsonPatchPathConverter);
```
With this code, I receive the following error in TypeScript 5.0.4:
```
Type '{ op: Operation; path: string; value: any; }[]' is not assignable to type 'DiffOps'.
Type '{ op: Operation; path: string; value: any; }' is not assignable to type '{ op: Operation; path: (string | number)[]; value?: any; }'.
Types of property 'path' are incompatible.
Type 'string' is not assignable to type '(string | number)[]'.
```
Contributor guide
Assessment
This issue has not been assessed yet.