Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const rows = swaps.map(swap => [
formatDate(swap.timeStarted, 'YYYY-MM-DD HH:mm:ss'), // The most Excel compatible datetime format
`${swap.baseCurrency}/${swap.quoteCurrency}`,
title(swap.orderType),
`${swap.baseCurrencyAmount} ${swap.baseCurrency}`,
`${swap.quoteCurrencyAmount} ${swap.quoteCurrency}`,
title(swap.statusFormatted),
getTXID(swap, 'myfee'),
getTXID(swap, 'alicepayment'),
getTXID(swap, 'alicespend'),
]);
const updateTouchBar = () => {
portfolioValue.label = `${appContainer.state.portfolio.name}: ${dashboardContainer.assetCount} ≈ ${dashboardContainer.totalAssetValueFormatted}`;
const swap = getLatestSwap();
latestSwap.label = swap ? `${swap.baseCurrency}/${swap.quoteCurrency} ${t(`details.${swap.orderType}`)} ${t('details.order')}: ${title(swap.statusFormatted)}` : '';
latestSwap.textColor = swap ? (
(swap.status === 'completed' && '#28af60' /* => var(--success-color) */) ||
(swap.status === 'failed' && '#f80759' /* => var(--error-color) */)
) : null;
};
const prepareState = state => title(state.replace('_', ' '));
let content = '';
if (sectionTitle === 'builds') {
content = (sectionContent as BuildResource[])
.map(prettyPrintBuilds)
.join(`\n\n`);
} else if (sectionTitle === 'environments') {
content = (sectionContent as EnvironmentResource[])
.map(prettyPrintEnvironment)
.join('\n\n');
} else if (sectionTitle === 'services') {
content = (sectionContent as ServiceResource[])
.map(prettyPrintServices)
.join('\n\n');
} else if (sectionTitle === 'variables') {
const data = sectionContent as VariablesContent;
sectionHeader = chalk`{cyan.bold ${title(
sectionTitle
)}} {dim for environment ${data.environmentSid}}`;
content = prettyPrintVariables(data);
} else if (sectionTitle === 'functions' || sectionTitle === 'assets') {
const data = sectionContent as FunctionOrAssetContent;
sectionHeader = chalk`{cyan.bold ${title(
sectionTitle
)}} {dim for environment ${data.environmentSid}}`;
content = prettyPrintFunctionsOrAssets(data);
}
const output = stripIndent`
${sectionHeader}\n\n${content}\n\n\n
`;
return output;
}
const { value } = event.target
const input = this.handler.input
const idx = input.selectionStart
const { replacingWithPaste } = this.state
const caretPosition = () => {
if (replacingWithPaste) {
input.selectionStart = 0
input.selectionEnd = input.value.length
} else {
input.selectionStart = input.selectionEnd = idx
}
}
this.setState({
replacingWithPaste: false,
value: toTitle(value)
}, caretPosition)
event.preventDefault()
}
`Do you mean ${code('build')} (object) with a property ${code(
'env'
)} (object) instead of ${code(prop)}?`
);
}
return 1;
}
if (keyword === 'type') {
const prop = dataPath.substr(1, dataPath.length);
output.error(
`The property ${code(prop)} in ${highlight(
'now.json'
)} can only be of type ${code(title(params.type))}.`
);
return 1;
}
output.error(
`Failed to validate ${highlight(
'now.json'
)}: ${message}\nDocumentation: ${
link('https://zeit.co/docs/v2/advanced/configuration')
}`
);
return 1;
}
if (error instanceof TooManyRequests) {
render() {
const {
children,
title = 'The Gluten Project',
description,
router,
searchState,
searchResults,
} = this.props
const htmlTitle = searchState.query
? `${searchResults && searchResults.nbHits} Certified Gluten-Free ${titleize(
searchState.query
)} (safe for Celiac) | The Gluten Project`
: title
const htmlDescription = searchState.query
? `We've compiled the entire list of all certified gluten-free ${
searchState.query
} products in one place. Additionally, we have where to buy the product, ingredient lists, and reviews. This is your one-stop shop for everything gluten-free.`
: description
const socialTitle = htmlTitle.replace(/ \| The Gluten Project$/, '')
return (
`Do you mean ${code('build')} (object) with a property ${code(
'env'
)} (object) instead of ${code(prop)}?`
);
}
return 1;
}
if (keyword === 'type') {
const prop = dataPath.substr(1, dataPath.length);
output.error(
`The property ${code(prop)} in ${highlight(
'now.json'
)} can only be of type ${code(title(params.type))}.`
);
return 1;
}
output.error(
`Failed to validate ${highlight(
'now.json'
)}: ${message}\nDocumentation: ${link(
'https://zeit.co/docs/v2/advanced/configuration'
)}`
);
return 1;
}
if (error instanceof TooManyRequests) {
export default (text) =>
title(text, {
special: [
'1Password',
'About',
'API',
'APIs',
'CircleCI',
'CSS',
'dart_dev',
'GraphQL',
'HDD',
'iPhone',
'iTerm',
'MDX',
'OverReact',
'QC35',
'UI',