MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / sloppyMatches

Method sloppyMatches

www/js/_hyperscript-max.js:4602–4610  ·  view source on GitHub ↗
(src, target, toMatch)

Source from the content-addressed store, hash-verified

4600 }
4601 }
4602 sloppyMatches(src, target, toMatch) {
4603 if (target["match"]) {
4604 return !!target.match(toMatch);
4605 } else if (target["matches"]) {
4606 return target.matches(toMatch);
4607 } else {
4608 throw new Error("The value of " + src.sourceFor() + " does not have a match or matches method on it");
4609 }
4610 }
4611 static parse(parser) {
4612 var expr = parser.parseElement("mathOperator");
4613 var comparisonToken = parser.matchAnyOpToken("<", ">", "<=", ">=", "==", "===", "!=", "!==");

Callers 1

resolveMethod · 0.95

Calls 1

sourceForMethod · 0.45

Tested by

no test coverage detected