swc/crates/swc_bundler/tests/.cache/deno/83a212fcda1c5760ec9fd0abf491a9f437de010f.ts
2021-11-09 20:42:49 +09:00

38 lines
945 B
TypeScript

// Loaded from https://deno.land/x/ramda@v0.27.2/source/tail.js
import _checkForMethod from './internal/_checkForMethod.js';
import _curry1 from './internal/_curry1.js';
import slice from './slice.js';
/**
* Returns all but the first element of the given list or string (or object
* with a `tail` method).
*
* Dispatches to the `slice` method of the first argument, if present.
*
* @func
* @memberOf R
* @since v0.1.0
* @category List
* @sig [a] -> [a]
* @sig String -> String
* @param {*} list
* @return {*}
* @see R.head, R.init, R.last
* @example
*
* R.tail([1, 2, 3]); //=> [2, 3]
* R.tail([1, 2]); //=> [2]
* R.tail([1]); //=> []
* R.tail([]); //=> []
*
* R.tail('abc'); //=> 'bc'
* R.tail('ab'); //=> 'b'
* R.tail('a'); //=> ''
* R.tail(''); //=> ''
*/
var tail = _curry1(_checkForMethod('tail', slice(1, Infinity)));
export default tail;