action-debian-package/node_modules/ramda/es/init.js

30 lines
634 B
JavaScript
Raw Normal View History

2020-03-26 14:37:35 +00:00
import slice from "./slice.js";
/**
* Returns all but the last element of the given list or string.
*
* @func
* @memberOf R
* @since v0.9.0
* @category List
* @sig [a] -> [a]
* @sig String -> String
* @param {*} list
* @return {*}
* @see R.last, R.head, R.tail
* @example
*
* R.init([1, 2, 3]); //=> [1, 2]
* R.init([1, 2]); //=> [1]
* R.init([1]); //=> []
* R.init([]); //=> []
*
* R.init('abc'); //=> 'ab'
* R.init('ab'); //=> 'a'
* R.init('a'); //=> ''
* R.init(''); //=> ''
*/
var init =
/*#__PURE__*/
slice(0, -1);
export default init;