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
更多
你可能也喜欢
- 2pg-oauth 中文文档教程
- 4sure-dynamic-forms 中文文档教程
- @0xcert/ethereum-erc20-contracts 中文文档教程
- @1791-labs/object-utilities 中文文档教程
- @21epub/epub-thirdparty 中文文档教程
- @24hr/rawb-content-cache 中文文档教程
- @26brains/throttled-queue-decorator 中文文档教程
- @7util/log-express 中文文档教程
- @9softstudio/react-grid 中文文档教程
- @abrezina/dummy-data 中文文档教程