index.js 307 B

123456789101112
  1. var parsePath = require('./lib/parse-path')
  2. var setValue = require('./lib/set-value')
  3. function appendField (store, key, value) {
  4. var steps = parsePath(key)
  5. steps.reduce(function (context, step) {
  6. return setValue(context, step, context[step.key], value)
  7. }, store)
  8. }
  9. module.exports = appendField