How to use the pathval.get function in pathval

To help you get started, we’ve selected a few pathval examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github michaelleeallen / reducto / lib / map-schema.js View on Github external
return _.mapValues(schema, val =>
    (typeof val === 'object') ?
      (val.type === 'list') ? _.map(props.get(data, val.path), item => mapSchema(val.schema, item))
        : mapSchema(val, data)
    : props.get(data, val));
}
github michaelleeallen / reducto / lib / map-schema.js View on Github external
return _.mapValues(schema, val =>
    (typeof val === 'object') ?
      (val.type === 'list') ? _.map(props.get(data, val.path), item => mapSchema(val.schema, item))
        : mapSchema(val, data)
    : props.get(data, val));
}
github qualiancy / seed / lib / filter / util.js View on Github external
exports.testFilter = function(val, stack) {
  var pass = true;

  for (var si = 0, sl = stack.length; si < sl; si++) {
    var filter = stack[si];
    var el = filter.path ? pathval.get(val, filter.path) : val
    var res = testFilter(el, filter.test);
    if (!res) pass = false;
  }

  return pass;
}

pathval

Object value retrieval given a string path

MIT
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis