Checks if every item of *String* string returns true from *Function* predicate.
Original string to find matches against with *String* compare.
String to match agains *String* string.
Returns Array of findings
Returns Boolean if there was a match found.
Returns compare string.
Note: When setting; finds.compare = "foo"
, this will reset finds
and find all matches with the new compare value.
import { MatchFinder } from "@taystack/js-helpers";
MatchFinder("foobar", "foo").matches /*
[{
string: "foo",
match: true,
}, {
string: "bar",
}]
*/
MatchFinder("foobar has the word foo", "foo").matches /*
[{
string: "foo",
match: true,
}, {
string: "bar has the word ",
}, {
string: "foo",
match: true,
}]
*/
Source: @taystack/js-helpers hosted on GitHub Author: taystack