mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 16:42:28 +03:00
29 lines
772 B
TypeScript
29 lines
772 B
TypeScript
// Loaded from https://deno.land/x/ramda@v0.27.2/source/split.js
|
|
|
|
|
|
import invoker from './invoker.js';
|
|
|
|
|
|
/**
|
|
* Splits a string into an array of strings based on the given
|
|
* separator.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.1.0
|
|
* @category String
|
|
* @sig (String | RegExp) -> String -> [String]
|
|
* @param {String|RegExp} sep The pattern.
|
|
* @param {String} str The string to separate into an array.
|
|
* @return {Array} The array of strings from `str` separated by `sep`.
|
|
* @see R.join
|
|
* @example
|
|
*
|
|
* const pathComponents = R.split('/');
|
|
* R.tail(pathComponents('/usr/local/bin/node')); //=> ['usr', 'local', 'bin', 'node']
|
|
*
|
|
* R.split('.', 'a.b.c.xyz.d'); //=> ['a', 'b', 'c', 'xyz', 'd']
|
|
*/
|
|
var split = invoker(1, 'split');
|
|
export default split;
|