mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 20:22:26 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
33 lines
688 B
TypeScript
33 lines
688 B
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/init.js
|
|
|
|
|
|
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 = slice(0, -1);
|
|
export default init;
|