deno.land / x / rambda@v9.1.1 / src / test.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
export function test(pattern, str){ if (arguments.length === 1) return _str => test(pattern, _str)
if (typeof pattern === 'string'){ throw new TypeError(`R.test requires a value of type RegExp as its first argument; received "${ pattern }"`) }
return str.search(pattern) !== -1}
rambda

Version Info

Tagged at
2 months ago