How to use the getobject.get function in getobject

To help you get started, we’ve selected a few getobject 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 tkellen / js-expander / index.js View on Github external
var stringExpand = function (data, lookup, options) {
  var property;
  // as long as this contains a template string, keep traversing
  while(property = findProperty(lookup)) {
    // if this doesn't solely contain a template lookup (e.g. '<%= key %>'), then
    // recursively process it as a template to handle interpolated strings (e.g. 'hi <%= key %>).
    if (property.src !== lookup) {
      lookup = _.template(lookup, data, options);
    } else {
      // expand to the literal value of this key
      lookup = expander.process(data, getobject.get(data, property.prop), options);
    }
  }
  // do one final check for templates.
  if (hasTemplate(lookup)) {
    lookup = _.template(lookup, data, options);
  }
  return lookup;
};
github meiblorn / ngx-fullpage / config / helpers / utils.js View on Github external
static get(obj, prop) {
        return getObject.get(obj, prop);
    }
github assemble / assemble / lib / cache.js View on Github external
Cache.prototype.get = function get(key, create) {
  if (!key) {
    return this.cache;
  }
  return getobject.get(this.cache, key, create);
};
github spanishdict / spotcheck / lib / report.js View on Github external
var keys = _.countBy(data, function(item) {
    var value = getobject.get(item, key);
    if (opts.isJson) {
      value = JSON.stringify(value);
    }
    return value;
  });
  return keys;
github tkellen / js-expander / index.js View on Github external
expander.get = function (data, lookup, options) {
  if (!lookup) {
    return objectExpand(data, data, options);
  } else {
    return expander.process(data, getobject.get(data, lookup), options);
  }
};
github tkellen / js-remapped / index.js View on Github external
return traverse(mapping).map(function (item) {
    if (typeof item === 'string') {
      var value = getobject.get(source, item);
      if (value === undefined) {
        value = getobject.get(defaults, this.path);
      }
      this.update(value);
    }
  });
};
github tkellen / js-expander / index.js View on Github external
expander.getRaw = function (data, lookup) {
  if (!lookup) {
    return data;
  } else {
    return getobject.get(data, lookup);
  }
};

getobject

get.and.set.deep.objects.easily = true

MIT
Latest version published 2 years ago

Package Health Score

66 / 100
Full package analysis

Popular getobject functions