Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return /^[A-Z0-9_]+$/.test(key) ? key : convert(key, options);
});
humps.camelize('hello_world-foo bar');
humps.pascalize('hello_world-foo bar');
humps.decamelize('helloWorldFooBar');
humps.decamelize('helloWorldFooBar', someOptions);
humps.decamelize('helloWorld1', { split: /(?=[A-Z0-9])/ })
humps.depascalize('helloWorldFooBar');
humps.camelizeKeys(someObject);
humps.pascalizeKeys(someObject);
humps.decamelizeKeys(someObject);
humps.depascalizeKeys(someObject);
humps.camelizeKeys(someObject, someOptions);
humps.pascalizeKeys(someObject, someOptions);
humps.decamelizeKeys(someObject, someOptions);
humps.depascalizeKeys(someObject, someOptions);
humps.camelizeKeys(someObject, someOptions2);
humps.pascalizeKeys(someObject, someOptions2);
humps.decamelizeKeys(someObject, someOptions2);
humps.depascalizeKeys(someObject, someOptions2);
humps.camelizeKeys(someObject, someOptions3);
humps.pascalizeKeys(someObject, someOptions3);
humps.decamelizeKeys(someObject, someOptions3);
humps.pascalizeKeys(someObject);
humps.decamelizeKeys(someObject);
humps.depascalizeKeys(someObject);
humps.camelizeKeys(someObject, someOptions);
humps.pascalizeKeys(someObject, someOptions);
humps.decamelizeKeys(someObject, someOptions);
humps.depascalizeKeys(someObject, someOptions);
humps.camelizeKeys(someObject, someOptions2);
humps.pascalizeKeys(someObject, someOptions2);
humps.decamelizeKeys(someObject, someOptions2);
humps.depascalizeKeys(someObject, someOptions2);
humps.camelizeKeys(someObject, someOptions3);
humps.pascalizeKeys(someObject, someOptions3);
humps.decamelizeKeys(someObject, someOptions3);
humps.depascalizeKeys(someObject, someOptions3);
humps.pascalize('hello_world-foo bar');
humps.decamelize('helloWorldFooBar');
humps.decamelize('helloWorldFooBar', someOptions);
humps.decamelize('helloWorld1', { split: /(?=[A-Z0-9])/ })
humps.depascalize('helloWorldFooBar');
humps.camelizeKeys(someObject);
humps.pascalizeKeys(someObject);
humps.decamelizeKeys(someObject);
humps.depascalizeKeys(someObject);
humps.camelizeKeys(someObject, someOptions);
humps.pascalizeKeys(someObject, someOptions);
humps.decamelizeKeys(someObject, someOptions);
humps.depascalizeKeys(someObject, someOptions);
humps.camelizeKeys(someObject, someOptions2);
humps.pascalizeKeys(someObject, someOptions2);
humps.decamelizeKeys(someObject, someOptions2);
humps.depascalizeKeys(someObject, someOptions2);
humps.camelizeKeys(someObject, someOptions3);
humps.pascalizeKeys(someObject, someOptions3);
humps.decamelizeKeys(someObject, someOptions3);
humps.depascalizeKeys(someObject, someOptions3);
humps.decamelize('helloWorld1', { split: /(?=[A-Z0-9])/ })
humps.depascalize('helloWorldFooBar');
humps.camelizeKeys(someObject);
humps.pascalizeKeys(someObject);
humps.decamelizeKeys(someObject);
humps.depascalizeKeys(someObject);
humps.camelizeKeys(someObject, someOptions);
humps.pascalizeKeys(someObject, someOptions);
humps.decamelizeKeys(someObject, someOptions);
humps.depascalizeKeys(someObject, someOptions);
humps.camelizeKeys(someObject, someOptions2);
humps.pascalizeKeys(someObject, someOptions2);
humps.decamelizeKeys(someObject, someOptions2);
humps.depascalizeKeys(someObject, someOptions2);
humps.camelizeKeys(someObject, someOptions3);
humps.pascalizeKeys(someObject, someOptions3);
humps.decamelizeKeys(someObject, someOptions3);
humps.depascalizeKeys(someObject, someOptions3);
}
let { schema, types, query = {}, url, method = 'GET', body = {} } = action;
if (!Array.isArray(types) || types.length !== 3) {
throw new Error('Expected an array of three action types.');
}
const [ LOADING, SUCCESS, ERROR ] = types;
if (!token && LOADING !== AUTH_REQUEST) {
throw new Error('Token has not been initialized');
}
LOADING && next({
type: LOADING,
payload: action,
});
query.token = token;
return callApi(`${url}?${qs(query)}`, { method, body: formData(pascalizeKeys(body)) }, schema)
.then(
(response) => {
const finalAction = {
type: SUCCESS,
payload: {
...response,
},
}
return SUCCESS ? next(finalAction) : finalAction;
},
(error) => {
const finalAction = {
type: ERROR,
meta: {
error,
},