1-liners
Version:
Useful oneliners and shorthand functions
23 lines (20 loc) • 379 B
JavaScript
/**
* @module 1-liners/match
*
* @description
*
* Same as `haystack.match(needle)`.
*
* @example
*
* const match = require('1-liners/match');
*
* match(/\d+/g, 'Items: 3,2'); // => ["3", "2"]
*
*/
;
exports.__esModule = true;
exports["default"] = function (needle, haystack) {
return haystack.match(needle);
};
module.exports = exports["default"];