How to use the drop function from ramda

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

23
24
25
26
27
28
29
30
31
32

  return shell.ls(R.concat(directory, anyFileType));
}

function cleanNodeInput(args) {
  return R.drop(2, args);
}

// cleanDirectories :: (string, string,[string], function) -> function
function cleanDirectories(folderName, fileFormat, directories, callback) {
fork icon1
star icon0
watch icon2

19
20
21
22
23
24
25
26
27
28
29
const mergeString = R.unapply(R.compose(
  R.defaultTo(''),
  R.head(),
  R.reject(isUseless),
  R.reverse,
  R.drop(1)
))


const mergeArray = R.unapply(R.compose(
  R.uniq,
fork icon0
star icon4
watch icon0

+ 5 other calls in file

19
20
21
22
23
24
25
26
27
28
29
  }
  return str;
});


const concatUntil = (fn, index) => R.pipe(
  R.drop(index),
  R.takeWhile(R.complement(fn)),
  R.map(R.prop('str')),
  R.join(' '),
);
fork icon0
star icon1
watch icon0

+ 3 other calls in file

26
27
28
29
30
31
32
33
34
35
36
      R.map(R.when(isNaN, () => R.__)),
      R.map(Number),
      takeFirstAndLast
    )
  ]), 
  R.drop(1), 
  R.dropWhile(R.complement(R.equals('=')))
)


const isTest = checkHead('Test')
fork icon0
star icon0
watch icon0

+ 3 other calls in file

4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
* @sig Number -> [a] -> [a]
* @sig Number -> String -> String
* @param {Number} n
* @param {*} list
* @return {*}
* @see R.drop
* @example
*
*      R.take(1, ['foo', 'bar', 'baz']); //=> ['foo']
*      R.take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
fork icon0
star icon0
watch icon0

+ 107 other calls in file

19
20
21
22
23
24
25
26
27
28
29
30
const indexRange = R.range(0, sortedAdapters.length)


const branchesForIndex = (index) =>
  R.takeWhile(
    (nextIndex) => sortedAdapters[nextIndex] - sortedAdapters[index] <= 3,
    R.drop(index + 1, indexRange)
  )
const branchesMap = R.map(branchesForIndex, indexRange)


const combinationsForIndex = (index, accumMap) => {
fork icon0
star icon0
watch icon0

84
85
86
87
88
89
90
91
92
93
const getSubFolderNames = (path, structure) => {
    if (path.length === 0) {
        return structure.subfolders.map((sf) => sf.moduleName)
    }
    else {
        const newPath = R.drop(1, path)
        const newTarget = R.head(path)
        const newStructure = R.find(R.propEq('moduleName', newTarget), structure.subfolders)
        return getSubFolderNames(newPath, newStructure)
    }
fork icon0
star icon0
watch icon0

152
153
154
155
156
157
158
159
160
161
  setInstructions(structure.aum_instructions);
  return {
    formName: structure.form
  };
} else {
  const newPath = R.drop(1, path);
  const newTarget = R.head(newPath);
  const newStructure = R.find(
    R.propEq('moduleName', newTarget),
    structure.subfolders
fork icon0
star icon0
watch icon0

13
14
15
16
17
18
19
20
21
22
if (s[0] === '[') {
  // our snail number is an actual tree.
  let rest = s;

  // start with removing the leading '['
  rest = R.drop(1, rest);
  let left; let right;
  [left, rest] = parseSnailNum(rest);

  // get rid of the middle comma
fork icon0
star icon0
watch icon0

+ 11 other calls in file

448
449
450
451
452
453
454
455
456
457
          )
        )
      )(cumulativeMeasures)
    );

const join = R.drop(1, toJoin)
  .map(
    (q, i) => (this.dimensionAliasNames().length ?
      `INNER JOIN (${q}) as q_${i + 1} ON ${this.dimensionsJoinCondition(`q_${i}`, `q_${i + 1}`)}` :
      `, (${q}) as q_${i + 1}`)
fork icon0
star icon0
watch icon0

13
14
15
16
17
18
19
20
21
22
23
24
    R.split(' ')));


const boards = R.compose(
    R.map(R.compose(parseBoard, R.dropLast(1))),
    R.groupWith(R.compose(R.not, R.equals(''))),
    R.drop(2))(input);


const markNumber = (n) => R.map(
    R.map(R.ifElse(R.equals(n), R.always(-1), R.identity)));

fork icon0
star icon0
watch icon0

43
44
45
46
47
48
49
50
51
52
const fold = f => l => R.reduce(f, R.head(l), R.tail(l));
const others = limit => label => R.compose(
  R.prepend(label),
  fold(R.zipWith(R.add)),
  R.map(R.tail),
  R.drop(limit)
);

const columns = R.compose(
  R.prepend(
fork icon0
star icon0
watch icon1

Other functions in ramda

Sorted by popularity

function icon

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