2-camel-case 中文文档教程
2-camel-case
将任何嵌套级别的对象或数组转换为驼峰式样式
Installation
$ npm install 2-camel-case
或
$ yarn add 2-camel-case
Example
import toCamelCase from '2-camel-case';
toCamelCase({
first_name: 'Ivan',
middle_name: 'Ivanovich',
last_name: 'Ivanov',
});
/*
return {
firstName: 'Ivan',
middleName: 'Ivanovich',
lastName: 'Ivanov',
}
*/
toCamelCase([
{
first_name: 'Ivan',
middle_name: 'Ivanovich',
last_name: 'Ivanov',
},
]);
/*
return [
{
firstName: 'Ivan',
middleName: 'Ivanovich',
lastName: 'Ivanov',
},
]
*/
API
toCameCase(data)
data
类型:array | 对象
2-camel-case
Converting an object or array of any nesting level to camelcase style
Installation
$ npm install 2-camel-case
or
$ yarn add 2-camel-case
Example
import toCamelCase from '2-camel-case';
toCamelCase({
first_name: 'Ivan',
middle_name: 'Ivanovich',
last_name: 'Ivanov',
});
/*
return {
firstName: 'Ivan',
middleName: 'Ivanovich',
lastName: 'Ivanov',
}
*/
toCamelCase([
{
first_name: 'Ivan',
middle_name: 'Ivanovich',
last_name: 'Ivanov',
},
]);
/*
return [
{
firstName: 'Ivan',
middleName: 'Ivanovich',
lastName: 'Ivanov',
},
]
*/
API
toCameCase(data)
data
Type: array | object
更多
你可能也喜欢
- 7zip-bin-wrapper 中文文档教程
- @10xjs/date-input-controller 中文文档教程
- @1ky/word_diff 中文文档教程
- @36node/koa-health 中文文档教程
- @51npm/freedom-middleware-mock2easy 中文文档教程
- @5app/opengraph-scraper 中文文档教程
- @aarongray.org/xlsx-workbook 中文文档教程
- @abcum/ember-charts 中文文档教程
- @abeai/pino-websocket 中文文档教程
- @abhisheknairofficial/use-markdown 中文文档教程