_.reduce(_.zipObject(attrs, values), (result, value, attr) => { while (attr.indexOf('"') !== -1) { attr = attr.replace('"', ''); } result[attr] = `Entity with "${attr}"="${value}" already exists`; return result; }, {})
parse(endpoint) { const template = _.template(endpoint, { interpolate: endpointParamRegExp }); return { args: matchAll(endpoint, endpointParamRegExp), compile(args) { const params = _.zipObject(_.map(this.args, 'name'), args); return template(params); } }; }
/** * Creates a function that parses a list of Redis results and matches them up * with the given keyRange * @param {array} keyRange - The list of keys to match with the results. * @returns {function} * @private */ const createRangeParser = keyRange => results => _.zipObject(keyRange, utils.parseIntArray(results))
function createGeneratorObject(keys) { return _.zipObject(keys, _.map(keys, gen)); }
const createRankRangeParser = keyRange => results => _.zipObject(keyRange, results.map(rankParser))