Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async () => {
try {
const json = await jokeRequest;
const { joke } = JSON.parse(json).value;
const wrap = wordwrap(size.width - 10);
const wrapped = wrap(`Good work now enjoy this joke. You deserve it!\n\n${joke}\n\n` + //eslint-disable-line
chalk.grey('If you want to disable these jokes run: \n' +
'> ./node_modules/.bin/jira-precommit jokes disable'));
console.log(boxen(
wrapped,
{
padding: 1,
margin: 1
}
));
} catch (err) {} // eslint-disable-line
};
}
export function stringifyDictionaryEntry(entry: WordType): string {
// let js-yaml handle dumping the word, just in case
let initialData = jsYaml.safeDump({word: entry.word}, {flowLevel: 4})
let definition = `definition: |
${wrap(2, 80)(entry.definition)}
`
return `${initialData}${definition}`
}
async function _promptForAppleId({ appleId }: Options): Promise {
const wrap = wordwrap(process.stdout.columns || 80);
log(
wrap(
'Please enter your Apple Developer Program account credentials. ' +
'These credentials are needed to manage certificates, keys and provisioning profiles ' +
'in your Apple Developer account.'
)
);
log(wrap(chalk.bold('The password is only used to authenticate with Apple and never stored.')));
const { appleId: promptAppleId } = await prompt(
{
type: 'input',
name: 'appleId',
message: `Apple ID:`,
validate: nonEmptyInput,
async function _promptForAppleId({ appleId }) {
const wrap = wordwrap(process.stdout.columns || 80);
log(
wrap(
'Please enter your Apple Developer Program account credentials. ' +
'These credentials are needed to manage certificates, keys and provisioning profiles ' +
'in your Apple Developer account.'
)
);
log(wrap(chalk.bold('The password is only used to authenticate with Apple and never stored.')));
if (!appleId) {
({ appleId } = await prompt(
{
type: 'input',
name: 'appleId',
message: `Apple ID:`,
choices: FEATURED_TEMPLATES.map(template => {
if (typeof template === 'string') {
return prompt.separator(template);
} else {
return {
value: template.name,
name:
chalk.bold(padEnd(template.shortName, descriptionColumn)) +
trimStart(
wordwrap(
descriptionColumn + 2,
process.stdout.columns || 80
)(template.description)
),
short: template.name,
};
}
}),
},
constructor(scene, config, font, antique, emitter) {
this.emitter = emitter;
this.scene = scene;
this.font = font;
this.config = config;
this.wrap = wrap(CHAR_LIMIT);
this.buttons = {};
this.antique = antique;
this.messageGroup = new Group();
this.intersectedButton = null;
this.scene.add(this.messageGroup);
this.setMessage('waiting');
this.showMessage();
this.crazyGroup = new Group();
this.scene.add(this.crazyGroup);
this.buttons[config.rainbowText] = new Button(this.crazyGroup, this.font, config.rainbowText, 0, 2, this.emitter, 0.7 * 100, 0.2 * 100, 0.01 * 100, 0.04 * 100);
this.buttons[config.rainbowText].buttonGroup.position.z = 200;
this.buttons[config.rainbowText].buttonGroup.rotation.y = Math.PI;
}
export const printServerInfo = async (projectDir, options = {}) => {
if (options.webOnly) {
Webpack.printConnectionInstructions(projectDir);
printHelp();
return;
}
const url = await UrlUtils.constructManifestUrlAsync(projectDir);
const username = await UserManager.getCurrentUsernameAsync();
log.newLine();
log.nested(` ${u(url)}`);
log.newLine();
urlOpts.printQRCode(url);
const wrap = wordwrap(2, process.stdout.columns || 80);
const wrapItem = wordwrap(4, process.stdout.columns || 80);
const item = text => ' \u2022 ' + trimStart(wrapItem(text));
const iosInfo = process.platform === 'darwin' ? `, or ${b('i')} for iOS simulator` : '';
log.nested(wrap(u('To run the app with live reloading, choose one of:')));
if (username) {
log.nested(
item(
`Sign in as ${i(
'@' + username
)} in Expo client on Android or iOS. Your projects will automatically appear in the "Projects" tab.`
)
);
}
log.nested(item(`Scan the QR code above with the Expo app (Android) or the Camera app (iOS).`));
log.nested(item(`Press ${b`a`} for Android emulator${iosInfo}.`));
log.nested(item(`Press ${b`e`} to send a link to your phone with email.`));
export const printServerInfo = async (projectDir, options = {}) => {
if (options.webOnly) {
Webpack.printConnectionInstructions(projectDir);
printHelp();
return;
}
const url = await UrlUtils.constructManifestUrlAsync(projectDir);
const username = await UserManager.getCurrentUsernameAsync();
log.newLine();
log.nested(` ${u(url)}`);
log.newLine();
urlOpts.printQRCode(url);
const wrap = wordwrap(2, process.stdout.columns || 80);
const wrapItem = wordwrap(4, process.stdout.columns || 80);
const item = text => ' \u2022 ' + trimStart(wrapItem(text));
const iosInfo = process.platform === 'darwin' ? `, or ${b('i')} for iOS simulator` : '';
log.nested(wrap(u('To run the app with live reloading, choose one of:')));
if (username) {
log.nested(
item(
`Sign in as ${i(
'@' + username
)} in Expo client on Android or iOS. Your projects will automatically appear in the "Projects" tab.`
)
);
}
log.nested(item(`Scan the QR code above with the Expo app (Android) or the Camera app (iOS).`));
log.nested(item(`Press ${b`a`} for Android emulator${iosInfo}.`));
log.nested(item(`Press ${b`e`} to send a link to your phone with email.`));
if (!username) {