initial status
This commit is contained in:
30
node_modules/ramda/es/match.js
generated
vendored
Normal file
30
node_modules/ramda/es/match.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import _curry2 from "./internal/_curry2.js";
|
||||
/**
|
||||
* Tests a regular expression against a String. Note that this function will
|
||||
* return an empty array when there are no matches. This differs from
|
||||
* [`String.prototype.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match)
|
||||
* which returns `null` when there are no matches.
|
||||
*
|
||||
* @func
|
||||
* @memberOf R
|
||||
* @since v0.1.0
|
||||
* @category String
|
||||
* @sig RegExp -> String -> [String | Undefined]
|
||||
* @param {RegExp} rx A regular expression.
|
||||
* @param {String} str The string to match against
|
||||
* @return {Array} The list of matches or empty array.
|
||||
* @see R.test
|
||||
* @example
|
||||
*
|
||||
* R.match(/([a-z]a)/g, 'bananas'); //=> ['ba', 'na', 'na']
|
||||
* R.match(/a/, 'b'); //=> []
|
||||
* R.match(/a/, null); //=> TypeError: null does not have a method named "match"
|
||||
*/
|
||||
|
||||
var match =
|
||||
/*#__PURE__*/
|
||||
_curry2(function match(rx, str) {
|
||||
return str.match(rx) || [];
|
||||
});
|
||||
|
||||
export default match;
|
Reference in New Issue
Block a user