@almadar/std 1.0.0
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/LICENSE +72 -0
- package/dist/behaviors/action-affinity.d.ts +88 -0
- package/dist/behaviors/action-affinity.js +290 -0
- package/dist/behaviors/action-affinity.js.map +1 -0
- package/dist/behaviors/async.d.ts +20 -0
- package/dist/behaviors/async.js +542 -0
- package/dist/behaviors/async.js.map +1 -0
- package/dist/behaviors/data-management.d.ts +40 -0
- package/dist/behaviors/data-management.js +495 -0
- package/dist/behaviors/data-management.js.map +1 -0
- package/dist/behaviors/feedback.d.ts +18 -0
- package/dist/behaviors/feedback.js +307 -0
- package/dist/behaviors/feedback.js.map +1 -0
- package/dist/behaviors/game-core.d.ts +40 -0
- package/dist/behaviors/game-core.js +443 -0
- package/dist/behaviors/game-core.js.map +1 -0
- package/dist/behaviors/game-entity.d.ts +39 -0
- package/dist/behaviors/game-entity.js +643 -0
- package/dist/behaviors/game-entity.js.map +1 -0
- package/dist/behaviors/game-ui.d.ts +29 -0
- package/dist/behaviors/game-ui.js +493 -0
- package/dist/behaviors/game-ui.js.map +1 -0
- package/dist/behaviors/index.d.ts +11 -0
- package/dist/behaviors/index.js +4539 -0
- package/dist/behaviors/index.js.map +1 -0
- package/dist/behaviors/registry.d.ts +103 -0
- package/dist/behaviors/registry.js +4166 -0
- package/dist/behaviors/registry.js.map +1 -0
- package/dist/behaviors/types.d.ts +179 -0
- package/dist/behaviors/types.js +111 -0
- package/dist/behaviors/types.js.map +1 -0
- package/dist/behaviors/ui-interaction.d.ts +36 -0
- package/dist/behaviors/ui-interaction.js +1104 -0
- package/dist/behaviors/ui-interaction.js.map +1 -0
- package/dist/index.d.ts +195 -0
- package/dist/index.js +8209 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/array.d.ts +28 -0
- package/dist/modules/array.js +556 -0
- package/dist/modules/array.js.map +1 -0
- package/dist/modules/async.d.ts +22 -0
- package/dist/modules/async.js +112 -0
- package/dist/modules/async.js.map +1 -0
- package/dist/modules/format.d.ts +21 -0
- package/dist/modules/format.js +129 -0
- package/dist/modules/format.js.map +1 -0
- package/dist/modules/index.d.ts +12 -0
- package/dist/modules/index.js +3131 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/math.d.ts +22 -0
- package/dist/modules/math.js +215 -0
- package/dist/modules/math.js.map +1 -0
- package/dist/modules/nn.d.ts +23 -0
- package/dist/modules/nn.js +189 -0
- package/dist/modules/nn.js.map +1 -0
- package/dist/modules/object.d.ts +22 -0
- package/dist/modules/object.js +257 -0
- package/dist/modules/object.js.map +1 -0
- package/dist/modules/str.d.ts +21 -0
- package/dist/modules/str.js +344 -0
- package/dist/modules/str.js.map +1 -0
- package/dist/modules/tensor.d.ts +23 -0
- package/dist/modules/tensor.js +427 -0
- package/dist/modules/tensor.js.map +1 -0
- package/dist/modules/time.d.ts +24 -0
- package/dist/modules/time.js +323 -0
- package/dist/modules/time.js.map +1 -0
- package/dist/modules/train.d.ts +23 -0
- package/dist/modules/train.js +308 -0
- package/dist/modules/train.js.map +1 -0
- package/dist/modules/validate.d.ts +23 -0
- package/dist/modules/validate.js +301 -0
- package/dist/modules/validate.js.map +1 -0
- package/dist/registry.d.ts +140 -0
- package/dist/registry.js +3240 -0
- package/dist/registry.js.map +1 -0
- package/dist/types-I95R8_FN.d.ts +91 -0
- package/package.json +59 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { a as StdOperatorMeta } from '../types-I95R8_FN.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Array Module - Collection Operations
|
|
5
|
+
*
|
|
6
|
+
* Provides array manipulation and transformation functions.
|
|
7
|
+
* Many functions accept lambda expressions for predicates and transformations.
|
|
8
|
+
*
|
|
9
|
+
* Lambda syntax: ["fn", "varName", expression] or ["fn", ["a", "b"], expression]
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Array module operators.
|
|
16
|
+
* All operators return arrays (or other values) and have no side effects.
|
|
17
|
+
*/
|
|
18
|
+
declare const ARRAY_OPERATORS: Record<string, StdOperatorMeta>;
|
|
19
|
+
/**
|
|
20
|
+
* Get all array operator names.
|
|
21
|
+
*/
|
|
22
|
+
declare function getArrayOperators(): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Get all array operators that accept lambda expressions.
|
|
25
|
+
*/
|
|
26
|
+
declare function getLambdaArrayOperators(): string[];
|
|
27
|
+
|
|
28
|
+
export { ARRAY_OPERATORS, getArrayOperators, getLambdaArrayOperators };
|
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
// modules/array.ts
|
|
2
|
+
var ARRAY_OPERATORS = {
|
|
3
|
+
"array/len": {
|
|
4
|
+
module: "array",
|
|
5
|
+
category: "std-array",
|
|
6
|
+
minArity: 1,
|
|
7
|
+
maxArity: 1,
|
|
8
|
+
description: "Array length",
|
|
9
|
+
hasSideEffects: false,
|
|
10
|
+
returnType: "number",
|
|
11
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
12
|
+
example: '["array/len", [1, 2, 3]] // => 3'
|
|
13
|
+
},
|
|
14
|
+
"array/empty?": {
|
|
15
|
+
module: "array",
|
|
16
|
+
category: "std-array",
|
|
17
|
+
minArity: 1,
|
|
18
|
+
maxArity: 1,
|
|
19
|
+
description: "Check if array is empty",
|
|
20
|
+
hasSideEffects: false,
|
|
21
|
+
returnType: "boolean",
|
|
22
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
23
|
+
example: '["array/empty?", []] // => true'
|
|
24
|
+
},
|
|
25
|
+
"array/first": {
|
|
26
|
+
module: "array",
|
|
27
|
+
category: "std-array",
|
|
28
|
+
minArity: 1,
|
|
29
|
+
maxArity: 1,
|
|
30
|
+
description: "Get first element",
|
|
31
|
+
hasSideEffects: false,
|
|
32
|
+
returnType: "any",
|
|
33
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
34
|
+
example: '["array/first", [1, 2, 3]] // => 1'
|
|
35
|
+
},
|
|
36
|
+
"array/last": {
|
|
37
|
+
module: "array",
|
|
38
|
+
category: "std-array",
|
|
39
|
+
minArity: 1,
|
|
40
|
+
maxArity: 1,
|
|
41
|
+
description: "Get last element",
|
|
42
|
+
hasSideEffects: false,
|
|
43
|
+
returnType: "any",
|
|
44
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
45
|
+
example: '["array/last", [1, 2, 3]] // => 3'
|
|
46
|
+
},
|
|
47
|
+
"array/nth": {
|
|
48
|
+
module: "array",
|
|
49
|
+
category: "std-array",
|
|
50
|
+
minArity: 2,
|
|
51
|
+
maxArity: 2,
|
|
52
|
+
description: "Get element at index",
|
|
53
|
+
hasSideEffects: false,
|
|
54
|
+
returnType: "any",
|
|
55
|
+
params: [
|
|
56
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
57
|
+
{ name: "index", type: "number", description: "Index (0-based)" }
|
|
58
|
+
],
|
|
59
|
+
example: '["array/nth", [1, 2, 3], 1] // => 2'
|
|
60
|
+
},
|
|
61
|
+
"array/slice": {
|
|
62
|
+
module: "array",
|
|
63
|
+
category: "std-array",
|
|
64
|
+
minArity: 2,
|
|
65
|
+
maxArity: 3,
|
|
66
|
+
description: "Extract subarray",
|
|
67
|
+
hasSideEffects: false,
|
|
68
|
+
returnType: "array",
|
|
69
|
+
params: [
|
|
70
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
71
|
+
{ name: "start", type: "number", description: "Start index" },
|
|
72
|
+
{ name: "end", type: "number", description: "End index (exclusive)", optional: true }
|
|
73
|
+
],
|
|
74
|
+
example: '["array/slice", [1, 2, 3, 4], 1, 3] // => [2, 3]'
|
|
75
|
+
},
|
|
76
|
+
"array/concat": {
|
|
77
|
+
module: "array",
|
|
78
|
+
category: "std-array",
|
|
79
|
+
minArity: 2,
|
|
80
|
+
maxArity: null,
|
|
81
|
+
description: "Concatenate arrays",
|
|
82
|
+
hasSideEffects: false,
|
|
83
|
+
returnType: "array",
|
|
84
|
+
params: [{ name: "...arrs", type: "array[]", description: "Arrays to concatenate" }],
|
|
85
|
+
example: '["array/concat", [1, 2], [3, 4]] // => [1, 2, 3, 4]'
|
|
86
|
+
},
|
|
87
|
+
"array/append": {
|
|
88
|
+
module: "array",
|
|
89
|
+
category: "std-array",
|
|
90
|
+
minArity: 2,
|
|
91
|
+
maxArity: 2,
|
|
92
|
+
description: "Add item to end (returns new array)",
|
|
93
|
+
hasSideEffects: false,
|
|
94
|
+
returnType: "array",
|
|
95
|
+
params: [
|
|
96
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
97
|
+
{ name: "item", type: "any", description: "Item to add" }
|
|
98
|
+
],
|
|
99
|
+
example: '["array/append", [1, 2], 3] // => [1, 2, 3]'
|
|
100
|
+
},
|
|
101
|
+
"array/prepend": {
|
|
102
|
+
module: "array",
|
|
103
|
+
category: "std-array",
|
|
104
|
+
minArity: 2,
|
|
105
|
+
maxArity: 2,
|
|
106
|
+
description: "Add item to start (returns new array)",
|
|
107
|
+
hasSideEffects: false,
|
|
108
|
+
returnType: "array",
|
|
109
|
+
params: [
|
|
110
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
111
|
+
{ name: "item", type: "any", description: "Item to add" }
|
|
112
|
+
],
|
|
113
|
+
example: '["array/prepend", [2, 3], 1] // => [1, 2, 3]'
|
|
114
|
+
},
|
|
115
|
+
"array/insert": {
|
|
116
|
+
module: "array",
|
|
117
|
+
category: "std-array",
|
|
118
|
+
minArity: 3,
|
|
119
|
+
maxArity: 3,
|
|
120
|
+
description: "Insert item at index (returns new array)",
|
|
121
|
+
hasSideEffects: false,
|
|
122
|
+
returnType: "array",
|
|
123
|
+
params: [
|
|
124
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
125
|
+
{ name: "index", type: "number", description: "Index to insert at" },
|
|
126
|
+
{ name: "item", type: "any", description: "Item to insert" }
|
|
127
|
+
],
|
|
128
|
+
example: '["array/insert", [1, 3], 1, 2] // => [1, 2, 3]'
|
|
129
|
+
},
|
|
130
|
+
"array/remove": {
|
|
131
|
+
module: "array",
|
|
132
|
+
category: "std-array",
|
|
133
|
+
minArity: 2,
|
|
134
|
+
maxArity: 2,
|
|
135
|
+
description: "Remove item at index (returns new array)",
|
|
136
|
+
hasSideEffects: false,
|
|
137
|
+
returnType: "array",
|
|
138
|
+
params: [
|
|
139
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
140
|
+
{ name: "index", type: "number", description: "Index to remove" }
|
|
141
|
+
],
|
|
142
|
+
example: '["array/remove", [1, 2, 3], 1] // => [1, 3]'
|
|
143
|
+
},
|
|
144
|
+
"array/removeItem": {
|
|
145
|
+
module: "array",
|
|
146
|
+
category: "std-array",
|
|
147
|
+
minArity: 2,
|
|
148
|
+
maxArity: 2,
|
|
149
|
+
description: "Remove first matching item (returns new array)",
|
|
150
|
+
hasSideEffects: false,
|
|
151
|
+
returnType: "array",
|
|
152
|
+
params: [
|
|
153
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
154
|
+
{ name: "item", type: "any", description: "Item to remove" }
|
|
155
|
+
],
|
|
156
|
+
example: '["array/removeItem", [1, 2, 3, 2], 2] // => [1, 3, 2]'
|
|
157
|
+
},
|
|
158
|
+
"array/reverse": {
|
|
159
|
+
module: "array",
|
|
160
|
+
category: "std-array",
|
|
161
|
+
minArity: 1,
|
|
162
|
+
maxArity: 1,
|
|
163
|
+
description: "Reverse array order (returns new array)",
|
|
164
|
+
hasSideEffects: false,
|
|
165
|
+
returnType: "array",
|
|
166
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
167
|
+
example: '["array/reverse", [1, 2, 3]] // => [3, 2, 1]'
|
|
168
|
+
},
|
|
169
|
+
"array/sort": {
|
|
170
|
+
module: "array",
|
|
171
|
+
category: "std-array",
|
|
172
|
+
minArity: 1,
|
|
173
|
+
maxArity: 3,
|
|
174
|
+
description: "Sort array (returns new array)",
|
|
175
|
+
hasSideEffects: false,
|
|
176
|
+
returnType: "array",
|
|
177
|
+
params: [
|
|
178
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
179
|
+
{ name: "key", type: "string", description: "Field to sort by (for objects)", optional: true },
|
|
180
|
+
{ name: "dir", type: "string", description: '"asc" or "desc"', optional: true, defaultValue: "asc" }
|
|
181
|
+
],
|
|
182
|
+
example: '["array/sort", "@items", "price", "desc"]'
|
|
183
|
+
},
|
|
184
|
+
"array/shuffle": {
|
|
185
|
+
module: "array",
|
|
186
|
+
category: "std-array",
|
|
187
|
+
minArity: 1,
|
|
188
|
+
maxArity: 1,
|
|
189
|
+
description: "Randomly shuffle array (returns new array)",
|
|
190
|
+
hasSideEffects: false,
|
|
191
|
+
returnType: "array",
|
|
192
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
193
|
+
example: '["array/shuffle", [1, 2, 3, 4, 5]]'
|
|
194
|
+
},
|
|
195
|
+
"array/unique": {
|
|
196
|
+
module: "array",
|
|
197
|
+
category: "std-array",
|
|
198
|
+
minArity: 1,
|
|
199
|
+
maxArity: 1,
|
|
200
|
+
description: "Remove duplicates (returns new array)",
|
|
201
|
+
hasSideEffects: false,
|
|
202
|
+
returnType: "array",
|
|
203
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
204
|
+
example: '["array/unique", [1, 2, 2, 3, 1]] // => [1, 2, 3]'
|
|
205
|
+
},
|
|
206
|
+
"array/flatten": {
|
|
207
|
+
module: "array",
|
|
208
|
+
category: "std-array",
|
|
209
|
+
minArity: 1,
|
|
210
|
+
maxArity: 1,
|
|
211
|
+
description: "Flatten nested arrays one level",
|
|
212
|
+
hasSideEffects: false,
|
|
213
|
+
returnType: "array",
|
|
214
|
+
params: [{ name: "arr", type: "array", description: "The array" }],
|
|
215
|
+
example: '["array/flatten", [[1, 2], [3, 4]]] // => [1, 2, 3, 4]'
|
|
216
|
+
},
|
|
217
|
+
"array/zip": {
|
|
218
|
+
module: "array",
|
|
219
|
+
category: "std-array",
|
|
220
|
+
minArity: 2,
|
|
221
|
+
maxArity: 2,
|
|
222
|
+
description: "Pair elements from two arrays",
|
|
223
|
+
hasSideEffects: false,
|
|
224
|
+
returnType: "array",
|
|
225
|
+
params: [
|
|
226
|
+
{ name: "arr1", type: "array", description: "First array" },
|
|
227
|
+
{ name: "arr2", type: "array", description: "Second array" }
|
|
228
|
+
],
|
|
229
|
+
example: '["array/zip", [1, 2], ["a", "b"]] // => [[1, "a"], [2, "b"]]'
|
|
230
|
+
},
|
|
231
|
+
"array/includes": {
|
|
232
|
+
module: "array",
|
|
233
|
+
category: "std-array",
|
|
234
|
+
minArity: 2,
|
|
235
|
+
maxArity: 2,
|
|
236
|
+
description: "Check if array contains item",
|
|
237
|
+
hasSideEffects: false,
|
|
238
|
+
returnType: "boolean",
|
|
239
|
+
params: [
|
|
240
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
241
|
+
{ name: "item", type: "any", description: "Item to find" }
|
|
242
|
+
],
|
|
243
|
+
example: '["array/includes", [1, 2, 3], 2] // => true'
|
|
244
|
+
},
|
|
245
|
+
"array/indexOf": {
|
|
246
|
+
module: "array",
|
|
247
|
+
category: "std-array",
|
|
248
|
+
minArity: 2,
|
|
249
|
+
maxArity: 2,
|
|
250
|
+
description: "Find index of item (-1 if not found)",
|
|
251
|
+
hasSideEffects: false,
|
|
252
|
+
returnType: "number",
|
|
253
|
+
params: [
|
|
254
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
255
|
+
{ name: "item", type: "any", description: "Item to find" }
|
|
256
|
+
],
|
|
257
|
+
example: '["array/indexOf", [1, 2, 3], 2] // => 1'
|
|
258
|
+
},
|
|
259
|
+
"array/find": {
|
|
260
|
+
module: "array",
|
|
261
|
+
category: "std-array",
|
|
262
|
+
minArity: 2,
|
|
263
|
+
maxArity: 2,
|
|
264
|
+
description: "Find first element matching predicate",
|
|
265
|
+
hasSideEffects: false,
|
|
266
|
+
returnType: "any",
|
|
267
|
+
acceptsLambda: true,
|
|
268
|
+
lambdaArgPosition: 1,
|
|
269
|
+
params: [
|
|
270
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
271
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
272
|
+
],
|
|
273
|
+
example: '["array/find", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
|
|
274
|
+
},
|
|
275
|
+
"array/findIndex": {
|
|
276
|
+
module: "array",
|
|
277
|
+
category: "std-array",
|
|
278
|
+
minArity: 2,
|
|
279
|
+
maxArity: 2,
|
|
280
|
+
description: "Find index of first element matching predicate (-1 if none)",
|
|
281
|
+
hasSideEffects: false,
|
|
282
|
+
returnType: "number",
|
|
283
|
+
acceptsLambda: true,
|
|
284
|
+
lambdaArgPosition: 1,
|
|
285
|
+
params: [
|
|
286
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
287
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
288
|
+
],
|
|
289
|
+
example: '["array/findIndex", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
|
|
290
|
+
},
|
|
291
|
+
"array/filter": {
|
|
292
|
+
module: "array",
|
|
293
|
+
category: "std-array",
|
|
294
|
+
minArity: 2,
|
|
295
|
+
maxArity: 2,
|
|
296
|
+
description: "Keep elements matching predicate",
|
|
297
|
+
hasSideEffects: false,
|
|
298
|
+
returnType: "array",
|
|
299
|
+
acceptsLambda: true,
|
|
300
|
+
lambdaArgPosition: 1,
|
|
301
|
+
params: [
|
|
302
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
303
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
304
|
+
],
|
|
305
|
+
example: '["array/filter", "@items", ["fn", "x", [">", "@x.price", 100]]]'
|
|
306
|
+
},
|
|
307
|
+
"array/reject": {
|
|
308
|
+
module: "array",
|
|
309
|
+
category: "std-array",
|
|
310
|
+
minArity: 2,
|
|
311
|
+
maxArity: 2,
|
|
312
|
+
description: "Remove elements matching predicate",
|
|
313
|
+
hasSideEffects: false,
|
|
314
|
+
returnType: "array",
|
|
315
|
+
acceptsLambda: true,
|
|
316
|
+
lambdaArgPosition: 1,
|
|
317
|
+
params: [
|
|
318
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
319
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
320
|
+
],
|
|
321
|
+
example: '["array/reject", "@items", ["fn", "x", ["=", "@x.status", "deleted"]]]'
|
|
322
|
+
},
|
|
323
|
+
"array/map": {
|
|
324
|
+
module: "array",
|
|
325
|
+
category: "std-array",
|
|
326
|
+
minArity: 2,
|
|
327
|
+
maxArity: 2,
|
|
328
|
+
description: "Transform each element",
|
|
329
|
+
hasSideEffects: false,
|
|
330
|
+
returnType: "array",
|
|
331
|
+
acceptsLambda: true,
|
|
332
|
+
lambdaArgPosition: 1,
|
|
333
|
+
params: [
|
|
334
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
335
|
+
{ name: "fn", type: "lambda", description: "Transform function" }
|
|
336
|
+
],
|
|
337
|
+
example: '["array/map", "@items", ["fn", "x", ["*", "@x.price", 1.1]]]'
|
|
338
|
+
},
|
|
339
|
+
"array/reduce": {
|
|
340
|
+
module: "array",
|
|
341
|
+
category: "std-array",
|
|
342
|
+
minArity: 3,
|
|
343
|
+
maxArity: 3,
|
|
344
|
+
description: "Reduce array to single value",
|
|
345
|
+
hasSideEffects: false,
|
|
346
|
+
returnType: "any",
|
|
347
|
+
acceptsLambda: true,
|
|
348
|
+
lambdaArgPosition: 1,
|
|
349
|
+
params: [
|
|
350
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
351
|
+
{ name: "fn", type: "lambda", description: "Reducer function (acc, item) => newAcc" },
|
|
352
|
+
{ name: "init", type: "any", description: "Initial accumulator value" }
|
|
353
|
+
],
|
|
354
|
+
example: '["array/reduce", "@items", ["fn", ["acc", "x"], ["+", "@acc", "@x.price"]], 0]'
|
|
355
|
+
},
|
|
356
|
+
"array/every": {
|
|
357
|
+
module: "array",
|
|
358
|
+
category: "std-array",
|
|
359
|
+
minArity: 2,
|
|
360
|
+
maxArity: 2,
|
|
361
|
+
description: "Check if all elements match predicate",
|
|
362
|
+
hasSideEffects: false,
|
|
363
|
+
returnType: "boolean",
|
|
364
|
+
acceptsLambda: true,
|
|
365
|
+
lambdaArgPosition: 1,
|
|
366
|
+
params: [
|
|
367
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
368
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
369
|
+
],
|
|
370
|
+
example: '["array/every", "@items", ["fn", "x", [">", "@x.price", 0]]]'
|
|
371
|
+
},
|
|
372
|
+
"array/some": {
|
|
373
|
+
module: "array",
|
|
374
|
+
category: "std-array",
|
|
375
|
+
minArity: 2,
|
|
376
|
+
maxArity: 2,
|
|
377
|
+
description: "Check if any element matches predicate",
|
|
378
|
+
hasSideEffects: false,
|
|
379
|
+
returnType: "boolean",
|
|
380
|
+
acceptsLambda: true,
|
|
381
|
+
lambdaArgPosition: 1,
|
|
382
|
+
params: [
|
|
383
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
384
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
385
|
+
],
|
|
386
|
+
example: '["array/some", "@items", ["fn", "x", ["=", "@x.status", "active"]]]'
|
|
387
|
+
},
|
|
388
|
+
"array/count": {
|
|
389
|
+
module: "array",
|
|
390
|
+
category: "std-array",
|
|
391
|
+
minArity: 1,
|
|
392
|
+
maxArity: 2,
|
|
393
|
+
description: "Count elements (optionally matching predicate)",
|
|
394
|
+
hasSideEffects: false,
|
|
395
|
+
returnType: "number",
|
|
396
|
+
acceptsLambda: true,
|
|
397
|
+
lambdaArgPosition: 1,
|
|
398
|
+
params: [
|
|
399
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
400
|
+
{ name: "pred", type: "lambda", description: "Predicate function", optional: true }
|
|
401
|
+
],
|
|
402
|
+
example: '["array/count", "@tasks", ["fn", "t", ["=", "@t.status", "done"]]]'
|
|
403
|
+
},
|
|
404
|
+
"array/sum": {
|
|
405
|
+
module: "array",
|
|
406
|
+
category: "std-array",
|
|
407
|
+
minArity: 1,
|
|
408
|
+
maxArity: 2,
|
|
409
|
+
description: "Sum values (optionally by field)",
|
|
410
|
+
hasSideEffects: false,
|
|
411
|
+
returnType: "number",
|
|
412
|
+
params: [
|
|
413
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
414
|
+
{ name: "key", type: "string", description: "Field to sum", optional: true }
|
|
415
|
+
],
|
|
416
|
+
example: '["array/sum", "@cart.items", "price"]'
|
|
417
|
+
},
|
|
418
|
+
"array/avg": {
|
|
419
|
+
module: "array",
|
|
420
|
+
category: "std-array",
|
|
421
|
+
minArity: 1,
|
|
422
|
+
maxArity: 2,
|
|
423
|
+
description: "Average of values (optionally by field)",
|
|
424
|
+
hasSideEffects: false,
|
|
425
|
+
returnType: "number",
|
|
426
|
+
params: [
|
|
427
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
428
|
+
{ name: "key", type: "string", description: "Field to average", optional: true }
|
|
429
|
+
],
|
|
430
|
+
example: '["array/avg", "@ratings", "score"]'
|
|
431
|
+
},
|
|
432
|
+
"array/min": {
|
|
433
|
+
module: "array",
|
|
434
|
+
category: "std-array",
|
|
435
|
+
minArity: 1,
|
|
436
|
+
maxArity: 2,
|
|
437
|
+
description: "Minimum value (optionally by field)",
|
|
438
|
+
hasSideEffects: false,
|
|
439
|
+
returnType: "number",
|
|
440
|
+
params: [
|
|
441
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
442
|
+
{ name: "key", type: "string", description: "Field to compare", optional: true }
|
|
443
|
+
],
|
|
444
|
+
example: '["array/min", "@products", "price"]'
|
|
445
|
+
},
|
|
446
|
+
"array/max": {
|
|
447
|
+
module: "array",
|
|
448
|
+
category: "std-array",
|
|
449
|
+
minArity: 1,
|
|
450
|
+
maxArity: 2,
|
|
451
|
+
description: "Maximum value (optionally by field)",
|
|
452
|
+
hasSideEffects: false,
|
|
453
|
+
returnType: "number",
|
|
454
|
+
params: [
|
|
455
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
456
|
+
{ name: "key", type: "string", description: "Field to compare", optional: true }
|
|
457
|
+
],
|
|
458
|
+
example: '["array/max", "@products", "price"]'
|
|
459
|
+
},
|
|
460
|
+
"array/groupBy": {
|
|
461
|
+
module: "array",
|
|
462
|
+
category: "std-array",
|
|
463
|
+
minArity: 2,
|
|
464
|
+
maxArity: 2,
|
|
465
|
+
description: "Group elements by field value",
|
|
466
|
+
hasSideEffects: false,
|
|
467
|
+
returnType: "any",
|
|
468
|
+
params: [
|
|
469
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
470
|
+
{ name: "key", type: "string", description: "Field to group by" }
|
|
471
|
+
],
|
|
472
|
+
example: '["array/groupBy", "@orders", "status"]'
|
|
473
|
+
},
|
|
474
|
+
"array/partition": {
|
|
475
|
+
module: "array",
|
|
476
|
+
category: "std-array",
|
|
477
|
+
minArity: 2,
|
|
478
|
+
maxArity: 2,
|
|
479
|
+
description: "Split array by predicate into [matches, nonMatches]",
|
|
480
|
+
hasSideEffects: false,
|
|
481
|
+
returnType: "array",
|
|
482
|
+
acceptsLambda: true,
|
|
483
|
+
lambdaArgPosition: 1,
|
|
484
|
+
params: [
|
|
485
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
486
|
+
{ name: "pred", type: "lambda", description: "Predicate function" }
|
|
487
|
+
],
|
|
488
|
+
example: '["array/partition", "@items", ["fn", "x", [">", "@x.price", 50]]]'
|
|
489
|
+
},
|
|
490
|
+
"array/take": {
|
|
491
|
+
module: "array",
|
|
492
|
+
category: "std-array",
|
|
493
|
+
minArity: 2,
|
|
494
|
+
maxArity: 2,
|
|
495
|
+
description: "Take first n elements",
|
|
496
|
+
hasSideEffects: false,
|
|
497
|
+
returnType: "array",
|
|
498
|
+
params: [
|
|
499
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
500
|
+
{ name: "n", type: "number", description: "Number of elements" }
|
|
501
|
+
],
|
|
502
|
+
example: '["array/take", "@items", 5]'
|
|
503
|
+
},
|
|
504
|
+
"array/drop": {
|
|
505
|
+
module: "array",
|
|
506
|
+
category: "std-array",
|
|
507
|
+
minArity: 2,
|
|
508
|
+
maxArity: 2,
|
|
509
|
+
description: "Skip first n elements",
|
|
510
|
+
hasSideEffects: false,
|
|
511
|
+
returnType: "array",
|
|
512
|
+
params: [
|
|
513
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
514
|
+
{ name: "n", type: "number", description: "Number of elements to skip" }
|
|
515
|
+
],
|
|
516
|
+
example: '["array/drop", "@items", 5]'
|
|
517
|
+
},
|
|
518
|
+
"array/takeLast": {
|
|
519
|
+
module: "array",
|
|
520
|
+
category: "std-array",
|
|
521
|
+
minArity: 2,
|
|
522
|
+
maxArity: 2,
|
|
523
|
+
description: "Take last n elements",
|
|
524
|
+
hasSideEffects: false,
|
|
525
|
+
returnType: "array",
|
|
526
|
+
params: [
|
|
527
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
528
|
+
{ name: "n", type: "number", description: "Number of elements" }
|
|
529
|
+
],
|
|
530
|
+
example: '["array/takeLast", "@items", 3]'
|
|
531
|
+
},
|
|
532
|
+
"array/dropLast": {
|
|
533
|
+
module: "array",
|
|
534
|
+
category: "std-array",
|
|
535
|
+
minArity: 2,
|
|
536
|
+
maxArity: 2,
|
|
537
|
+
description: "Skip last n elements",
|
|
538
|
+
hasSideEffects: false,
|
|
539
|
+
returnType: "array",
|
|
540
|
+
params: [
|
|
541
|
+
{ name: "arr", type: "array", description: "The array" },
|
|
542
|
+
{ name: "n", type: "number", description: "Number of elements to skip" }
|
|
543
|
+
],
|
|
544
|
+
example: '["array/dropLast", "@items", 2]'
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
function getArrayOperators() {
|
|
548
|
+
return Object.keys(ARRAY_OPERATORS);
|
|
549
|
+
}
|
|
550
|
+
function getLambdaArrayOperators() {
|
|
551
|
+
return Object.entries(ARRAY_OPERATORS).filter(([, meta]) => meta.acceptsLambda).map(([name]) => name);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export { ARRAY_OPERATORS, getArrayOperators, getLambdaArrayOperators };
|
|
555
|
+
//# sourceMappingURL=array.js.map
|
|
556
|
+
//# sourceMappingURL=array.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../modules/array.ts"],"names":[],"mappings":";AAiBO,IAAM,eAAA,GAAmD;AAAA,EAC9D,WAAA,EAAa;AAAA,IACX,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,cAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,OAAO,IAAA,EAAM,OAAA,EAAS,WAAA,EAAa,WAAA,EAAa,CAAA;AAAA,IACjE,OAAA,EAAS;AAAA,GACX;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,yBAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,SAAA;AAAA,IACZ,MAAA,EAAQ,CAAC,EAAE,IAAA,EAAM,OAAO,IAAA,EAAM,OAAA,EAAS,WAAA,EAAa,WAAA,EAAa,CAAA;AAAA,IACjE,OAAA,EAAS;AAAA,GACX;AAAA,EACA,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,mBAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,KAAA;AAAA,IACZ,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AA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,KAAA,EAAO,IAAA,EAAM,OAAA,EAAS,aAAa,WAAA,EAAY;AAAA,MACvD,EAAE,IAAA,EAAM,GAAA,EAAK,IAAA,EAAM,QAAA,EAAU,aAAa,4BAAA;AAA6B,KACzE;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC;AAKO,SAAS,uBAAA,GAAoC;AAClD,EAAA,OAAO,OAAO,OAAA,CAAQ,eAAe,EAClC,MAAA,CAAO,CAAC,GAAG,IAAI,CAAA,KAAM,IAAA,CAAK,aAAa,CAAA,CACvC,GAAA,CAAI,CAAC,CAAC,IAAI,MAAM,IAAI,CAAA;AACzB","file":"array.js","sourcesContent":["/**\n * Array Module - Collection Operations\n *\n * Provides array manipulation and transformation functions.\n * Many functions accept lambda expressions for predicates and transformations.\n *\n * Lambda syntax: [\"fn\", \"varName\", expression] or [\"fn\", [\"a\", \"b\"], expression]\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Array module operators.\n * All operators return arrays (or other values) and have no side effects.\n */\nexport const ARRAY_OPERATORS: Record<string, StdOperatorMeta> = {\n 'array/len': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Array length',\n hasSideEffects: false,\n returnType: 'number',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/len\", [1, 2, 3]] // => 3',\n },\n 'array/empty?': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Check if array is empty',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/empty?\", []] // => true',\n },\n 'array/first': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Get first element',\n hasSideEffects: false,\n returnType: 'any',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/first\", [1, 2, 3]] // => 1',\n },\n 'array/last': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Get last element',\n hasSideEffects: false,\n returnType: 'any',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/last\", [1, 2, 3]] // => 3',\n },\n 'array/nth': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Get element at index',\n hasSideEffects: false,\n returnType: 'any',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'index', type: 'number', description: 'Index (0-based)' },\n ],\n example: '[\"array/nth\", [1, 2, 3], 1] // => 2',\n },\n 'array/slice': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 3,\n description: 'Extract subarray',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'start', type: 'number', description: 'Start index' },\n { name: 'end', type: 'number', description: 'End index (exclusive)', optional: true },\n ],\n example: '[\"array/slice\", [1, 2, 3, 4], 1, 3] // => [2, 3]',\n },\n 'array/concat': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: null,\n description: 'Concatenate arrays',\n hasSideEffects: false,\n returnType: 'array',\n params: [{ name: '...arrs', type: 'array[]', description: 'Arrays to concatenate' }],\n example: '[\"array/concat\", [1, 2], [3, 4]] // => [1, 2, 3, 4]',\n },\n 'array/append': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Add item to end (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'item', type: 'any', description: 'Item to add' },\n ],\n example: '[\"array/append\", [1, 2], 3] // => [1, 2, 3]',\n },\n 'array/prepend': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Add item to start (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'item', type: 'any', description: 'Item to add' },\n ],\n example: '[\"array/prepend\", [2, 3], 1] // => [1, 2, 3]',\n },\n 'array/insert': {\n module: 'array',\n category: 'std-array',\n minArity: 3,\n maxArity: 3,\n description: 'Insert item at index (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'index', type: 'number', description: 'Index to insert at' },\n { name: 'item', type: 'any', description: 'Item to insert' },\n ],\n example: '[\"array/insert\", [1, 3], 1, 2] // => [1, 2, 3]',\n },\n 'array/remove': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Remove item at index (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'index', type: 'number', description: 'Index to remove' },\n ],\n example: '[\"array/remove\", [1, 2, 3], 1] // => [1, 3]',\n },\n 'array/removeItem': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Remove first matching item (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'item', type: 'any', description: 'Item to remove' },\n ],\n example: '[\"array/removeItem\", [1, 2, 3, 2], 2] // => [1, 3, 2]',\n },\n 'array/reverse': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Reverse array order (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/reverse\", [1, 2, 3]] // => [3, 2, 1]',\n },\n 'array/sort': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 3,\n description: 'Sort array (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'key', type: 'string', description: 'Field to sort by (for objects)', optional: true },\n { name: 'dir', type: 'string', description: '\"asc\" or \"desc\"', optional: true, defaultValue: 'asc' },\n ],\n example: '[\"array/sort\", \"@items\", \"price\", \"desc\"]',\n },\n 'array/shuffle': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Randomly shuffle array (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/shuffle\", [1, 2, 3, 4, 5]]',\n },\n 'array/unique': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Remove duplicates (returns new array)',\n hasSideEffects: false,\n returnType: 'array',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/unique\", [1, 2, 2, 3, 1]] // => [1, 2, 3]',\n },\n 'array/flatten': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 1,\n description: 'Flatten nested arrays one level',\n hasSideEffects: false,\n returnType: 'array',\n params: [{ name: 'arr', type: 'array', description: 'The array' }],\n example: '[\"array/flatten\", [[1, 2], [3, 4]]] // => [1, 2, 3, 4]',\n },\n 'array/zip': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Pair elements from two arrays',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr1', type: 'array', description: 'First array' },\n { name: 'arr2', type: 'array', description: 'Second array' },\n ],\n example: '[\"array/zip\", [1, 2], [\"a\", \"b\"]] // => [[1, \"a\"], [2, \"b\"]]',\n },\n 'array/includes': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Check if array contains item',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'item', type: 'any', description: 'Item to find' },\n ],\n example: '[\"array/includes\", [1, 2, 3], 2] // => true',\n },\n 'array/indexOf': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Find index of item (-1 if not found)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'item', type: 'any', description: 'Item to find' },\n ],\n example: '[\"array/indexOf\", [1, 2, 3], 2] // => 1',\n },\n 'array/find': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Find first element matching predicate',\n hasSideEffects: false,\n returnType: 'any',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/find\", \"@items\", [\"fn\", \"x\", [\"=\", \"@x.status\", \"active\"]]]',\n },\n 'array/findIndex': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Find index of first element matching predicate (-1 if none)',\n hasSideEffects: false,\n returnType: 'number',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/findIndex\", \"@items\", [\"fn\", \"x\", [\"=\", \"@x.status\", \"active\"]]]',\n },\n 'array/filter': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Keep elements matching predicate',\n hasSideEffects: false,\n returnType: 'array',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/filter\", \"@items\", [\"fn\", \"x\", [\">\", \"@x.price\", 100]]]',\n },\n 'array/reject': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Remove elements matching predicate',\n hasSideEffects: false,\n returnType: 'array',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/reject\", \"@items\", [\"fn\", \"x\", [\"=\", \"@x.status\", \"deleted\"]]]',\n },\n 'array/map': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Transform each element',\n hasSideEffects: false,\n returnType: 'array',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'fn', type: 'lambda', description: 'Transform function' },\n ],\n example: '[\"array/map\", \"@items\", [\"fn\", \"x\", [\"*\", \"@x.price\", 1.1]]]',\n },\n 'array/reduce': {\n module: 'array',\n category: 'std-array',\n minArity: 3,\n maxArity: 3,\n description: 'Reduce array to single value',\n hasSideEffects: false,\n returnType: 'any',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'fn', type: 'lambda', description: 'Reducer function (acc, item) => newAcc' },\n { name: 'init', type: 'any', description: 'Initial accumulator value' },\n ],\n example: '[\"array/reduce\", \"@items\", [\"fn\", [\"acc\", \"x\"], [\"+\", \"@acc\", \"@x.price\"]], 0]',\n },\n 'array/every': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Check if all elements match predicate',\n hasSideEffects: false,\n returnType: 'boolean',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/every\", \"@items\", [\"fn\", \"x\", [\">\", \"@x.price\", 0]]]',\n },\n 'array/some': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Check if any element matches predicate',\n hasSideEffects: false,\n returnType: 'boolean',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/some\", \"@items\", [\"fn\", \"x\", [\"=\", \"@x.status\", \"active\"]]]',\n },\n 'array/count': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 2,\n description: 'Count elements (optionally matching predicate)',\n hasSideEffects: false,\n returnType: 'number',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function', optional: true },\n ],\n example: '[\"array/count\", \"@tasks\", [\"fn\", \"t\", [\"=\", \"@t.status\", \"done\"]]]',\n },\n 'array/sum': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 2,\n description: 'Sum values (optionally by field)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'key', type: 'string', description: 'Field to sum', optional: true },\n ],\n example: '[\"array/sum\", \"@cart.items\", \"price\"]',\n },\n 'array/avg': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 2,\n description: 'Average of values (optionally by field)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'key', type: 'string', description: 'Field to average', optional: true },\n ],\n example: '[\"array/avg\", \"@ratings\", \"score\"]',\n },\n 'array/min': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 2,\n description: 'Minimum value (optionally by field)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'key', type: 'string', description: 'Field to compare', optional: true },\n ],\n example: '[\"array/min\", \"@products\", \"price\"]',\n },\n 'array/max': {\n module: 'array',\n category: 'std-array',\n minArity: 1,\n maxArity: 2,\n description: 'Maximum value (optionally by field)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'key', type: 'string', description: 'Field to compare', optional: true },\n ],\n example: '[\"array/max\", \"@products\", \"price\"]',\n },\n 'array/groupBy': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Group elements by field value',\n hasSideEffects: false,\n returnType: 'any',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'key', type: 'string', description: 'Field to group by' },\n ],\n example: '[\"array/groupBy\", \"@orders\", \"status\"]',\n },\n 'array/partition': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Split array by predicate into [matches, nonMatches]',\n hasSideEffects: false,\n returnType: 'array',\n acceptsLambda: true,\n lambdaArgPosition: 1,\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'pred', type: 'lambda', description: 'Predicate function' },\n ],\n example: '[\"array/partition\", \"@items\", [\"fn\", \"x\", [\">\", \"@x.price\", 50]]]',\n },\n 'array/take': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Take first n elements',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'n', type: 'number', description: 'Number of elements' },\n ],\n example: '[\"array/take\", \"@items\", 5]',\n },\n 'array/drop': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Skip first n elements',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'n', type: 'number', description: 'Number of elements to skip' },\n ],\n example: '[\"array/drop\", \"@items\", 5]',\n },\n 'array/takeLast': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Take last n elements',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'n', type: 'number', description: 'Number of elements' },\n ],\n example: '[\"array/takeLast\", \"@items\", 3]',\n },\n 'array/dropLast': {\n module: 'array',\n category: 'std-array',\n minArity: 2,\n maxArity: 2,\n description: 'Skip last n elements',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'arr', type: 'array', description: 'The array' },\n { name: 'n', type: 'number', description: 'Number of elements to skip' },\n ],\n example: '[\"array/dropLast\", \"@items\", 2]',\n },\n};\n\n/**\n * Get all array operator names.\n */\nexport function getArrayOperators(): string[] {\n return Object.keys(ARRAY_OPERATORS);\n}\n\n/**\n * Get all array operators that accept lambda expressions.\n */\nexport function getLambdaArrayOperators(): string[] {\n return Object.entries(ARRAY_OPERATORS)\n .filter(([, meta]) => meta.acceptsLambda)\n .map(([name]) => name);\n}\n"]}
|