Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
};
static get(obj, prop) {
return getObject.get(obj, prop);
}
Cache.prototype.get = function get(key, create) {
if (!key) {
return this.cache;
}
return getobject.get(this.cache, key, create);
};
var keys = _.countBy(data, function(item) {
var value = getobject.get(item, key);
if (opts.isJson) {
value = JSON.stringify(value);
}
return value;
});
return keys;
expander.get = function (data, lookup, options) {
if (!lookup) {
return objectExpand(data, data, options);
} else {
return expander.process(data, getobject.get(data, lookup), options);
}
};
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);
}
});
};
expander.getRaw = function (data, lookup) {
if (!lookup) {
return data;
} else {
return getobject.get(data, lookup);
}
};