MCPcopy Create free account
hub / github.com/TheNetsky/Microsoft-Rewards-Script / parseArgs

Function parseArgs

scripts/utils.js:26–45  ·  view source on GitHub ↗
(argv = process.argv.slice(2))

Source from the content-addressed store, hash-verified

24}
25
26export function parseArgs(argv = process.argv.slice(2)) {
27 const args = {}
28
29 for (let i = 0; i < argv.length; i++) {
30 const arg = argv[i]
31
32 if (arg.startsWith('-')) {
33 const key = arg.substring(1)
34
35 if (i + 1 < argv.length && !argv[i + 1].startsWith('-')) {
36 args[key] = argv[i + 1]
37 i++
38 } else {
39 args[key] = true
40 }
41 }
42 }
43
44 return args
45}
46
47export function validateEmail(email) {
48 if (!email || typeof email !== 'string' || !email.includes('@')) {

Callers 2

clearSessions.jsFile · 0.90
browserSession.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected