MCPcopy Create free account
hub / github.com/ampproject/amphtml / expand

Function expand

third_party/inputmask/inputmask.js:886–898  ·  view source on GitHub ↗
(pattern)

Source from the content-addressed store, hash-verified

884 }
885 function isSubsetOf(source, target) {
886 function expand(pattern) {
887 var expanded = [], start, end;
888 for (var i = 0, l = pattern.length; i < l; i++) {
889 if (pattern.charAt(i) === "-") {
890 end = pattern.charCodeAt(i + 1);
891 while (++start < end) expanded.push(String.fromCharCode(start));
892 } else {
893 start = pattern.charCodeAt(i);
894 expanded.push(pattern.charAt(i));
895 }
896 }
897 return expanded.join("");
898 }
899 if (opts.regex && source.match.fn !== null && target.match.fn !== null) {
900 return expand(target.match.def.replace(/[\[\]]/g, "")).indexOf(expand(source.match.def.replace(/[\[\]]/g, ""))) !== -1;
901 }

Callers 7

_defaultFunction · 0.85
eventsFunction · 0.85
Basic.jsFile · 0.85
_defaultFunction · 0.85
eventsFunction · 0.85
Basic.jsFile · 0.85
isSubsetOfFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected