indusagi-coding-agent 0.1.23 → 0.1.25

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.
Files changed (236) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +2 -0
  3. package/dist/cli/args.d.ts +117 -1
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +221 -52
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/config-selector.d.ts +58 -2
  8. package/dist/cli/config-selector.d.ts.map +1 -1
  9. package/dist/cli/config-selector.js +130 -12
  10. package/dist/cli/config-selector.js.map +1 -1
  11. package/dist/cli/file-processor.d.ts +70 -2
  12. package/dist/cli/file-processor.d.ts.map +1 -1
  13. package/dist/cli/file-processor.js +240 -15
  14. package/dist/cli/file-processor.js.map +1 -1
  15. package/dist/cli/list-models.d.ts +63 -3
  16. package/dist/cli/list-models.d.ts.map +1 -1
  17. package/dist/cli/list-models.js +202 -27
  18. package/dist/cli/list-models.js.map +1 -1
  19. package/dist/cli/login-handler.d.ts +82 -8
  20. package/dist/cli/login-handler.d.ts.map +1 -1
  21. package/dist/cli/login-handler.js +410 -77
  22. package/dist/cli/login-handler.js.map +1 -1
  23. package/dist/cli/session-picker.d.ts +74 -2
  24. package/dist/cli/session-picker.d.ts.map +1 -1
  25. package/dist/cli/session-picker.js +236 -12
  26. package/dist/cli/session-picker.js.map +1 -1
  27. package/dist/core/agent-session.d.ts +214 -9
  28. package/dist/core/agent-session.d.ts.map +1 -1
  29. package/dist/core/agent-session.js +214 -9
  30. package/dist/core/agent-session.js.map +1 -1
  31. package/dist/core/bash-executor.d.ts +302 -12
  32. package/dist/core/bash-executor.d.ts.map +1 -1
  33. package/dist/core/bash-executor.js +302 -12
  34. package/dist/core/bash-executor.js.map +1 -1
  35. package/dist/core/diagnostics.d.ts +191 -0
  36. package/dist/core/diagnostics.d.ts.map +1 -1
  37. package/dist/core/diagnostics.js +142 -0
  38. package/dist/core/diagnostics.js.map +1 -1
  39. package/dist/core/discover-packages.d.ts +6 -0
  40. package/dist/core/discover-packages.d.ts.map +1 -0
  41. package/dist/core/discover-packages.js +62 -0
  42. package/dist/core/discover-packages.js.map +1 -0
  43. package/dist/core/event-bus.d.ts +146 -0
  44. package/dist/core/event-bus.d.ts.map +1 -1
  45. package/dist/core/event-bus.js +93 -0
  46. package/dist/core/event-bus.js.map +1 -1
  47. package/dist/core/export-html/ansi-to-html.d.ts +4 -0
  48. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  49. package/dist/core/export-html/ansi-to-html.js +4 -0
  50. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  51. package/dist/core/export-html/index.d.ts +128 -0
  52. package/dist/core/export-html/index.d.ts.map +1 -1
  53. package/dist/core/export-html/index.js +128 -0
  54. package/dist/core/export-html/index.js.map +1 -1
  55. package/dist/core/export-html/tool-renderer.d.ts +4 -0
  56. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  57. package/dist/core/export-html/tool-renderer.js +4 -0
  58. package/dist/core/export-html/tool-renderer.js.map +1 -1
  59. package/dist/core/keybindings.d.ts +142 -0
  60. package/dist/core/keybindings.d.ts.map +1 -1
  61. package/dist/core/keybindings.js +142 -0
  62. package/dist/core/keybindings.js.map +1 -1
  63. package/dist/core/model-registry.d.ts +98 -1
  64. package/dist/core/model-registry.d.ts.map +1 -1
  65. package/dist/core/model-registry.js +98 -1
  66. package/dist/core/model-registry.js.map +1 -1
  67. package/dist/core/model-resolver.d.ts +99 -1
  68. package/dist/core/model-resolver.d.ts.map +1 -1
  69. package/dist/core/model-resolver.js +99 -1
  70. package/dist/core/model-resolver.js.map +1 -1
  71. package/dist/core/prompt-templates.js.map +1 -1
  72. package/dist/core/sdk.d.ts.map +1 -1
  73. package/dist/core/sdk.js +2 -0
  74. package/dist/core/sdk.js.map +1 -1
  75. package/dist/core/session-manager.d.ts +127 -0
  76. package/dist/core/session-manager.d.ts.map +1 -1
  77. package/dist/core/session-manager.js +125 -0
  78. package/dist/core/session-manager.js.map +1 -1
  79. package/dist/core/skills.js.map +1 -1
  80. package/dist/core/subagents.js.map +1 -1
  81. package/dist/core/tools/bash.d.ts +391 -11
  82. package/dist/core/tools/bash.d.ts.map +1 -1
  83. package/dist/core/tools/bash.js +269 -2
  84. package/dist/core/tools/bash.js.map +1 -1
  85. package/dist/core/tools/bg-process.d.ts +49 -0
  86. package/dist/core/tools/bg-process.d.ts.map +1 -0
  87. package/dist/core/tools/bg-process.js +69 -0
  88. package/dist/core/tools/bg-process.js.map +1 -0
  89. package/dist/core/tools/edit.d.ts +284 -6
  90. package/dist/core/tools/edit.d.ts.map +1 -1
  91. package/dist/core/tools/edit.js +238 -0
  92. package/dist/core/tools/edit.js.map +1 -1
  93. package/dist/core/tools/find.d.ts +169 -5
  94. package/dist/core/tools/find.d.ts.map +1 -1
  95. package/dist/core/tools/find.js +136 -0
  96. package/dist/core/tools/find.js.map +1 -1
  97. package/dist/core/tools/grep.d.ts +285 -5
  98. package/dist/core/tools/grep.d.ts.map +1 -1
  99. package/dist/core/tools/grep.js +247 -0
  100. package/dist/core/tools/grep.js.map +1 -1
  101. package/dist/core/tools/index.d.ts +45 -0
  102. package/dist/core/tools/index.d.ts.map +1 -1
  103. package/dist/core/tools/index.js +15 -0
  104. package/dist/core/tools/index.js.map +1 -1
  105. package/dist/core/tools/ls.d.ts +6 -0
  106. package/dist/core/tools/ls.d.ts.map +1 -1
  107. package/dist/core/tools/ls.js +6 -0
  108. package/dist/core/tools/ls.js.map +1 -1
  109. package/dist/core/tools/read.d.ts +308 -7
  110. package/dist/core/tools/read.d.ts.map +1 -1
  111. package/dist/core/tools/read.js +231 -0
  112. package/dist/core/tools/read.js.map +1 -1
  113. package/dist/core/tools/registry.d.ts +17 -0
  114. package/dist/core/tools/registry.d.ts.map +1 -0
  115. package/dist/core/tools/registry.js +108 -0
  116. package/dist/core/tools/registry.js.map +1 -0
  117. package/dist/core/tools/webfetch.d.ts +118 -3
  118. package/dist/core/tools/webfetch.d.ts.map +1 -1
  119. package/dist/core/tools/webfetch.js +118 -3
  120. package/dist/core/tools/webfetch.js.map +1 -1
  121. package/dist/core/tools/websearch.d.ts +130 -3
  122. package/dist/core/tools/websearch.d.ts.map +1 -1
  123. package/dist/core/tools/websearch.js +130 -3
  124. package/dist/core/tools/websearch.js.map +1 -1
  125. package/dist/core/tools/write.d.ts +251 -5
  126. package/dist/core/tools/write.d.ts.map +1 -1
  127. package/dist/core/tools/write.js +210 -0
  128. package/dist/core/tools/write.js.map +1 -1
  129. package/dist/main.d.ts.map +1 -1
  130. package/dist/main.js +12 -1
  131. package/dist/main.js.map +1 -1
  132. package/dist/modes/interactive/components/assistant-message.d.ts +164 -1
  133. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  134. package/dist/modes/interactive/components/assistant-message.js +164 -1
  135. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  136. package/dist/modes/interactive/components/bash-execution.d.ts +297 -1
  137. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  138. package/dist/modes/interactive/components/bash-execution.js +297 -1
  139. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  140. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  141. package/dist/modes/interactive/components/tool-execution.js +251 -1
  142. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  143. package/dist/modes/interactive/components/user-message.d.ts +186 -1
  144. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  145. package/dist/modes/interactive/components/user-message.js +186 -1
  146. package/dist/modes/interactive/components/user-message.js.map +1 -1
  147. package/dist/modes/interactive/interactive-mode.d.ts +1567 -13
  148. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  149. package/dist/modes/interactive/interactive-mode.js +1567 -13
  150. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  151. package/dist/modes/interactive/theme/theme.d.ts +422 -0
  152. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  153. package/dist/modes/interactive/theme/theme.js +422 -0
  154. package/dist/modes/interactive/theme/theme.js.map +1 -1
  155. package/dist/modes/print-mode.d.ts +538 -5
  156. package/dist/modes/print-mode.d.ts.map +1 -1
  157. package/dist/modes/print-mode.js +538 -5
  158. package/dist/modes/print-mode.js.map +1 -1
  159. package/dist/modes/rpc/rpc-client.d.ts +921 -8
  160. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  161. package/dist/modes/rpc/rpc-client.js +921 -8
  162. package/dist/modes/rpc/rpc-client.js.map +1 -1
  163. package/dist/modes/rpc/rpc-mode.d.ts +802 -9
  164. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  165. package/dist/modes/rpc/rpc-mode.js +802 -9
  166. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  167. package/dist/modes/rpc/rpc-types.d.ts +356 -3
  168. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  169. package/dist/modes/rpc/rpc-types.js +356 -3
  170. package/dist/modes/rpc/rpc-types.js.map +1 -1
  171. package/dist/modes/shared.d.ts +386 -0
  172. package/dist/modes/shared.d.ts.map +1 -0
  173. package/dist/modes/shared.js +543 -0
  174. package/dist/modes/shared.js.map +1 -0
  175. package/dist/utils/array.d.ts +389 -0
  176. package/dist/utils/array.d.ts.map +1 -0
  177. package/dist/utils/array.js +585 -0
  178. package/dist/utils/array.js.map +1 -0
  179. package/dist/utils/color-formatter.d.ts +318 -0
  180. package/dist/utils/color-formatter.d.ts.map +1 -0
  181. package/dist/utils/color-formatter.js +442 -0
  182. package/dist/utils/color-formatter.js.map +1 -0
  183. package/dist/utils/data-transformer.d.ts +326 -0
  184. package/dist/utils/data-transformer.d.ts.map +1 -0
  185. package/dist/utils/data-transformer.js +512 -0
  186. package/dist/utils/data-transformer.js.map +1 -0
  187. package/dist/utils/date-formatter.d.ts +281 -0
  188. package/dist/utils/date-formatter.d.ts.map +1 -0
  189. package/dist/utils/date-formatter.js +503 -0
  190. package/dist/utils/date-formatter.js.map +1 -0
  191. package/dist/utils/error-handler.d.ts +541 -0
  192. package/dist/utils/error-handler.d.ts.map +1 -0
  193. package/dist/utils/error-handler.js +726 -0
  194. package/dist/utils/error-handler.js.map +1 -0
  195. package/dist/utils/file-operations.d.ts +297 -0
  196. package/dist/utils/file-operations.d.ts.map +1 -0
  197. package/dist/utils/file-operations.js +505 -0
  198. package/dist/utils/file-operations.js.map +1 -0
  199. package/dist/utils/frontmatter.d.ts +268 -6
  200. package/dist/utils/frontmatter.d.ts.map +1 -1
  201. package/dist/utils/frontmatter.js +500 -21
  202. package/dist/utils/frontmatter.js.map +1 -1
  203. package/dist/utils/json-formatter.d.ts +259 -0
  204. package/dist/utils/json-formatter.d.ts.map +1 -0
  205. package/dist/utils/json-formatter.js +517 -0
  206. package/dist/utils/json-formatter.js.map +1 -0
  207. package/dist/utils/logger.d.ts +176 -0
  208. package/dist/utils/logger.d.ts.map +1 -0
  209. package/dist/utils/logger.js +346 -0
  210. package/dist/utils/logger.js.map +1 -0
  211. package/dist/utils/markdown-formatter.d.ts +211 -0
  212. package/dist/utils/markdown-formatter.d.ts.map +1 -0
  213. package/dist/utils/markdown-formatter.js +482 -0
  214. package/dist/utils/markdown-formatter.js.map +1 -0
  215. package/dist/utils/path-validator.d.ts +603 -0
  216. package/dist/utils/path-validator.d.ts.map +1 -0
  217. package/dist/utils/path-validator.js +870 -0
  218. package/dist/utils/path-validator.js.map +1 -0
  219. package/dist/utils/string-formatter.d.ts +609 -0
  220. package/dist/utils/string-formatter.d.ts.map +1 -0
  221. package/dist/utils/string-formatter.js +806 -0
  222. package/dist/utils/string-formatter.js.map +1 -0
  223. package/dist/utils/type-guards.d.ts +629 -0
  224. package/dist/utils/type-guards.d.ts.map +1 -0
  225. package/dist/utils/type-guards.js +662 -0
  226. package/dist/utils/type-guards.js.map +1 -0
  227. package/docs/COMPLETE-GUIDE.md +300 -0
  228. package/docs/COMPREHENSIVE-CLI-SUMMARY.md +900 -0
  229. package/docs/MODES-ARCHITECTURE.md +565 -0
  230. package/docs/PRINT-MODE-GUIDE.md +456 -0
  231. package/docs/RPC-GUIDE.md +705 -0
  232. package/docs/UTILS-IMPLEMENTATION-SUMMARY.md +647 -0
  233. package/docs/UTILS-MODULE-OVERVIEW.md +1480 -0
  234. package/docs/UTILS-QA-CHECKLIST.md +1061 -0
  235. package/docs/UTILS-USAGE-GUIDE.md +1419 -0
  236. package/package.json +7 -3
