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