MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / L

Function L

benchmark/data-min.js:134–146  ·  view source on GitHub ↗
(l)

Source from the content-addressed store, hash-verified

132 }
133}
134function L(l) {
135 const t = l.split(`
136`),
137 e = t.filter((r) => /^\t+/.test(r)),
138 n = t.filter((r) => /^ {2,}/.test(r));
139 if (e.length === 0 && n.length === 0) return null;
140 if (e.length >= n.length) return ' ';
141 const i = n.reduce((r, s) => {
142 const h = /^ +/.exec(s)[0].length;
143 return Math.min(h, r);
144 }, 1 / 0);
145 return new Array(i + 1).join(' ');
146}
147function E(l, t) {
148 const e = l.split(/[/\\]/),
149 n = t.split(/[/\\]/);

Callers 1

constructorMethod · 0.85

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected