@aws/pdk
Version:
All documentation is located at: https://aws.github.io/aws-pdk
47 lines (41 loc) • 1.25 kB
JavaScript
var _curry2 =
/*#__PURE__*/
require("./internal/_curry2.js");
var _dispatchable =
/*#__PURE__*/
require("./internal/_dispatchable.js");
var _dropLast =
/*#__PURE__*/
require("./internal/_dropLast.js");
var _xdropLast =
/*#__PURE__*/
require("./internal/_xdropLast.js");
/**
* Returns a list containing all but the last `n` elements of the given `list`.
*
* Acts as a transducer if a transformer is given in list position.
*
* @func
* @memberOf R
* @since v0.16.0
* @category List
* @sig Number -> [a] -> [a]
* @sig Number -> String -> String
* @param {Number} n The number of elements of `list` to skip.
* @param {Array} list The list of elements to consider.
* @return {Array} A copy of the list with only the first `list.length - n` elements
* @see R.takeLast, R.drop, R.dropWhile, R.dropLastWhile
* @example
*
* R.dropLast(1, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
* R.dropLast(2, ['foo', 'bar', 'baz']); //=> ['foo']
* R.dropLast(3, ['foo', 'bar', 'baz']); //=> []
* R.dropLast(4, ['foo', 'bar', 'baz']); //=> []
* R.dropLast(3, 'ramda'); //=> 'ra'
*/
var dropLast =
/*#__PURE__*/
_curry2(
/*#__PURE__*/
_dispatchable([], _xdropLast, _dropLast));
module.exports = dropLast;