File tree 6 files changed +160
-0
lines changed
lib/node_modules/@stdlib/utils
6 files changed +160
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ // TypeScript Version: 2.0
20
+
21
+ /**
22
+ * Converts the first letter of each object key to uppercase.
23
+ *
24
+ * ## Notes
25
+ *
26
+ * - The function only transforms own properties. Hence, the function does not transform inherited properties.
27
+ * - The function shallow copies key values.
28
+ *
29
+ * @param obj - source object
30
+ * @returns new object
31
+ *
32
+ * @example
33
+ * var obj1 = {
34
+ * 'aa': 1,
35
+ * 'bb': 2
36
+ * };
37
+ *
38
+ * var obj2 = capitalizeKeys( obj1 );
39
+ * // returns { 'Aa': 1, 'Bb': 2 }
40
+ */
41
+ declare function capitalizeKeys ( obj : Object ) : Object ;
42
+
43
+
44
+ // EXPORTS //
45
+
46
+ export = capitalizeKeys ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import capitalizeKeys = require( './index' ) ;
20
+
21
+
22
+ // TESTS //
23
+
24
+ // The function returns an object...
25
+ {
26
+ capitalizeKeys ( { 'a' : 1 , 'b' : 2 } ) ; // $ExpectType Object
27
+ }
28
+
29
+ // The compiler throws an error if the function is provided an incorrect number of arguments...
30
+ {
31
+ capitalizeKeys ( ) ; // $ExpectError
32
+ capitalizeKeys ( [ ] , 2 ) ; // $ExpectError
33
+ }
Original file line number Diff line number Diff line change 21
21
"lib" : " ./lib" ,
22
22
"test" : " ./test"
23
23
},
24
+ "types" : " ./docs/types" ,
24
25
"scripts" : {},
25
26
"homepage" : " https://github.com/stdlib-js/stdlib" ,
26
27
"repository" : {
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ // TypeScript Version: 2.0
20
+
21
+ /**
22
+ * Converts the first letter of each object key to lowercase.
23
+ *
24
+ * ## Notes
25
+ *
26
+ * - The function only transforms own properties. Hence, the function does not transform inherited properties.
27
+ * - The function shallow copies key values.
28
+ *
29
+ * @param obj - source object
30
+ * @returns new object
31
+ *
32
+ * @example
33
+ * var obj1 = {
34
+ * 'AA': 1,
35
+ * 'BB': 2
36
+ * };
37
+ *
38
+ * var obj2 = uncapitalizeKeys( obj1 );
39
+ * // returns { 'aA': 1, 'bB': 2 }
40
+ */
41
+ declare function uncapitalizeKeys ( obj : Object ) : Object ;
42
+
43
+
44
+ // EXPORTS //
45
+
46
+ export = uncapitalizeKeys ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import uncapitalizeKeys = require( './index' ) ;
20
+
21
+
22
+ // TESTS //
23
+
24
+ // The function returns an object...
25
+ {
26
+ uncapitalizeKeys ( { 'a' : 1 , 'b' : 2 } ) ; // $ExpectType Object
27
+ }
28
+
29
+ // The compiler throws an error if the function is provided an incorrect number of arguments...
30
+ {
31
+ uncapitalizeKeys ( ) ; // $ExpectError
32
+ uncapitalizeKeys ( [ ] , 2 ) ; // $ExpectError
33
+ }
Original file line number Diff line number Diff line change 21
21
"lib" : " ./lib" ,
22
22
"test" : " ./test"
23
23
},
24
+ "types" : " ./docs/types" ,
24
25
"scripts" : {},
25
26
"homepage" : " https://github.com/stdlib-js/stdlib" ,
26
27
"repository" : {
You can’t perform that action at this time.
0 commit comments