n1ru4l/graphql-live-query

json-diff-plus replaces keys with 'undefined' instead of deleting them

Closed this issue · 1 comments

import { diff, patch } from "@n1ru4l/json-patch-plus";

const left = { a: 1, d: 1 }

const delta = diff({
  left,
  right: { a: 1 },
}, {});

console.log(patch({ left, delta }))
// Outputs: { a: 1, d: undefined }
// Expected: { a: 1 }

Can you please create a PR with a failing test?