MCPcopy
hub / github.com/philc/vimium / parseLines

Function parseLines

background_scripts/commands.js:36–41  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

34// Remove comments and leading/trailing whitespace from a list of lines, and merge lines where the
35// last character on the preceding line is "\".
36function parseLines(text) {
37 return text.replace(/\\\n/g, "")
38 .split("\n")
39 .map((line) => line.trim())
40 .filter((line) => (line.length > 0) && !(Array.from('#"').includes(line[0])));
41}
42
43// Returns the index of the nth occurrence of the regexp in the string. -1 if not found.
44function nthRegexIndex(str, regex, n) {

Callers 2

commands_test.jsFile · 0.90
parseFunction · 0.85

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected