Json Function
Search…
Transform
JSON converts the snake_case keys in your data to camelCase.
Github repository for your stars.

Usage

Install

1
$ npm install json-function
Copied!

Import

1
import { transform } from 'json-function';
Copied!

Usage

Example Data
1
const data = [
2
{
3
id: 1,
4
user_id: 10,
5
skils: [
6
{
7
id: 2,
8
skill_name: 'Skill 1',
9
}
10
],
11
info: {
12
info_address: 'Address',
13
detail: {
14
zip_code: 30000,
15
}
16
}
17
}
18
];
Copied!
Default key
1
transform(data);
Copied!
Output
1
[
2
{
3
id: 1,
4
userId: 10,
5
skils: [
6
{
7
id: 2,
8
skillName: 'Skill 1',
9
}
10
],
11
info: {
12
infoAddress: 'Address',
13
detail: {
14
zipCode: 30000,
15
}
16
}
17
}
18
];
Copied!
Last modified 1yr ago
Copy link
Contents
Usage