MCPcopy Create free account
hub / github.com/alignoth/alignoth / parseRange

Method parseRange

resources/vega-embed.min.js:1238–1279  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1236 return this.range;
1237 }
1238 parseRange(e) {
1239 const t =
1240 ((this.options.includePrerelease && p) |
1241 (this.options.loose && u)) +
1242 ":" +
1243 e,
1244 r = n.get(t);
1245 if (r) return r;
1246 const a = this.options.loose,
1247 g = a ? s[l.HYPHENRANGELOOSE] : s[l.HYPHENRANGE];
1248 ((e = e.replace(g, N(this.options.includePrerelease))),
1249 o("hyphen replace", e),
1250 (e = e.replace(s[l.COMPARATORTRIM], c)),
1251 o("comparator trim", e),
1252 (e = e.replace(s[l.TILDETRIM], f)),
1253 o("tilde trim", e),
1254 (e = e.replace(s[l.CARETTRIM], d)),
1255 o("caret trim", e));
1256 let m = e
1257 .split(" ")
1258 .map((e) => E(e, this.options))
1259 .join(" ")
1260 .split(/\s+/)
1261 .map((e) => L(e, this.options));
1262 (a &&
1263 (m = m.filter(
1264 (e) => (
1265 o("loose invalid filter", e, this.options),
1266 !!e.match(s[l.COMPARATORLOOSE])
1267 ),
1268 )),
1269 o("range list", m));
1270 const v = new Map(),
1271 b = m.map((e) => new i(e, this.options));
1272 for (const e of b) {
1273 if (h(e)) return [e];
1274 v.set(e.value, e);
1275 }
1276 v.size > 1 && v.has("") && v.delete("");
1277 const y = [...v.values()];
1278 return (n.set(t, y), y);
1279 }
1280 intersects(e, n) {
1281 if (!(e instanceof t)) throw new TypeError("a Range is required");
1282 return this.set.some(

Callers 1

constructorMethod · 0.95

Calls 10

NFunction · 0.70
oFunction · 0.70
EFunction · 0.70
LFunction · 0.70
hFunction · 0.70
getMethod · 0.45
mapMethod · 0.45
setMethod · 0.45
hasMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected