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

Method sloppyContains

www/js/_hyperscript-max.js:4593–4601  ·  view source on GitHub ↗
(src, container, value)

Source from the content-addressed store, hash-verified

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

Callers 1

resolveMethod · 0.95

Calls 2

containsMethod · 0.45
sourceForMethod · 0.45

Tested by

no test coverage detected