@@ -0,0 +1,512 @@
1
+ /**
2
+ * @fileoverview Advanced data transformation utilities with immutability guarantees
3
+ *
4
+ * This module provides:
5
+ * - Deep merge and clone operations
6
+ * - Immutable object transformations
7
+ * - Data selection (pick, omit)
8
+ * - Data flattening and unflattening
9
+ * - Grouping and sorting utilities
10
+ * - Deduplication and unique operations
11
+ * - Value mapping and transformation
12
+ * - Performance-optimized operations with O(n) complexity notes
13
+ *
14
+ * @example
15
+ * import { deepMerge, deepClone, pick, groupBy } from './data-transformer';
16
+ *
17
+ * const obj1 = { a: 1, b: { c: 2 } };
18
+ * const obj2 = { b: { d: 3 }, e: 4 };
19
+ * const merged = deepMerge(obj1, obj2);
20
+ *
21
+ * @author indusagi
22
+ * @version 1.0.0
23
+ */
24
+ /**
25
+ * Deep clone an object with full immutability
26
+ * @param obj - Object to clone
27
+ * @returns Deep cloned copy
28
+ *
29
+ * Performance: O(n) where n = total properties at all levels
30
+ * Space: O(n) for new object allocation
31
+ *
32
+ * @example
33
+ * const original = { a: 1, b: { c: [1, 2, 3] } };
34
+ * const clone = deepClone(original);
35
+ * clone.b.c.push(4);
36
+ * console.log(original.b.c); // [1, 2, 3]
37
+ * console.log(clone.b.c); // [1, 2, 3, 4]
38
+ *
39
+ * @example
40
+ * // Handle circular references gracefully
41
+ * const circular: any = { a: 1 };
42
+ * circular.self = circular;
43
+ * const cloned = deepClone(circular); // Creates shallow copy for circular ref
44
+ */
45
+ export function deepClone(obj) {
46
+ if (obj === null || typeof obj !== 'object') {
47
+ return obj;
48
+ }
49
+ if (obj instanceof Date) {
50
+ return new Date(obj.getTime());
51
+ }
52
+ if (obj instanceof Array) {
53
+ return obj.map((item) => deepClone(item));
54
+ }
55
+ if (obj instanceof Object) {
56
+ const cloned = {};
57
+ for (const key in obj) {
58
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
59
+ cloned[key] = deepClone(obj[key]);
60
+ }
61
+ }
62
+ return cloned;
63
+ }
64
+ return obj;
65
+ }
66
+ /**
67
+ * Deep merge multiple objects
68
+ * @param target - Target object
69
+ * @param sources - Source objects to merge
70
+ * @returns Merged object (new instance)
71
+ *
72
+ * Performance: O(n) for each source object
73
+ * Later values override earlier ones
74
+ * Creates new object, does not mutate originals
75
+ *
76
+ * @example
77
+ * const base = { api: { host: 'localhost', port: 3000 } };
78
+ * const prod = { api: { host: 'api.example.com' } };
79
+ * const merged = deepMerge(base, prod);
80
+ * // { api: { host: 'api.example.com', port: 3000 } }
81
+ *
82
+ * @example
83
+ * const config1 = { db: { user: 'root' } };
84
+ * const config2 = { db: { password: 'secret' } };
85
+ * const config3 = { api: { timeout: 5000 } };
86
+ * const final = deepMerge(config1, config2, config3);
87
+ */
88
+ export function deepMerge(target, ...sources) {
89
+ if (sources.length === 0) {
90
+ return deepClone(target);
91
+ }
92
+ const result = deepClone(target);
93
+ for (const source of sources) {
94
+ if (!source || typeof source !== 'object') {
95
+ continue;
96
+ }
97
+ for (const key in source) {
98
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
99
+ const targetValue = result[key];
100
+ const sourceValue = source[key];
101
+ if (targetValue &&
102
+ typeof targetValue === 'object' &&
103
+ !Array.isArray(targetValue) &&
104
+ sourceValue &&
105
+ typeof sourceValue === 'object' &&
106
+ !Array.isArray(sourceValue)) {
107
+ result[key] = deepMerge(targetValue, sourceValue);
108
+ }
109
+ else {
110
+ result[key] = deepClone(sourceValue);
111
+ }
112
+ }
113
+ }
114
+ }
115
+ return result;
116
+ }
117
+ /**
118
+ * Pick specific keys from object
119
+ * @param obj - Source object
120
+ * @param keys - Keys to pick
121
+ * @returns New object with only specified keys
122
+ *
123
+ * Performance: O(k) where k = number of keys to pick
124
+ * Immutable: creates new object
125
+ *
126
+ * @example
127
+ * const user = { id: 1, name: 'John', email: 'john@example.com', password: 'secret' };
128
+ * const safe = pick(user, ['id', 'name', 'email']);
129
+ * // { id: 1, name: 'John', email: 'john@example.com' }
130
+ *
131
+ * @example
132
+ * const data = { a: 1, b: 2, c: 3, d: 4 };
133
+ * const subset = pick(data, ['a', 'c']);
134
+ * // { a: 1, c: 3 }
135
+ */
136
+ export function pick(obj, keys) {
137
+ const result = {};
138
+ for (const key of keys) {
139
+ if (key in obj) {
140
+ result[key] = obj[key];
141
+ }
142
+ }
143
+ return result;
144
+ }
145
+ /**
146
+ * Omit specific keys from object
147
+ * @param obj - Source object
148
+ * @param keys - Keys to omit
149
+ * @returns New object without specified keys
150
+ *
151
+ * Performance: O(n) where n = total properties
152
+ * Immutable: creates new object
153
+ *
154
+ * @example
155
+ * const user = { id: 1, name: 'John', email: 'john@example.com', password: 'secret' };
156
+ * const safe = omit(user, ['password']);
157
+ * // { id: 1, name: 'John', email: 'john@example.com' }
158
+ *
159
+ * @example
160
+ * const config = { dev: true, test: false, prod: true, internal: 'value' };
161
+ * const public_ = omit(config, ['internal']);
162
+ */
163
+ export function omit(obj, keys) {
164
+ const keysSet = new Set(keys);
165
+ const result = {};
166
+ for (const key in obj) {
167
+ if (Object.prototype.hasOwnProperty.call(obj, key) && !keysSet.has(key)) {
168
+ result[key] = obj[key];
169
+ }
170
+ }
171
+ return result;
172
+ }
173
+ /**
174
+ * Flatten nested object to single level
175
+ * @param obj - Nested object
176
+ * @param prefix - Key prefix for nested keys
177
+ * @returns Flattened object
178
+ *
179
+ * Performance: O(n) where n = total nested properties
180
+ *
181
+ * @example
182
+ * const nested = {
183
+ * user: { name: 'John', age: 30 },
184
+ * settings: { theme: 'dark', lang: 'en' }
185
+ * };
186
+ * const flat = flatten(nested);
187
+ * // {
188
+ * // 'user.name': 'John',
189
+ * // 'user.age': 30,
190
+ * // 'settings.theme': 'dark',
191
+ * // 'settings.lang': 'en'
192
+ * // }
193
+ *
194
+ * @example
195
+ * const deep = { a: { b: { c: { d: 1 } } } };
196
+ * const flat = flatten(deep);
197
+ * // { 'a.b.c.d': 1 }
198
+ */
199
+ export function flatten(obj, prefix = '') {
200
+ const result = {};
201
+ for (const key in obj) {
202
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
203
+ const value = obj[key];
204
+ const newKey = prefix ? `${prefix}.${key}` : key;
205
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
206
+ Object.assign(result, flatten(value, newKey));
207
+ }
208
+ else {
209
+ result[newKey] = value;
210
+ }
211
+ }
212
+ }
213
+ return result;
214
+ }
215
+ /**
216
+ * Unflatten object from dotted keys
217
+ * @param obj - Flattened object
218
+ * @returns Nested object
219
+ *
220
+ * Performance: O(n) where n = number of keys
221
+ *
222
+ * @example
223
+ * const flat = {
224
+ * 'user.name': 'John',
225
+ * 'user.age': 30,
226
+ * 'settings.theme': 'dark'
227
+ * };
228
+ * const nested = unflatten(flat);
229
+ * // { user: { name: 'John', age: 30 }, settings: { theme: 'dark' } }
230
+ */
231
+ export function unflatten(obj) {
232
+ const result = {};
233
+ for (const key in obj) {
234
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
235
+ const parts = key.split('.');
236
+ let current = result;
237
+ for (let i = 0; i < parts.length - 1; i++) {
238
+ const part = parts[i];
239
+ if (!(part in current)) {
240
+ current[part] = {};
241
+ }
242
+ current = current[part];
243
+ }
244
+ current[parts[parts.length - 1]] = obj[key];
245
+ }
246
+ }
247
+ return result;
248
+ }
249
+ /**
250
+ * Group array by key function
251
+ * @param items - Array to group
252
+ * @param keyFn - Function to determine grouping key
253
+ * @returns Object with grouped arrays
254
+ *
255
+ * Performance: O(n) where n = array length
256
+ *
257
+ * @example
258
+ * const users = [
259
+ * { id: 1, role: 'admin' },
260
+ * { id: 2, role: 'user' },
261
+ * { id: 3, role: 'admin' }
262
+ * ];
263
+ * const byRole = groupBy(users, u => u.role);
264
+ * // { admin: [{id: 1, role: 'admin'}, {id: 3, role: 'admin'}], user: [{id: 2, role: 'user'}] }
265
+ *
266
+ * @example
267
+ * const words = ['apple', 'apricot', 'banana', 'blueberry'];
268
+ * const byFirstLetter = groupBy(words, w => w[0]);
269
+ * // { a: ['apple', 'apricot'], b: ['banana', 'blueberry'] }
270
+ */
271
+ export function groupBy(items, keyFn) {
272
+ const result = {};
273
+ items.forEach((item, index) => {
274
+ const key = keyFn(item, index);
275
+ if (!(key in result)) {
276
+ result[key] = [];
277
+ }
278
+ result[key].push(item);
279
+ });
280
+ return result;
281
+ }
282
+ /**
283
+ * Sort array by multiple criteria
284
+ * @param items - Array to sort
285
+ * @param compareFn - Comparison function
286
+ * @returns Sorted array (new instance)
287
+ *
288
+ * Performance: O(n log n) typical case
289
+ * Immutable: returns new array
290
+ *
291
+ * @example
292
+ * const users = [
293
+ * { name: 'Charlie', age: 30 },
294
+ * { name: 'Alice', age: 25 },
295
+ * { name: 'Bob', age: 25 }
296
+ * ];
297
+ * const sorted = sortBy(users, (a, b) => {
298
+ * if (a.age !== b.age) return a.age - b.age;
299
+ * return a.name.localeCompare(b.name);
300
+ * });
301
+ *
302
+ * @example
303
+ * const numbers = [3, 1, 4, 1, 5, 9, 2, 6];
304
+ * const sorted = sortBy(numbers, (a, b) => a - b);
305
+ */
306
+ export function sortBy(items, compareFn) {
307
+ return [...items].sort(compareFn);
308
+ }
309
+ /**
310
+ * Get unique items from array
311
+ * @param items - Array with potential duplicates
312
+ * @param keyFn - Optional function to determine uniqueness
313
+ * @returns Array with unique items
314
+ *
315
+ * Performance: O(n) with Set, O(n log n) without
316
+ *
317
+ * @example
318
+ * const numbers = [1, 2, 2, 3, 3, 3, 4];
319
+ * const unique = uniqueBy(numbers);
320
+ * // [1, 2, 3, 4]
321
+ *
322
+ * @example
323
+ * const users = [
324
+ * { id: 1, name: 'John' },
325
+ * { id: 2, name: 'Jane' },
326
+ * { id: 1, name: 'John' }
327
+ * ];
328
+ * const unique = uniqueBy(users, u => u.id);
329
+ * // [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }]
330
+ */
331
+ export function uniqueBy(items, keyFn) {
332
+ const seen = new Set();
333
+ const result = [];
334
+ for (const item of items) {
335
+ const key = keyFn ? keyFn(item) : item;
336
+ if (!seen.has(key)) {
337
+ seen.add(key);
338
+ result.push(item);
339
+ }
340
+ }
341
+ return result;
342
+ }
343
+ /**
344
+ * Map object values to new values
345
+ * @param obj - Source object
346
+ * @param mapFn - Mapping function
347
+ * @returns New object with mapped values
348
+ *
349
+ * Performance: O(n) where n = number of properties
350
+ * Keys are preserved, only values transform
351
+ *
352
+ * @example
353
+ * const scores = { math: 85, english: 90, science: 88 };
354
+ * const percentages = mapValues(scores, v => `${v}%`);
355
+ * // { math: '85%', english: '90%', science: '88%' }
356
+ *
357
+ * @example
358
+ * const prices = { apple: 0.5, banana: 0.3 };
359
+ * const taxed = mapValues(prices, v => v * 1.1);
360
+ * // { apple: 0.55, banana: 0.33 }
361
+ */
362
+ export function mapValues(obj, mapFn) {
363
+ const result = {};
364
+ for (const key in obj) {
365
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
366
+ result[key] = mapFn(obj[key], key);
367
+ }
368
+ }
369
+ return result;
370
+ }
371
+ /**
372
+ * Transform object keys
373
+ * @param obj - Source object
374
+ * @param transformFn - Key transformation function
375
+ * @returns New object with transformed keys
376
+ *
377
+ * @example
378
+ * const obj = { firstName: 'John', lastName: 'Doe' };
379
+ * const snake = transformKeys(obj, k => k.replace(/([A-Z])/g, '_$1').toLowerCase());
380
+ * // { first_name: 'John', last_name: 'Doe' }
381
+ */
382
+ export function transformKeys(obj, transformFn) {
383
+ const result = {};
384
+ for (const key in obj) {
385
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
386
+ result[transformFn(key)] = obj[key];
387
+ }
388
+ }
389
+ return result;
390
+ }
391
+ /**
392
+ * Filter object by predicate
393
+ * @param obj - Source object
394
+ * @param predicate - Filter function
395
+ * @returns New object with filtered entries
396
+ *
397
+ * Performance: O(n) where n = number of properties
398
+ *
399
+ * @example
400
+ * const config = { debug: true, prod: false, test: true, verbose: false };
401
+ * const enabled = filterObject(config, (v) => v === true);
402
+ * // { debug: true, test: true }
403
+ */
404
+ export function filterObject(obj, predicate) {
405
+ const result = {};
406
+ for (const key in obj) {
407
+ if (Object.prototype.hasOwnProperty.call(obj, key) && predicate(obj[key], key)) {
408
+ result[key] = obj[key];
409
+ }
410
+ }
411
+ return result;
412
+ }
413
+ /**
414
+ * Invert object keys and values
415
+ * @param obj - Object to invert
416
+ * @returns Inverted object
417
+ *
418
+ * @example
419
+ * const mapping = { en: 'English', es: 'Spanish', fr: 'French' };
420
+ * const inverted = invertObject(mapping);
421
+ * // { English: 'en', Spanish: 'es', French: 'fr' }
422
+ */
423
+ export function invertObject(obj) {
424
+ const result = {};
425
+ for (const key in obj) {
426
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
427
+ result[obj[key]] = key;
428
+ }
429
+ }
430
+ return result;
431
+ }
432
+ /**
433
+ * Check if value is empty (null, undefined, empty string, empty array, empty object)
434
+ * @param value - Value to check
435
+ * @returns True if empty
436
+ *
437
+ * @example
438
+ * isEmpty(null); // true
439
+ * isEmpty(undefined); // true
440
+ * isEmpty(''); // true
441
+ * isEmpty([]); // true
442
+ * isEmpty({}); // true
443
+ * isEmpty(0); // false
444
+ */
445
+ export function isEmpty(value) {
446
+ if (value === null || value === undefined) {
447
+ return true;
448
+ }
449
+ if (typeof value === 'string' || Array.isArray(value)) {
450
+ return value.length === 0;
451
+ }
452
+ if (typeof value === 'object') {
453
+ return Object.keys(value).length === 0;
454
+ }
455
+ return false;
456
+ }
457
+ /**
458
+ * Get value from object using dot notation path
459
+ * @param obj - Source object
460
+ * @param path - Dot notation path (e.g., 'user.profile.age')
461
+ * @param defaultValue - Default if not found
462
+ * @returns Value at path or default
463
+ *
464
+ * Performance: O(k) where k = path depth
465
+ *
466
+ * @example
467
+ * const user = { profile: { address: { city: 'New York' } } };
468
+ * const city = getPath(user, 'profile.address.city');
469
+ * // 'New York'
470
+ *
471
+ * @example
472
+ * const city = getPath(user, 'profile.country', 'Unknown');
473
+ * // 'Unknown'
474
+ */
475
+ export function getPath(obj, path, defaultValue) {
476
+ const keys = path.split('.');
477
+ let current = obj;
478
+ for (const key of keys) {
479
+ if (current == null) {
480
+ return defaultValue;
481
+ }
482
+ current = current[key];
483
+ }
484
+ return current ?? defaultValue;
485
+ }
486
+ /**
487
+ * Set value in object using dot notation path
488
+ * @param obj - Target object
489
+ * @param path - Dot notation path
490
+ * @param value - Value to set
491
+ * @returns New object with value set (immutable)
492
+ *
493
+ * @example
494
+ * const user = { profile: { name: 'John' } };
495
+ * const updated = setPath(user, 'profile.age', 30);
496
+ * // { profile: { name: 'John', age: 30 } }
497
+ */
498
+ export function setPath(obj, path, value) {
499
+ const clone = deepClone(obj);
500
+ const keys = path.split('.');
501
+ let current = clone;
502
+ for (let i = 0; i < keys.length - 1; i++) {
503
+ const key = keys[i];
504
+ if (!(key in current)) {
505
+ current[key] = {};
506
+ }
507
+ current = current[key];
508
+ }
509
+ current[keys[keys.length - 1]] = value;
510
+ return clone;
511
+ }
512
+ //# sourceMappingURL=data-transformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-transformer.js","sourceRoot":"","sources":["../../src/utils/data-transformer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,SAAS,CAAI,GAAM;IACjC,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5C,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IAAI,GAAG,YAAY,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAQ,CAAC;IACxC,CAAC;IAED,IAAI,GAAG,YAA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