本文整理汇总了TypeScript中humps.camelizeKeys函数的典型用法代码示例。如果您正苦于以下问题:TypeScript camelizeKeys函数的具体用法?TypeScript camelizeKeys怎么用?TypeScript camelizeKeys使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了camelizeKeys函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: fetchOptionsWithDebug
export async function callApi<T = void>(
fetchOptions: KFetchOptions,
{ camelcase = true, prependBasePath = true } = {}
): Promise<T> {
const combinedFetchOptions = fetchOptionsWithDebug(fetchOptions);
const res = await kfetch(combinedFetchOptions, { prependBasePath });
return camelcase ? camelizeKeys(res) : res;
}
开发者ID:gingerwizard,项目名称:kibana,代码行数:8,代码来源:callApi.ts
示例2: dispatch
.subscribe(responce => {
let body = responce.json();
body = humps.camelizeKeys(body);
if (body.status === `OK`) {
dispatch(this.SET_ENTITIES(body.results));
} else {
console.error('FETCH_ENTITIES', body.results);
}
}, error => console.error('FETCH_ENTITIES', error));
开发者ID:KulikovskyIgor,项目名称:sport-route,代码行数:9,代码来源:explore-page-actions.ts
示例3: normalize
protected normalize(response, schema) {
let camelizedJson = camelizeKeys(response);
let normalizedResponse = normalize(camelizedJson, schema);
return {
result: fromJS(normalizedResponse.result),
entities: fromJS(normalizedResponse.entities)
};
}
开发者ID:dghijben,项目名称:dashboard,代码行数:11,代码来源:Api.ts
示例4: function
split: /^[A-Z0-9_]+$/
};
let someOptions3: humps.HumpsOptions = {
separator: '-',
process: function (key: string, convert: humps.HumpsProcessorParameter, options: humps.HumpsOptions) {
return /^[A-Z0-9_]+$/.test(key) ? key : convert(key, options);
}
};
humps.camelize('hello_world')
humps.decamelize('fooBar')
humps.decamelize('fooBarBaz', someOptions)
humps.camelizeKeys(someObject);
humps.camelizeKeys(someArray);
humps.camelizeKeys(someObject, function (key, convert) {
return /^[A-Z0-9_]+$/.test(key) ? key : convert(key);
});
humps.decamelizeKeys(someObject, function (key, convert, options) {
return /^[A-Z0-9_]+$/.test(key) ? key : convert(key, options);
});
humps.camelize('hello_world-foo bar');
humps.pascalize('hello_world-foo bar');
开发者ID:AbraaoAlves,项目名称:DefinitelyTyped,代码行数:31,代码来源:humps-tests.ts
注:本文中的humps.camelizeKeys函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论