Starcounter-Jack / JSON-Patch

Lean and mean Javascript implementation of the JSON-Patch standard (RFC 6902). Update JSON documents using delta patches.
MIT License
1.78k stars 215 forks source link

Inaccurate documentation #291

Open Piliponful opened 2 years ago

Piliponful commented 2 years ago

jsonpatch.compare(document1: any, document2: any, invertible = false): Operation[]

compare doesn't accept any type. It accepts only objects from what I can see. Definitely doesn't accept null or undefined

Starcounter-Jack commented 2 years ago

Correct you are. It should accept null as it is a valid result from parsing JSON or as JSON stringify input.