How to use the fromPairs function from ramda
Find comprehensive JavaScript ramda.fromPairs code examples handpicked from public code repositorys.
6 7 8 9 10 11 12 13 14 15 16 17
const UserError = require('./UserError'); const toConfigMap = (metaConfig) => ( R.pipe( R.map(c => [c.config.name, c.config]), R.fromPairs )(metaConfig) ); const prepareAnnotation = (metaConfig, query) => {
2
5
0
+ 27 other calls in file
GitHub: corporatepiyush/es6
171 172 173 174 175 176 177 178 179
'-firstName-': 'Charles', '-lastName-': 'Bukowski' } const transform = (input) => _.fromPairs( _.map(([key, value]) => [`-${key}-`, value], _.toPairs(input)))
1
2
0
+ 3 other calls in file
61 62 63 64 65 66 67 68 69 70
enumerable: true, configurable: true }); Sound.prototype.state = function () { var audio = this._audio; var state = R.fromPairs(R.map(function (property) { return [property, R.prop(property, audio)]; }, STATE_PROPERTIES)); state.id = this.id; return state;
0
0
0
+ 53 other calls in file
GitHub: synapticjs/synaptic-ops
7 8 9 10 11 12 13 14 15 16 17 18
const isMonad = fn => fn.monad; const stdlib = { let: monad((context, [variables, fn]) => context.inherit( R.fromPairs(variables.map(([varname, expr]) => [varname, context.interpret(expr)])) ) .interpret(fn)), lambda: monad((context, [argNames, fn]) =>
0
0
0
+ 3 other calls in file
GitHub: 22317a57/cube-js-legacy
46 47 48 49 50 51 52 53 54 55
const dimensions = (query.dimensions || []); return { measures: R.fromPairs((query.measures || []).map(annotation('measures')).filter(a => !!a)), dimensions: R.fromPairs(dimensions.map(annotation('dimensions')).filter(a => !!a)), segments: R.fromPairs((query.segments || []).map(annotation('segments')).filter(a => !!a)), timeDimensions: R.fromPairs( R.unnest( (query.timeDimensions || []) .filter(td => !!td.granularity) .map(
0
0
0
+ 6 other calls in file
515 516 517 518 519 520 521 522 523 524
timeStampInClientTz(dateParam) { return this.convertTz(dateParam); } granularityHierarchies() { return R.fromPairs(Object.keys(standardGranularitiesParents).map(k => [k, this.granularityParentHierarchy(k)])); } granularityParent(granularity) { return standardGranularitiesParents[granularity];
0
0
0
+ 5 other calls in file
ramda.clone is the most popular function in ramda (30311 examples)