How to use the partialRight function from ramda

Find comprehensive JavaScript ramda.partialRight code examples handpicked from public code repositorys.

11
12
13
14
15
16
17
18
19
20

const join = R.curryN(2, path.join);

const sqlFile = name => path.extname(name) === SQL_EXT;

const readFile = R.partialRight(fs.readFileSync, [{ encoding: 'utf-8' }]);

const shortName = name => path.basename(name, SQL_EXT);

const nameToContent = (acc, name) => R.assoc(shortName(name), R.trim(readFile(name)), acc);
fork icon1
star icon6
watch icon0

+ 3 other calls in file

60
61
62
63
64
65
66
67
68
69
70
71
  console.trace(err);
  console.log('error: unable to parse fingerprint file');
}


function toHexBuffer(string) {
  return partialRight(invoker(2, 'from'), ['hex', Buffer]);
}


function blake2bl(input) {
  return avon.sumBuffer(Buffer.from(input), avon.ALGORITHMS.B).toString('hex').slice(64, 128);
fork icon12
star icon5
watch icon0

+ 3 other calls in file

10
11
12
13
14
15
16
17
18
19
20
21


function prepare_controller({ logger, prefix, controller, error_handling_strategy }) {
    // for swagger router:
    // 'prefix_' * { 'a': b } => { 'prefix_a': b }
    const prefixed_action_names = map(action_name => prefix + action_name, Object.keys(controller))
    const add_error_handing = partialRight(error_handling_strategy, [logger])
    const wrapped_actions = map(add_error_handing, Object.values(controller))


    return zipObj(prefixed_action_names, wrapped_actions)
}
fork icon0
star icon3
watch icon0

228
229
230
231
232
233
234

```
var greet = (salutation, title, firstName, lastName) =>
  salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';

var greetMsJaneJones = R.partialRight(greet, ['Ms.', 'Jane', 'Jones']);
greetMsJaneJones('Hello') // 'Hello, Ms. Jane Jones!'
fork icon0
star icon1
watch icon1

6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
* @category Function
* @sig ((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)
* @param {Function} f
* @param {Array} args
* @return {Function}
* @see R.partialRight
* @example
*
*      var multiply = (a, b) => a * b;
*      var double = R.partial(multiply, [2]);
fork icon0
star icon0
watch icon0

+ 35 other calls in file

33
34
35
36
37
38
39
40
41
42
43
44
  R.always(1),
  process.exit
);


//  filenameToIdentifier :: String -> String
var filenameToIdentifier = R.partialRight(path.basename, '.js');


//  identifierToFilename :: String -> String
var identifierToFilename =
R.pipe(R.ifElse(R.test(/^(?!__$)_/),
fork icon0
star icon0
watch icon0

1
2
3
4
5
6
7
8
9
10
11
12
const R = require('ramda');


const DATA = "./data/20221.txt";


const elves = R.pipe(
  R.partialRight(fs.readFileSync, ["utf8"]),
  R.trim,
  R.split('\n'),
  R.map(parseInt),
  R.splitWhenever(R.equals(NaN)),
fork icon0
star icon0
watch icon0

10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
* @example
*
*      const greet = (salutation, title, firstName, lastName) =>
*        salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';
*
*      const greetMsJaneJones = R.partialRight(greet, ['Ms.', 'Jane', 'Jones']);
*
*      greetMsJaneJones('Hello'); //=> 'Hello, Ms. Jane Jones!'
* @symb R.partialRight(f, [a, b])(c, d) = f(c, d, a, b)
*/
fork icon0
star icon0
watch icon2

+ 7 other calls in file

Other functions in ramda

Sorted by popularity

function icon

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