mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +08:00
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change We can get rid of a custom script and use ESLint for these rules. Additionally this means editors will highlight the issue in the editor. Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
26 lines
834 B
JavaScript
26 lines
834 B
JavaScript
import _curry2 from './internal/_curry2.js';
|
|
import length from './length.js';
|
|
import slice from './slice.js';
|
|
|
|
/**
|
|
* Splits a given list or string at a given index.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.19.0
|
|
* @category List
|
|
* @sig Number -> [a] -> [[a], [a]]
|
|
* @sig Number -> String -> [String, String]
|
|
* @param {Number} index The index where the array/string is split.
|
|
* @param {Array|String} array The array/string to be split.
|
|
* @return {Array}
|
|
* @example
|
|
*
|
|
* R.splitAt(1, [1, 2, 3]); //=> [[1], [2, 3]]
|
|
* R.splitAt(5, 'hello world'); //=> ['hello', ' world']
|
|
* R.splitAt(-1, 'foobar'); //=> ['fooba', 'r']
|
|
*/
|
|
var splitAt = /*#__PURE__*/_curry2(function splitAt(index, array) {
|
|
return [slice(0, index, array), slice(index, length(array), array)];
|
|
});
|
|
export default splitAt; |