MCPcopy Create free account
hub / github.com/ahmadawais/create-node-cli / validate

Function validate

utils/ask.js:33–43  ·  view source on GitHub ↗
(value, state)

Source from the content-addressed store, hash-verified

31 initial,
32 history,
33 validate(value, state) {
34 if (state && state.name === `command`) return true;
35 if (state && state.name === `name`) {
36 if (existsSync(value)) {
37 return `Directory already exists: ./${value}`;
38 } else {
39 return true;
40 }
41 }
42 return !value ? `Please add a value.` : true;
43 }
44 })
45 .on(`cancel`, () => shouldCancel())
46 .run();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected