@pixpilot/object 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
# @pixpilot/object
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A collection of utility functions for working with JavaScript objects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @pixpilot/object
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { keysToCamelCase, keysToSnakeCase } from '@pixpilot/object';
|
|
15
|
+
|
|
16
|
+
// Example: Convert object keys between camelCase and snake_case
|
|
17
|
+
const obj = { user_name: 'john', user_details: { first_name: 'John', last_name: 'Doe' } };
|
|
18
|
+
const camelCaseObj = keysToCamelCase(obj);
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
### `keysToCamelCase(obj: any): any`
|
|
24
|
+
|
|
25
|
+
Converts all keys in an object (and nested objects) from snake_case to camelCase.
|
|
26
|
+
|
|
27
|
+
### `keysToSnakeCase(obj: any): any`
|
|
28
|
+
|
|
29
|
+
Converts all keys in an object (and nested objects) from camelCase to snake_case.
|
|
30
|
+
|
|
31
|
+
## Contributing
|
|
32
|
+
|
|
33
|
+
We welcome contributions! Please see the [main contributing guide](../../CONTRIBUTING.md) for details.
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixpilot/object",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"author": "Pixpilot <m.doaie@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -23,17 +23,19 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@pixpilot/string": "1.0.1"
|
|
28
|
+
},
|
|
26
29
|
"devDependencies": {
|
|
27
30
|
"@types/node": "^22.18.10",
|
|
28
31
|
"eslint": "^9.37.0",
|
|
29
32
|
"rollup": "^4.52.4",
|
|
30
33
|
"typescript": "^5.9.3",
|
|
31
34
|
"@internal/eslint-config": "0.3.0",
|
|
32
|
-
"@internal/
|
|
33
|
-
"@internal/vitest-config": "0.1.0",
|
|
34
|
-
"@pixpilot/string": "1.0.0",
|
|
35
|
+
"@internal/prettier-config": "0.0.1",
|
|
35
36
|
"@internal/rollup-config": "0.1.0",
|
|
36
|
-
"@internal/
|
|
37
|
+
"@internal/tsconfig": "0.1.0",
|
|
38
|
+
"@internal/vitest-config": "0.1.0"
|
|
37
39
|
},
|
|
38
40
|
"prettier": "@internal/prettier-config",
|
|
39
41
|
"scripts": {
|