benjamine / jsondiffpatch

Diff & patch JavaScript objects
MIT License
4.77k stars 464 forks source link

Types for `jsonpatch` formatter #349

Closed maslennikov closed 8 months ago

maslennikov commented 9 months ago

Hi! I have noticed that formatters types do not export jsonpatch field. Was it intentionally hidden?

I am trying to use it like this:

import jdp from 'jsondiffpatch'
jdp.formatters.jsonpatch.format(changes)

Typescript gives me:

Property 'jsonpatch' does not exist on type '{ annotated: Formatter; console: Formatter; html: HtmlFormatter; }'

Using version "jsondiffpatch": "^0.5.0"

Methuselah96 commented 9 months ago

No, it's not intentionally hidden. We've recently converted the entire codebase to TypeScript which will fix this issue. We hope to get those changes released soon, but there's no estimate of when that will be.

Methuselah96 commented 8 months ago

Just released the new version! Let us know if you have any issues with it.