You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
717 B

4 years ago
  1. import invoker from "./invoker.js";
  2. /**
  3. * Splits a string into an array of strings based on the given
  4. * separator.
  5. *
  6. * @func
  7. * @memberOf R
  8. * @since v0.1.0
  9. * @category String
  10. * @sig (String | RegExp) -> String -> [String]
  11. * @param {String|RegExp} sep The pattern.
  12. * @param {String} str The string to separate into an array.
  13. * @return {Array} The array of strings from `str` separated by `sep`.
  14. * @see R.join
  15. * @example
  16. *
  17. * const pathComponents = R.split('/');
  18. * R.tail(pathComponents('/usr/local/bin/node')); //=> ['usr', 'local', 'bin', 'node']
  19. *
  20. * R.split('.', 'a.b.c.xyz.d'); //=> ['a', 'b', 'c', 'xyz', 'd']
  21. */
  22. var split =
  23. /*#__PURE__*/
  24. invoker(1, 'split');
  25. export default split;