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
Copy file name to clipboardExpand all lines: FOOTER.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,7 @@ pnpm test:watch
25
25
26
26
## Credits
27
27
28
-
Built for developers, with developers.
29
-
👉 https://launchql.com | https://hyperweb.io
28
+
**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
-`toFieldName(pluralTypeName)` - Convert plural PascalCase to singular camelCase field name
92
101
-`toQueryName(singularTypeName)` - Convert singular PascalCase to plural camelCase query name
93
102
103
+
### Deep Object Transformation
104
+
105
+
-`inflektTree(obj, transformer, options?)` - Recursively transform all property names in an object tree
106
+
107
+
## Deep Object Key Transformation
108
+
109
+
The `inflektTree` function recursively transforms all property names in an object tree using any transformer function. This is useful for converting API responses between naming conventions.
110
+
111
+
### Basic Usage
112
+
113
+
```typescript
114
+
// Convert snake_case API response to camelCase for frontend
115
+
const apiResponse = {
116
+
user_name: 'John',
117
+
user_profile: {
118
+
profile_image: 'https://example.com/avatar.jpg',
119
+
account_status: 'active'
120
+
},
121
+
order_items: [
122
+
{ item_id: 1, item_name: 'Product A' },
123
+
{ item_id: 2, item_name: 'Product B' }
124
+
]
125
+
};
126
+
127
+
const result =inflektTree(apiResponse, (key) =>camelize(key, true));
0 commit comments