1-liners
Version:
Useful oneliners and shorthand functions
23 lines (20 loc) • 354 B
JavaScript
/**
* @module 1-liners/search
*
* @description
*
* Same as `'STR'.search(regexp)`.
*
* @example
*
* const search = require('1-liners/search');
*
* search(/s/, 'super') // => 0
*
*/
;
exports.__esModule = true;
exports["default"] = function (regexp, str) {
return str.search(regexp);
};
module.exports = exports["default"];