Skip to main content
Module

x/rambda/test.js

Faster and smaller alternative to Ramda
Go to Latest
File
export function test(pattern, str){ if (arguments.length === 1) return _str => test(pattern, _str)
if (typeof pattern === 'string'){ throw new TypeError(`‘test’ requires a value of type RegExp as its first argument; received "${ pattern }"`) }
return str.search(pattern) !== -1}