• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nebrelbug / npm-to-yarn / 7935249420

pending completion
7935249420

push

github

nebrelbug
chore: build

174 of 179 branches covered (97.21%)

Branch coverage included in aggregate %.

291 of 294 relevant lines covered (98.98%)

134.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/command.ts
1
export function parse (command: string) {
6✔
2
  const args: string[] = []
1,038✔
3
  let lastQuote: string | false = false
1,038✔
4
  let escaped = false
1,038✔
5
  let part = ''
1,038✔
6
  for (let i = 0; i < command.length; ++i) {
1,038✔
7
    const char = command.charAt(i)
15,690✔
8
    if (char === '\\') {
15,690✔
9
      part += char
18✔
10
      escaped = true
18✔
11
    } else {
12
      if (char === ' ' && !lastQuote) {
15,672✔
13
        args.push(part)
1,209✔
14
        part = ''
1,209✔
15
      } else if (!escaped && (char === '"' || char === "'")) {
14,463✔
16
        part += char
132✔
17
        if (char === lastQuote) {
132✔
18
          lastQuote = false
63✔
19
        } else if (!lastQuote) {
69✔
20
          lastQuote = char
63✔
21
        }
22
      } else {
23
        part += char
14,331✔
24
      }
25
      escaped = false
15,672✔
26
    }
27
  }
28
  args.push(part)
1,038✔
29
  return args
1,038✔
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc