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 props = {};
for (const prop of CSS_PROPS_TO_TRACE_AND_TEXT) {
props[prop] = hypotheticalValueByProp[prop].value;
}
// Apply text-transform:
const textTransform = props['text-transform'];
if (
textTransform !== 'none' &&
!hypotheticalValueByProp.text.isListIndicator
) {
if (textTransform === 'uppercase') {
props.text = props.text.toUpperCase();
} else if (textTransform === 'lowercase') {
props.text = props.text.toLowerCase();
} else if (textTransform === 'capitalize') {
props.text = capitalize.words(props.text);
}
}
return props;
})
.filter(function filterAndDeduplicate(textWithProps) {
for (var i in sass) {
if (sass[i].length === 0) delete sass[i];
}
// Get a list of all groups
groupList = Object.keys(sass);
// Sort groups by user-defined categories
for (var i in sort) {
var index = groupList.indexOf(sort[i]);
groupList = move(groupList, index, 0);
}
// Finally, build a new object with the sorted groups
for (var i in groupList) {
var group = groups[groupList[i]] || capitalize.words(groupList[i].replace('-', ' '));
sassSorted[group] = sass[groupList[i]];
}
return sassSorted;
}
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);
});