Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
) : null
})
if (issue.additionalFileCount > 0) {
subErrors.push(
<div>
<span>
and {issue.additionalFileCount} more{' '}
{pluralize('files', issue.additionalFileCount)}
</span>
</div>,
)
}
// issue panel
return (
{subErrors}
)
})
if (argv['--all']) {
await Promise.all(
deployments.map(async ({ uid, instanceCount }, i) => {
deployments[i].instances =
instanceCount > 0 ? await now.listInstances(uid) : [];
})
);
}
if (host) {
deployments = deployments.filter(deployment => deployment.url === host);
}
stopSpinner();
log(
`Fetched ${plural(
'deployment',
deployments.length,
true
)} under ${chalk.bold(contextName)} ${elapsed(Date.now() - start)}`
);
// we don't output the table headers if we have no deployments
if (!deployments.length) {
return 0;
}
// information to help the user find other deployments or instances
if (app == null) {
log(
`To list more deployments for a project run ${cmd('now ls [project]')}`
);
fontSize: 12,
opacity: 0.5
}}
>
<div>{run.errorMessage}</div>
)}
{run &&
run.duration && (
<em style="{{">
{`${pluralize('row', run.rowCount, true)} in ${ms(run.duration * 1000, {
long: true
})}`}
</em>
)}
);
}
}
const fromForger: boolean = isWhitelisted(app.resolveOptions("p2p").remoteAccess, req.headers.remoteAddress);
if (!fromForger) {
if (blockchain.pingBlock(block)) {
return;
}
const lastDownloadedBlock: Interfaces.IBlockData = blockchain.getLastDownloadedBlock();
if (!isBlockChained(lastDownloadedBlock, block)) {
throw new UnchainedBlockError(lastDownloadedBlock.height, block.height);
}
}
app.resolvePlugin("logger").info(
`Received new block at height ${block.height.toLocaleString()} with ${pluralize(
"transaction",
block.numberOfTransactions,
true,
)} from ${mapAddr(req.headers.remoteAddress)}`,
);
blockchain.handleIncomingBlock(block, fromForger);
};
return mappings.map((mapping: any) => ({
model: mapping.model,
plural: pluralize(lowerCase(mapping.model)),
findOne: mapping.findSingle || mapping.findOne,
findMany: mapping.findMany,
create: mapping.createOne || mapping.createSingle || mapping.create,
delete: mapping.deleteOne || mapping.deleteSingle || mapping.delete,
update: mapping.updateOne || mapping.updateSingle || mapping.update,
deleteMany: mapping.deleteMany,
updateMany: mapping.updateMany,
upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert,
aggregate: mapping.aggregate,
}))
}
private printStats(): void {
const stats: string = ["accept", "broadcast", "excess", "invalid"]
.map(prop => `${prop}: ${this[prop] instanceof Array ? this[prop].length : this[prop].size}`)
.join(" ");
app.resolvePlugin("logger").info(
`Received ${pluralize("transaction", this.transactions.length, true)} (${stats}).`,
);
}
}
public async getTransactionsForForging(): Promise {
const response: P2P.IForgingTransactions = await this.client.getTransactions();
if (isEmpty(response)) {
this.logger.error("Could not get unconfirmed transactions from transaction pool.");
return [];
}
const transactions: Interfaces.ITransactionData[] = response.transactions.map(
(hex: string) => Transactions.TransactionFactory.fromBytesUnsafe(Buffer.from(hex, "hex")).data,
);
this.logger.debug(
`Received ${pluralize("transaction", transactions.length, true)} from the pool containing ${
response.poolSize
}`,
);
return transactions;
}
<menuitem value="hour">{pluralize('Hours', Number(number))}</menuitem>
<menuitem value="day">{pluralize('Days', Number(number))}</menuitem>
<menuitem value="week">{pluralize('Weeks', Number(number))}</menuitem>
);
Object.keys(typeMap).forEach(name => {
if (name.indexOf('_') > -1 || name === 'Query') return
let type = typeMap[name]
if (!(type instanceof GraphQLObjectType)) return
type = transformType(client, type, mutations)
type._interfaces.push(node.nodeInterface)
let singular = lowerCamelCase(name)
queries[singular] = getQueryField(client, type)
queries[pluralize(singular)] = getConnectionField(client, type, true)
Object.assign(mutations, getTypeMutations(client, type))
queries['node'] = node.nodeField
})
return new GraphQLSchema({
let data = {
digest,
logoUrl: Meteor.absoluteUrl('images/logo.png')
};
let source = Assets.getText('email/notification.html');
let template = Handlebars.compile(source);
let html = template(data);
let inlinedHtml = juice(html);
return {
html: inlinedHtml,
text: htmlToText.fromString(inlinedHtml, {
tables: [ '.body-wrap', '.footer-wrap' ]
}),
subject: `RemoteBase | ${pluralize('alert', digest.length, true)}`
};
}