Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let commanderName = this._controllerName.split('/').map(commanderNamePart => {
commanderNamePart = `${ camelize(commanderNamePart) }`;
commanderNamePart = commanderNamePart.charAt(0).toUpperCase() + commanderNamePart.slice(1);
return commanderNamePart;
}).join('::').concat('Commander');
children.forEach(child => {
if (child.reducer) {
this.reducers[camelize(name)] = child.reducer;
this.reducerHandler(this.reducers);
}
if (child.saga) {
this.sagaHandler(child.saga);
}
});
}
objectEntries(imgixParams.parameters).forEach(([param, doc]) => {
fields[camelize(param)] = {
type:
doc.expects.length === 1 ? mappings[doc.expects[0].type] : GraphQLString,
description: `${doc.short_description} (${doc.url})`,
};
});
async function deserializeRelationship(resource = {}, store) {
const type = pluralize.singular(resource.type);
const {api} = store.getState();
if (api[camelize(type)] && api[camelize(type)][resource.id]) {
return deserialize({ ...api[camelize(type)][resource.id], meta: { loaded: true } }, api);
}
const req = (await store.dispatch(
apiActions.read(
{
id:resource.id,
_type:pluralize.plural(resource.type)
}
)
));
return deserialize(
req.resources[0],
store
);
//return deserialize({ ...resource, meta: { loaded: false } }, api);
export const selectArtistInviteSubmissions = state =>
state.json.get(camelize(ARTIST_INVITE_SUBMISSIONS), Immutable.Map())
return async function(args, trx) {
try {
let ret = await selector(args, trx);
ret = _.filter(ret, r => r[options.elemField] !== null);
if (!args.ids) {
args.ids = _.uniq(_.map(ret, r => r[options.collectionField]));
}
ret = camelizeKeys(ret);
ret = orderedFor(ret, args.ids, camelize(options.collectionField), false);
return ret;
} catch (e) {
log.error(`Error in ${options.table}.getManyRelationAdapter(${options.elemField},${options.collectionField})`, e);
throw e;
}
};
}
return concepts.reduce((memo, concept) => {
memo.set(camelize(concept.slug), concept)
return memo
}, new Map())
}
Object.entries(imgixParams.parameters).forEach(([param, doc]) => {
fields[camelize(param)] = {
type: doc.expects.length === 1 ? mappings[doc.expects[0].type] : GraphQLString,
description: `${doc.short_description} (${doc.url})`
};
});
entity.itemType.fields.forEach(field => {
addField(
node,
camelize(field.apiKey),
entity,
field,
node,
entitiesRepo,
i18n,
additionalNodesToCreate,
);
if (field.localized) {
node[`_all${pascalize(field.apiKey)}Locales`] = entries(
entity[camelize(field.apiKey)] || {},
).map(([locale, v]) => {
const result = { locale };
const innerI18n = { locale, fallbacks: localeFallbacks };
addField(
renderHelp() {
const { submitting, data, formInput, field: { value } } = this.props
const message = data
? formatMessage(messages.username[camelize(data.reasonInvalid || 'success')], formInput)
: undefined
return(
<div>
{ submitting ?
<p>Checking availability...</p> :
data ?
<div>{message}</div> :
<p>Use between 2 and 12 numbers, letters, hypens, underscores, and dots.</p>
}
</div>
)
}
}