You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.
@@ -115,15 +169,17 @@ type Options = {
115
169
```
116
170
import camelcaseKeys from 'camelcase-keys';
117
171
118
-
camelcaseKeys({
172
+
const object = {
119
173
a_b: 1,
120
174
a_c: {
121
175
c_d: 1,
122
176
c_e: {
123
177
e_f: 1
124
178
}
125
179
}
126
-
}, {
180
+
};
181
+
182
+
camelcaseKeys(object, {
127
183
deep: true,
128
184
stopPaths: [
129
185
'a_c.c_e'
@@ -141,21 +197,6 @@ type Options = {
141
197
```
142
198
*/
143
199
readonlystopPaths?: readonlystring[];
144
-
145
-
/**
146
-
Uppercase the first character as in `bye-bye` → `ByeBye`.
Exclude children at the given object paths in dot-notation from being camel-cased. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.
120
+
Exclude children at the given object paths in dot-notation from being camel-cased.
121
+
122
+
For example, with an object like `{a: {b:'🦄'}}`, the object path to reach the unicorn is `'a.b'`.
79
123
80
124
```js
81
-
camelcaseKeys({
125
+
importcamelcaseKeysfrom'camelcase-keys';
126
+
127
+
constobject= {
82
128
a_b:1,
83
129
a_c: {
84
130
c_d:1,
85
131
c_e: {
86
132
e_f:1
87
133
}
88
134
}
89
-
}, {
135
+
};
136
+
137
+
camelcaseKeys(object, {
90
138
deep:true,
91
139
stopPaths: [
92
140
'a_c.c_e'
@@ -105,27 +153,6 @@ camelcaseKeys({
105
153
*/
106
154
```
107
155
108
-
##### deep
109
-
110
-
Type: `boolean`\
111
-
Default: `false`
112
-
113
-
Recurse nested objects and objects in arrays.
114
-
115
-
##### pascalCase
116
-
117
-
Type: `boolean`\
118
-
Default: `false`
119
-
120
-
Uppercase the first character as in `bye-bye` → `ByeBye`.
121
-
122
-
##### preserveConsecutiveUppercase
123
-
124
-
Type: `boolean`\
125
-
Default: `false`
126
-
127
-
Preserve consecutive uppercase characters: `foo-BAR` → `FooBAR` if true vs `foo-BAR` → `FooBar` if false
128
-
129
156
## Related
130
157
131
158
-[decamelize-keys](https://github.com/sindresorhus/decamelize-keys) - The inverse of this package
0 commit comments