exportfunctiontest(pattern, str){
if (arguments.length === 1) return_str =>test(pattern, _str)
if (typeof pattern === 'string'){
thrownewTypeError(`‘test’ requires a value of type RegExp as its first argument; received "${ pattern }"`)
}
return str.search(pattern) !== -1
}