Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createConfig(srcDir)
]);
if (isGit && hasIgnore) {
const pattern = /^\.intl\/?\s*$/gm;
if (!(await inGitIgnore(pattern))) {
const ignore = '.intl/';
const header = '# Intl generated schemas (https://intljs.com/docs/schemas)';
await addToGitIgnore(header, ignore);
};
}
const { language, phrase } = greeting();
const time = printDuration(Date.now() - startTime);
console.log(`\n ${bold(phrase)} ${dim(`(that's "Hello world!" in ${italic(language)})`)}
${green('✔')} Project initialized ${dim(time)}
${dim('Next steps:')}
${dim(terminalPrompt())} ${green('intl add ')}
${dim(terminalPrompt())} ${green(`cd ${srcDir}`)}
`)
}
_getUsage(cmd) {
let help = `${c.bold('USAGE')}\n\n ${c.italic(this._program.bin())} `;
if (cmd) {
help += colorize(this._getCommandHelp(cmd));
} else {
help += colorize(' [options]');
}
return help;
}
const applySingleStyle = memoize((key: string, value: string, text: string) => {
switch (key) {
case 'fontWeight':
return value === 'bold' ? colorette.bold(text) : text;
case 'fontStyle':
return value === 'italic' ? colorette.italic(text) : text;
case 'textDecoration': {
switch (value) {
case 'line-through':
return colorette.strikethrough(text);
case 'underline':
return colorette.underline(text);
default:
return text;
}
}
case 'textTransform': {
switch (value) {
case 'uppercase':
return text.toUpperCase();
case 'lowercase':
return text.toLowerCase();
constructor(option, command, program) {
const suggestions = getSuggestions(option, command._getLongOptions());
let msg = `Unknown option ${c.italic(getDashedOption(option))}.`;
if (suggestions.length) {
msg += ' Did you mean ' + suggestions.map(
s => '--' + getBoldDiffString(option, s)
).join(' or maybe ') + ' ?';
}
super(msg, {option, command}, program);
}
}
constructor(option, command, program) {
let msg = `Missing option ${c.italic(getDashedOption(option))}.`;
super(msg, {option, command}, program);
}
}
constructor(arg, value, command, originalError, program) {
let msg = `Invalid value '${value}' for argument ${c.italic(arg)}.\n ${originalError.meta.originalError}`;
super(msg, {arg, command, value}, program);
}
}
constructor(option, value, command, originalError, program) {
const displayedValue = typeof value === "boolean" && value === true ? '(empty)' : `'${value}'`
const originalMessage = originalError.meta.error ? originalError.meta.error.message : ""
let msg = `Invalid value ${displayedValue} for option ${c.italic(getDashedOption(option))}. ${originalMessage}`;
super(msg, {option, command, originalError}, program);
}
}