Sha256: edac29b1e5ac9af3ce919ace40418b6950677f74ece7bcb95cb8adcb46e452c1

Contents?: true

Size: 582 Bytes

Versions: 5

Compression:

Stored size: 582 Bytes

Contents

"use strict";

var method = require("method")
var rebase = require("./rebase")

// Method is designed to work with data structures representing application
// state. Calling it with a state and delta should return object representing
// new state, with changes in `delta` being applied to previous.
//
// ## Example
//
// patch(state, {
//   "item-id-1": { completed: false }, // update
//   "item-id-2": null                  // delete
// })
var patch = method("patch")
patch.define(Object, function patch(hash, delta) {
  return rebase({}, hash, delta)
})

module.exports = patch

Version data entries

5 entries across 2 versions & 1 rubygems

Version Path
ruby-wisp-source-0.8.0 vendor/interactivate/node_modules/interactivate/node_modules/diffpatcher/patch.js
ruby-wisp-source-0.8.0 vendor/node_modules/wisp/interactivate/node_modules/interactivate/node_modules/diffpatcher/patch.js
ruby-wisp-source-0.7.0 vendor/interactivate/node_modules/interactivate/node_modules/diffpatcher/patch.js
ruby-wisp-source-0.7.0 vendor/node_modules/wisp/interactivate/node_modules/interactivate/node_modules/diffpatcher/patch.js
ruby-wisp-source-0.7.0 vendor/try/node_modules/~wisp/interactivate/node_modules/interactivate/node_modules/diffpatcher/patch.js