main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
734 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { slice } from 'ramda';
|
---|
| 2 |
|
---|
| 3 | /**
|
---|
| 4 | * Returns the elements of the given list or string (or object with a slice method)
|
---|
| 5 | * to toIndex (exclusive).
|
---|
| 6 | * Dispatches to the slice method of the second argument, if present.
|
---|
| 7 | *
|
---|
| 8 | * @func sliceTo
|
---|
| 9 | * @memberOf RA
|
---|
| 10 | * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
|
---|
| 11 | * @category List
|
---|
| 12 | * @sig Number -> [a] -> [a]
|
---|
| 13 | * @param {number} toIndex The end index (exclusive)
|
---|
| 14 | * @param {Array|string} list The list or string to slice
|
---|
| 15 | * @return {Array|string} The sliced list or string
|
---|
| 16 | * @see {@link http://ramdajs.com/docs/#slice|R.slice}, {@link RA.sliceFrom|sliceFrom}
|
---|
| 17 | * @example
|
---|
| 18 | *
|
---|
| 19 | * RA.sliceTo(2, [1, 2, 3]); //=> [1, 2]
|
---|
| 20 | */
|
---|
| 21 | const sliceTo = slice(0);
|
---|
| 22 |
|
---|
| 23 | export default sliceTo;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.