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) => {
fork icon2
star icon5
watch icon0

+ 27 other calls in file

171
172
173
174
175
176
177
178
179
    '-firstName-': 'Charles',
    '-lastName-': 'Bukowski'

}

const transform = (input) => _.fromPairs(
    _.map(([key, value]) => [`-${key}-`, value],
        _.toPairs(input)))

fork icon1
star icon2
watch icon0

+ 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;
fork icon0
star icon0
watch icon0

+ 53 other calls in file

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]) =>
fork icon0
star icon0
watch icon0

+ 3 other calls in file

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(
fork icon0
star icon0
watch icon0

+ 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];
fork icon0
star icon0
watch icon0

+ 5 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)