Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function prepareConfig(_config) {
const pkg = readPackageJSON();
const name = capitalize(camelCase(_config.component.pkgName || pkg.name));
let config = defaults(_config, { alias: pkg.alias });
// component
config.component = defaults(config.component, {
entry: './src/index.js',
pkgName: pkg.name,
name: name,
dependencies: pkg.deps,
src: './src',
lib: './lib',
dist: './dist',
});
config.bump = config.bump || {};
config.bump = defaults(config.bump, {
const columns = fields.map((meta) => {
const { name, description } = meta;
return {
title: description && description.indexOf('title:') !== -1 ? description.split('title:')[1].split('\n')[0] : capitalize(name),
dataIndex: name,
key: name,
...columnHelper(meta, items)
}
});
const names = files.map(inputFileName => {
const baseName = path.basename(inputFileName).replace(/( \(custom\))?\.svg$/, "");
const functionName = capitalize(camelcase(baseName));
const outputComponentFileName = `${functionName}.js`;
return {
inputFileName,
outputComponentFileName,
functionName,
baseName,
};
});
Object.keys(typesToParams).map(type => createElement('option', {
key: type,
value: type,
}, capitalize(type)))
),
render(): React.ReactNode {
const groupScore = this.props.groupScoreByMetricGroupNameMap[this.props.metricGroupName].score;
const humanReadableScore = Number(groupScore.toFixed(2));
const scoreLabel = capitalize(getGroupClassFromScore(groupScore, this.props.thresholds));
const { metricGroupName } = this.props;
return (
<div>
<div>
{/*<div>Name: {metricGroupName}</div>*/}
{/*<div>Score: {humanReadableScore}</div>*/}
{/*<div>Label: {scoreLabel}</div>*/}
</div>
<div>
{this.props.idListByMetricGroupNameMap[this.props.metricGroupName].map(id => {
const canaryAnalysisResult: CanaryAnalysisResult = this.props.canaryAnalysisResultByIdMap[id];
const metricName = canaryAnalysisResult.name;
const metricSetPair: MetricSetPair = this.props.metricSetPairsByIdMap[id];
const canaryMetricConfig: CanaryMetricConfig = ofNullable(
this.props.canaryConfig.metrics.find(canaryMetricConfig => canaryMetricConfig.name === metricName)</div></div>
{map(item =>
<option value="{item}">
{capitalize(item)}
</option>, instruments)}
].map((item) => {
const label = capitalize(item.replace('Give', ''));
return renderItem(label, thing[item] > 0 ? `+${thing[item]}` : null);
});
render() {
const { pack, prefix } = this.props;
const prefixUp = capitalize(prefix);
const iconPackName = <strong>{prefixUp}IconPack</strong>
return (
<div>
<h1> {pack.name} </h1>
<h4> {pack.attribution} </h4>
<code>import {iconPackName} from 'react-icons/lib/{prefix}'</code>
<div>
{Object.keys(pack.icons).map((iconName, index) => {
let Icon = pack.icons[iconName];
let realIconName = decamelize(iconName.replace(new RegExp('^'+prefixUp), ''), '-')
return (
<div>
<div>{iconName}</div>
<div style="{{fontSize:">
<code>{`react-icons/lib/${prefix}/${realIconName}`}</code></div></div></div></div>
const getTitleFromFlags = (flags) => {
const optionLong = flags.match(/--[a-z0-9-_]+/)[0];
const optionLower = optionLong.replace('--', '').replace('-', ' ');
return capitalize(optionLower);
};