1 | var _curry2 =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_curry2");
|
4 |
|
5 | var _dispatchable =
|
6 | /*#__PURE__*/
|
7 | require("./internal/_dispatchable");
|
8 |
|
9 | var _dropLast =
|
10 | /*#__PURE__*/
|
11 | require("./internal/_dropLast");
|
12 |
|
13 | var _xdropLast =
|
14 | /*#__PURE__*/
|
15 | require("./internal/_xdropLast");
|
16 | /**
|
17 | * Returns a list containing all but the last `n` elements of the given `list`.
|
18 | *
|
19 | * Acts as a transducer if a transformer is given in list position.
|
20 | *
|
21 | * @func
|
22 | * @memberOf R
|
23 | * @since v0.16.0
|
24 | * @category List
|
25 | * @sig Number -> [a] -> [a]
|
26 | * @sig Number -> String -> String
|
27 | * @param {Number} n The number of elements of `list` to skip.
|
28 | * @param {Array} list The list of elements to consider.
|
29 | * @return {Array} A copy of the list with only the first `list.length - n` elements
|
30 | * @see R.takeLast, R.drop, R.dropWhile, R.dropLastWhile
|
31 | * @example
|
32 | *
|
33 | * R.dropLast(1, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
|
34 | * R.dropLast(2, ['foo', 'bar', 'baz']); //=> ['foo']
|
35 | * R.dropLast(3, ['foo', 'bar', 'baz']); //=> []
|
36 | * R.dropLast(4, ['foo', 'bar', 'baz']); //=> []
|
37 | * R.dropLast(3, 'ramda'); //=> 'ra'
|
38 | */
|
39 |
|
40 |
|
41 | var dropLast =
|
42 | /*#__PURE__*/
|
43 | _curry2(
|
44 | /*#__PURE__*/
|
45 | _dispatchable([], _xdropLast, _dropLast));
|
46 |
|
47 | module.exports = dropLast; |
\ | No newline at end of file |