Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getPropertyName = propName => {
const isCustomProp = /^--\w+/.test(propName)
if (isCustomProp) {
return propName
}
return camelizeStyleName(propName)
}
function ensureDefaultsForLocation(location) {
const defaultLocation =
R.merge(LOCATION_SCHEMA, camelize(location))
const defaultServices = defaultLocation.services
if (defaultServices) {
Object.keys(defaultServices).forEach(serviceId => {
defaultServices[serviceId] = ensureDefaultsForService(defaultServices[serviceId])
})
}
return R.merge(defaultLocation, { services: defaultServices })
}
.then(location => ensureDefaultsForLocation(camelize(location)))
}
parseArgs(argv) {
const comalUnknownOptionNames = [];
const minimistOpts = argsWithComalOpts(comalCoreOptions, {
...this.opts,
default: {...this.defaults, ...this.opts.default},
unknown(arg) {
const match = /^--([^=]+)=/.exec(arg) || /^--(?:no-)?(.+)/.exec(arg);
if (match) comalUnknownOptionNames.push(match[1]);
}
});
const args = this.args = subarg(argv, minimistOpts);
this.comalOpts = camelize(pick(args, comalCoreOptionNames, comalUnknownOptionNames));
}
.then(knowns => {
store.dispatch(actions.replaceKnowns(camelize(knowns)));
});
function ensureDefaultsForOrganization(organization) {
return R.merge(ORGANIZATION_SCHEMA, camelize(organization))
}
.then(json =>
this.setState({
results: camelize(json.results),
isQuerying: false,
queryFailed: false,
})
);
json => ({ json: camelize(json) }),
error => ({ error }))