How to use the values function from ramda
Find comprehensive JavaScript ramda.values code examples handpicked from public code repositorys.
82 83 84 85 86 87 88 89 90 91 92
* @param {String} sessionId * @returns {Promise} <resolve: Event data, reject: Error> */ const getEventBySessionId = async (sessionId) => { const snapshot = await db.ref('events').orderByChild('sessionId').equalTo(sessionId).once('value'); return R.values(snapshot.val())[0]; }; /** * Get a particular Event by primary key <slug, adminId>
12
5
0
57 58 59 60 61 62 63 64 65 66
const tableSql = (schema, table) => [schema, table].filter(Boolean).map(formatFn.ident).join('.'); const _prepareUpdate = (queries, schema, table, update, where, options) => { const sqlZip = (separator, obj) => { const ks = R.keys(obj); const vs = R.values(obj); const aEqB = (aa, bb) => { const isMultiple = Array.isArray(bb); return [ formatFn.ident(aa),
1
6
0
+ 3 other calls in file
GitHub: corporatepiyush/es6
150 151 152 153 154 155 156 157 158
profession: 'Actor', nationality: 'Spanish', married: true } console.log("object keys =", _.keys(obj)) console.log("object values =", _.values(obj)) console.log("object add attribute =", _.assoc('height', 1.68, obj)) console.log("object remove attribute =", _.dissoc('nationality', obj)) console.log("object check attribute =", _.has('married', obj))
1
2
0
33 34 35 36 37 38 39 40 41 42
function run() { Promise.all([urls.tunes, urls.aliases].map(getJson)) .then(([tunes, aliases]) => { const tunesById = transformTunes(tunes) const aliasesById = transformAliases(aliases) return R.values(R.mergeWithKey(mergeTuneAndAliases, tunesById, aliasesById)) }) .then(tunesWithAliases => { fs.writeFileSync(outFile, JSON.stringify(tunesWithAliases, null, 2)) })
0
4
0
GitHub: asan1010/apk
35 36 37 38 39 40 41 42 43 44
.then((lists) => R.zipObj(kws, lists.map((list) => ({rank: findRank(list, app), list}))))) .then(R.reject((kwObj) => R.isNil(kwObj.rank))) .then((kwObjs) => { const promises = R.values(R.mapObjIndexed((obj, kw) => getTraffic(kw, obj.list), kwObjs)); return Promise.all(promises) .then((trafficStats) => buildKeywordScores(R.pluck('rank', R.values(kwObjs)), trafficStats)) .then(R.zipObj(R.keys(kwObjs))); }); /*
0
0
1
+ 541 other calls in file
GitHub: areca/misc
4672 4673 4674 4675 4676 4677 4678 4679 4680 4681
* @sig {k: v} -> [v] * @param {Object} obj The object to extract values from * @return {Array} An array of the values of the object's own properties. * @example * * R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3] */ var values = _curry1(function values(obj) { var props = keys(obj); var len = props.length;
0
0
0
+ 18 other calls in file
62 63 64 65 66 67 68 69 70 71
} }); U.logf('sizes', sizes); const selectedSizes = R.values(sizes).filter(x => x <= 100000); const result = R.reduce(R.add, 0, selectedSizes); return result;
0
0
0
ramda.clone is the most popular function in ramda (30311 examples)