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

Method sloppyContains

www/js/_hyperscript.esm.js:4592–4600  ·  view source on GitHub ↗
(src, container, value)

Source from the content-addressed store, hash-verified

4590 this.args = { lhs, rhs, rhs2 };
4591 }
4592 sloppyContains(src, container, value) {
4593 if (container["contains"]) {
4594 return container.contains(value);
4595 } else if (container["includes"]) {
4596 return container.includes(value);
4597 } else {
4598 throw new Error("The value of " + src.sourceFor() + " does not have a contains or includes method on it");
4599 }
4600 }
4601 sloppyMatches(src, target, toMatch) {
4602 if (target["match"]) {
4603 return !!target.match(toMatch);

Callers 1

resolveMethod · 0.95

Calls 2

containsMethod · 0.45
sourceForMethod · 0.45

Tested by

no test coverage detected