JSON-Patch reducer

node v8.17.0
version: 1.0.0
endpointsharetweet
const jsonpatch = require('fast-json-patch'); const userStore = {name: "omar", locations: {businesses: []}}; const patch = [{op: 'remove', path: '/locations/businesses'}]; console.log('Before: ', userStore); const result = patch.reduce(jsonpatch.applyReducer, userStore); console.log('After: ', result);
Loading…

no comments

    sign in to comment