How to use pathval - 10 common examples

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;
}
github chaijs / chai / lib / chai / utils / index.js View on Github external
* Flag transferring utility
 */

exports.transferFlags = require('./transferFlags');

/*!
 * Deep equal utility
 */

exports.eql = require('deep-eql');

/*!
 * Deep path info
 */

exports.getPathInfo = pathval.getPathInfo;

/*!
 * Check if a property exists
 */

exports.hasProperty = pathval.hasProperty;

/*!
 * Function name
 */

exports.getName = require('get-func-name');

/*!
 * add Property
 */
github vesln / hippie / lib / hippie / expect.js View on Github external
return function keyCheck(res, body, next) {
    var value = pathval.getPathValue(body, keyParam);
    var notUndefined = typeof value !== 'undefined';
    next(assert(notUndefined, true, 'Key - ' + keyParam));
  };
};
github vesln / hippie / lib / hippie / expect.js View on Github external
return function value(res, body, next) {
    next(assert(pathval.getPathValue(body, key), val, 'Value - ' + key));
  };
};
github chaijs / chai / lib / chai / utils / index.js View on Github external
* Deep equal utility
 */

exports.eql = require('deep-eql');

/*!
 * Deep path info
 */

exports.getPathInfo = pathval.getPathInfo;

/*!
 * Check if a property exists
 */

exports.hasProperty = pathval.hasProperty;

/*!
 * Function name
 */

exports.getName = require('get-func-name');

/*!
 * add Property
 */

exports.addProperty = require('./addProperty');

/*!
 * add Method
 */
github jscs-dev / node-jscs / lib / rules / require-named-unassigned-functions.js View on Github external
this._allExceptItems = options.allExcept.map(function(item) {
                var parts = pathval.parse(item).map(function extractPart(part) {
                    return part.i !== undefined ? part.i : part.p;
                });
                return JSON.stringify(parts);
            });
        }

pathval

Object value retrieval given a string path

MIT
Latest version published 9 months ago

Package Health Score

72 / 100
Full package analysis