angus-c / angus-c/just

Types of just-diff and just-diff-apply do not match

Aberta
#560 1 comentário 2 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
6.2k
Forks
210
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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)[]'.
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.