@nordcraft/std-lib 1.0.10 → 1.0.12

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/dist/lib.ts CHANGED
@@ -1,57 +1,79 @@
1
1
 
2
2
  export const formulas = {
3
- "@toddle/getFromSessionStorage": {
4
- "name": "Get from Session Storage",
5
- "description": "Read a value from session storage with the provided key.",
6
- "cache": false,
3
+ "@toddle/typeOf": {
4
+ "name": "Type of",
5
+ "description": "Get the type of a given input.",
7
6
  "arguments": [
8
7
  {
9
- "name": "Key",
8
+ "name": "Input",
10
9
  "formula": {
11
10
  "type": "value",
12
- "value": null
11
+ "value": 1
13
12
  },
14
- "description": "The key to read from session storage.",
13
+ "description": "The input value.",
15
14
  "type": {
16
- "type": "String"
15
+ "type": "Any"
17
16
  }
18
17
  }
19
18
  ],
20
19
  "output": {
21
- "description": "The value found in session storage.",
20
+ "description": "The type of the input value. Types can be one of: String, Boolean, Number, Array, Object, or Null.",
22
21
  "type": {
23
22
  "type": "Any"
24
23
  }
25
24
  }
26
25
  },
27
- "@toddle/userAgent": {
28
- "name": "User Agent",
29
- "description": "Get the user agent for the browser or from the User-Agent header on the server",
30
- "arguments": [],
26
+ "@toddle/prepend": {
27
+ "name": "Prepend",
28
+ "description": "Add an element to the start of an Array.",
29
+ "arguments": [
30
+ {
31
+ "name": "Array",
32
+ "type": {
33
+ "type": "Array"
34
+ },
35
+ "description": "The Array to prepend to.",
36
+ "formula": {
37
+ "type": "array",
38
+ "arguments": []
39
+ }
40
+ },
41
+ {
42
+ "name": "Item",
43
+ "type": {
44
+ "type": "Any"
45
+ },
46
+ "description": "The item to prepend to the Array.",
47
+ "formula": {
48
+ "type": "value",
49
+ "value": "Item"
50
+ }
51
+ }
52
+ ],
31
53
  "output": {
32
- "description": "The user agent string.",
54
+ "description": "A new Array containing the new item and all the elements from the input Array.",
33
55
  "type": {
34
- "type": "String"
56
+ "type": "Array"
35
57
  }
36
58
  }
37
59
  },
38
- "@toddle/formatDate": {
39
- "name": "Format Date",
60
+ "@toddle/formatNumber": {
61
+ "name": "Format Number",
40
62
  "arguments": [
41
63
  {
42
- "name": "Date",
43
- "description": "Date to format",
64
+ "name": "Input",
65
+ "description": "Number to format.",
44
66
  "type": {
45
- "type": "Date"
67
+ "type": "Number"
46
68
  },
47
69
  "formula": {
48
- "type": "Date",
49
- "value": null
70
+ "type": "Number",
71
+ "value": 100
50
72
  }
51
73
  },
52
74
  {
53
75
  "name": "Locale(s)",
54
- "description": "Optional locale to use for formatting the Date, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
76
+ "description": "Optional locale to use for formatting the Number, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
55
77
  "type": {
56
78
  "type": "String | Array"
57
79
  },
@@ -62,7 +84,7 @@
62
84
  },
63
85
  {
64
86
  "name": "Options",
65
- "description": "Optional Object for configuring the formatting of the output. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#syntax for all options.",
87
+ "description": "Optional Object for configuring the formatting of the output. See the [NumberFormat locale options on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locale_options).",
66
88
  "type": {
67
89
  "type": "Object"
68
90
  },
@@ -72,322 +94,278 @@
72
94
  }
73
95
  }
74
96
  ],
75
- "description": "Format a date using the Intl.DateTimeFormat API. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat for more information.",
97
+ "description": "Format a Number using the Intl.NumberFormat API. See the [NumberFormat docs on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).",
76
98
  "output": {
77
- "description": "The Date input formatted as a String.",
99
+ "description": "The Number input formatted as a String.",
78
100
  "type": {
79
101
  "type": "String"
80
102
  }
81
103
  }
82
104
  },
83
- "@toddle/concatenate": {
84
- "name": "Concatenate",
85
- "description": "Concatenate two or more values.",
105
+ "@toddle/defaultTo": {
106
+ "name": "Default to",
107
+ "description": "Return the first value that is not False or Null.",
86
108
  "arguments": [
87
109
  {
88
110
  "name": "0",
89
111
  "formula": {
90
112
  "type": "value",
91
- "value": ""
113
+ "value": null
92
114
  },
115
+ "description": "The inital value.",
93
116
  "type": {
94
- "type": "Union",
95
- "types": [
96
- {
97
- "type": "String"
98
- },
99
- {
100
- "type": "Array",
101
- "ofType": {
102
- "type": "Any"
103
- }
104
- }
105
- ]
117
+ "type": "Any"
118
+ }
119
+ },
120
+ {
121
+ "name": "1",
122
+ "description": "The first fallback value to be used if the primary value is Null or False.",
123
+ "type": {
124
+ "type": "Any"
125
+ },
126
+ "formula": {
127
+ "type": "value",
128
+ "value": "default"
106
129
  }
107
130
  }
108
131
  ],
109
132
  "variableArguments": true,
110
133
  "output": {
134
+ "description": "Returns the first value that is not False or Null. Returns Null if no valid values is given.",
111
135
  "type": {
112
- "type": "Union",
113
- "types": [
114
- {
115
- "type": "String"
116
- },
117
- {
118
- "type": "Array",
119
- "ofType": {
120
- "type": "Any"
121
- }
122
- }
123
- ]
124
- },
125
- "description": "Returns a String or Array containing all the specified input values."
136
+ "type": "Any"
137
+ }
126
138
  }
127
139
  },
128
- "@toddle/squareRoot": {
129
- "name": "Square root",
130
- "description": "Get the square root of a Number.",
140
+ "@toddle/power": {
141
+ "name": "Power",
142
+ "description": "Raise a number to a power.",
131
143
  "arguments": [
132
144
  {
133
- "name": "Number",
145
+ "name": "Base",
134
146
  "formula": {
135
147
  "type": "value",
136
- "value": 1
148
+ "value": 3
137
149
  },
138
- "description": "The input Number.",
150
+ "description": "The number to be raised to the exponent.",
151
+ "type": {
152
+ "type": "Number"
153
+ }
154
+ },
155
+ {
156
+ "name": "Exponent",
157
+ "formula": {
158
+ "type": "value",
159
+ "value": 2
160
+ },
161
+ "description": "The exponent to raise the base to.",
139
162
  "type": {
140
163
  "type": "Number"
141
164
  }
142
165
  }
143
166
  ],
144
167
  "output": {
145
- "description": "The square root of the input Number.",
146
168
  "type": {
147
169
  "type": "Number"
148
- }
170
+ },
171
+ "description": "The result of raising the base to the exponent."
149
172
  }
150
173
  },
151
- "@toddle/lessOrEqual": {
152
- "name": "Less or equal",
153
- "description": "Compute if a value is smaller than or equal to another value.",
174
+ "@toddle/set": {
175
+ "name": "Set",
176
+ "description": "Set a value in an Object or Array based on a specified path.",
154
177
  "arguments": [
155
178
  {
156
- "name": "First",
179
+ "name": "Object",
157
180
  "formula": {
158
181
  "type": "value",
159
- "value": ""
182
+ "value": null
160
183
  },
161
- "description": "First Number to be compared.",
184
+ "description": "The input Object.",
162
185
  "type": {
163
- "type": "Number"
186
+ "type": "Object"
164
187
  }
165
188
  },
166
189
  {
167
- "name": "Second",
190
+ "name": "Path",
168
191
  "formula": {
169
192
  "type": "value",
170
- "value": ""
193
+ "value": "Key"
171
194
  },
172
- "description": "Second Number to be compared.",
195
+ "description": "The Path can be either a Number, a String or an Array of Strings.",
173
196
  "type": {
174
- "type": "Number"
197
+ "type": "Union",
198
+ "types": [
199
+ {
200
+ "type": "Array"
201
+ },
202
+ {
203
+ "type": "String"
204
+ },
205
+ {
206
+ "type": "Number"
207
+ }
208
+ ]
209
+ }
210
+ },
211
+ {
212
+ "name": "Value",
213
+ "formula": {
214
+ "type": "value",
215
+ "value": "Item"
216
+ },
217
+ "description": "The value to set.",
218
+ "type": {
219
+ "type": "Any"
175
220
  }
176
221
  }
177
222
  ],
178
223
  "output": {
179
- "description": "Returns True if the First Number is smaller than or equal to the second Number, otherwise it returns False.",
224
+ "description": "The input Object with the new field.",
180
225
  "type": {
181
- "type": "Boolean"
226
+ "type": "Object"
182
227
  }
183
228
  }
184
229
  },
185
- "@toddle/trim": {
186
- "name": "Trim",
187
- "description": "Remove any leading and trailing white spaces from a String.",
230
+ "@toddle/concatenate": {
231
+ "name": "Concatenate",
232
+ "description": "Concatenate two or more values.",
188
233
  "arguments": [
189
234
  {
190
- "name": "String",
235
+ "name": "0",
191
236
  "formula": {
192
237
  "type": "value",
193
238
  "value": ""
194
239
  },
195
- "description": "The String to trim.",
196
240
  "type": {
197
- "type": "String"
241
+ "type": "Union",
242
+ "types": [
243
+ {
244
+ "type": "String"
245
+ },
246
+ {
247
+ "type": "Array",
248
+ "ofType": {
249
+ "type": "Any"
250
+ }
251
+ }
252
+ ]
198
253
  }
199
254
  }
200
255
  ],
256
+ "variableArguments": true,
201
257
  "output": {
202
- "description": "The trimmed String.",
203
258
  "type": {
204
- "type": "String"
205
- }
259
+ "type": "Union",
260
+ "types": [
261
+ {
262
+ "type": "String"
263
+ },
264
+ {
265
+ "type": "Array",
266
+ "ofType": {
267
+ "type": "Any"
268
+ }
269
+ }
270
+ ]
271
+ },
272
+ "description": "Returns a String or Array containing all the specified input values."
206
273
  }
207
274
  },
208
- "@toddle/min": {
209
- "name": "Min",
210
- "description": "Find the smallest Number from a list of inputs.",
275
+ "@toddle/greaterOrEqueal": {
276
+ "name": "Greater or equal",
277
+ "description": "Compute whether a value is larger than or equal to another value.",
211
278
  "arguments": [
212
279
  {
213
- "name": "0",
280
+ "name": "First",
214
281
  "formula": {
215
282
  "type": "value",
216
- "value": null
283
+ "value": ""
217
284
  },
218
- "description": "Input number",
285
+ "description": "First value to be compared.",
219
286
  "type": {
220
287
  "type": "Number"
221
288
  }
222
289
  },
223
290
  {
224
- "name": "1",
291
+ "name": "Second",
225
292
  "formula": {
226
293
  "type": "value",
227
- "value": null
294
+ "value": ""
228
295
  },
229
- "description": "Input number",
296
+ "description": "Second value to be compared.",
230
297
  "type": {
231
298
  "type": "Number"
232
299
  }
233
300
  }
234
301
  ],
235
- "variableArguments": true,
236
302
  "output": {
237
- "description": "The smallest of the input Numbers.",
238
- "type": {
239
- "type": "Number"
240
- }
241
- }
242
- },
243
- "@toddle/flatten": {
244
- "name": "Flatten",
245
- "description": "Flatten a nested Array.",
246
- "arguments": [
247
- {
248
- "name": "Array",
249
- "description": "An Array containing one or more Arrays.",
250
- "type": {
251
- "type": "Array"
252
- },
253
- "formula": {
254
- "type": "array",
255
- "arguments": []
256
- }
257
- }
258
- ],
259
- "output": {
260
- "description": "A flattened Array where all items in the original array are concatenated.",
261
- "type": {
262
- "type": "Array"
263
- }
264
- }
265
- },
266
- "@toddle/some": {
267
- "name": "Some",
268
- "description": "Run a formula on all items of an Array to determine if any item matches a set of conditions.",
269
- "arguments": [
270
- {
271
- "name": "Array",
272
- "formula": {
273
- "type": "value",
274
- "value": null
275
- },
276
- "description": "The Array of items to evaluate.",
277
- "type": {
278
- "type": "Array"
279
- }
280
- },
281
- {
282
- "name": "Formula",
283
- "isFunction": true,
284
- "formula": {
285
- "type": "path",
286
- "path": [
287
- "Args",
288
- "item"
289
- ]
290
- },
291
- "description": "Predicate formula for evaluating each item.",
292
- "type": {
293
- "type": "Formula"
294
- }
295
- }
296
- ],
297
- "output": {
298
- "description": "Returns True if the predicate formula returns True for any items in the Array, otherwise False.",
303
+ "description": "Returns True if the first Number is larger than or equal to the second Number.",
299
304
  "type": {
300
305
  "type": "Boolean"
301
306
  }
302
307
  }
303
308
  },
304
- "@toddle/find": {
305
- "name": "Find",
306
- "description": "Search through an Array of items and apply a formula to each item, to return the first item where the provided formula returns True.",
309
+ "@toddle/indexOf": {
310
+ "name": "Index of",
311
+ "description": "Find the index of a specific item in an Array or String.",
307
312
  "arguments": [
308
313
  {
309
314
  "name": "Array",
310
315
  "formula": {
311
316
  "type": "value",
312
- "value": null
317
+ "value": ""
313
318
  },
314
- "description": "The array to search through",
319
+ "description": "The Array or String to search.",
315
320
  "type": {
316
- "type": "Array"
317
- }
318
- },
319
- {
320
- "name": "Formula",
321
- "isFunction": true,
322
- "formula": {
323
- "type": "path",
324
- "path": [
325
- "Args",
326
- "item"
321
+ "type": "Union",
322
+ "types": [
323
+ {
324
+ "type": "String"
325
+ },
326
+ {
327
+ "type": "Array"
328
+ }
327
329
  ]
328
- },
329
- "description": "The predicate formula that each item in the array is passed to.",
330
- "type": {
331
- "type": "Formula"
332
330
  }
333
- }
334
- ],
335
- "output": {
336
- "description": "The first item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
337
- "type": {
338
- "type": "Any"
339
- }
340
- }
341
- },
342
- "@toddle/fromEntries": {
343
- "name": "From entries",
344
- "description": "Create a record from an Array of entries. This formula is the reverse of Entries.",
345
- "arguments": [
331
+ },
346
332
  {
347
- "name": "Array",
333
+ "name": "Item",
348
334
  "formula": {
349
335
  "type": "value",
350
- "value": null
336
+ "value": ""
351
337
  },
352
- "description": "The array of entries.",
338
+ "description": "The items to search for.",
353
339
  "type": {
354
- "type": "Array"
340
+ "type": "Any"
355
341
  }
356
342
  }
357
343
  ],
358
344
  "output": {
359
- "description": "An Object containing all entries from the input Array.",
345
+ "description": "If the item exists in the Array, the index of that item is returned. If the item is not found, -1 is returned.",
360
346
  "type": {
361
- "type": "Object"
347
+ "type": "Number"
362
348
  }
363
349
  }
364
350
  },
365
- "@toddle/drop": {
366
- "name": "Drop",
367
- "description": "Remove items from the beginning of an Array or String.",
351
+ "@toddle/divide": {
352
+ "name": "Divide",
353
+ "description": "Perform a division calculation.",
368
354
  "arguments": [
369
355
  {
370
- "name": "Array",
356
+ "name": "Dividend",
357
+ "description": "The number to be divided.",
358
+ "type": {
359
+ "type": "Number"
360
+ },
371
361
  "formula": {
372
362
  "type": "value",
373
- "value": null
374
- },
375
- "description": "Input array",
376
- "type": {
377
- "type": "Union",
378
- "types": [
379
- {
380
- "type": "String"
381
- },
382
- {
383
- "type": "Array"
384
- }
385
- ]
363
+ "value": 1
386
364
  }
387
365
  },
388
366
  {
389
- "name": "Count",
390
- "description": "Number of items to remove.",
367
+ "name": "Divisor",
368
+ "description": "The number to divide by.",
391
369
  "type": {
392
370
  "type": "Number"
393
371
  },
@@ -398,17 +376,9 @@
398
376
  }
399
377
  ],
400
378
  "output": {
401
- "description": "A copy of the list without the first items.",
379
+ "description": "The result of dividing the dividend with the divisor.",
402
380
  "type": {
403
- "type": "Union",
404
- "types": [
405
- {
406
- "type": "String"
407
- },
408
- {
409
- "type": "Array"
410
- }
411
- ]
381
+ "type": "Number"
412
382
  }
413
383
  }
414
384
  },
@@ -452,156 +422,126 @@
452
422
  }
453
423
  }
454
424
  },
455
- "@toddle/indexOf": {
456
- "name": "Index of",
457
- "description": "Find the index of a specific item in an Array or String.",
425
+ "@toddle/findIndex": {
426
+ "name": "Find index",
427
+ "description": "Search through an Array of items and apply a formula to each item, to return the index of the first item where the formula returns True.",
458
428
  "arguments": [
459
429
  {
460
430
  "name": "Array",
461
431
  "formula": {
462
432
  "type": "value",
463
- "value": ""
433
+ "value": null
464
434
  },
465
- "description": "The Array or String to search.",
435
+ "description": "The array to search.",
466
436
  "type": {
467
- "type": "Union",
468
- "types": [
469
- {
470
- "type": "String"
471
- },
472
- {
473
- "type": "Array"
474
- }
475
- ]
437
+ "type": "Array"
476
438
  }
477
439
  },
478
440
  {
479
- "name": "Item",
441
+ "name": "Formula",
442
+ "isFunction": true,
480
443
  "formula": {
481
- "type": "value",
482
- "value": ""
444
+ "type": "path",
445
+ "path": [
446
+ "Args",
447
+ "item"
448
+ ]
483
449
  },
484
- "description": "The items to search for.",
450
+ "description": "The predicate formula that each item in the Array is passed to.",
485
451
  "type": {
486
- "type": "Any"
452
+ "type": "Formula"
487
453
  }
488
454
  }
489
455
  ],
490
456
  "output": {
491
- "description": "If the item exists in the Array, the index of that item is returned. If the item is not found, -1 is returned.",
457
+ "description": "The index of the first item in the Array where the predicate formula returns True. Returns -1 if the predicate formula did not return True for any item.",
492
458
  "type": {
493
- "type": "Number"
459
+ "type": "Any"
494
460
  }
495
461
  }
496
462
  },
497
- "@toddle/get": {
498
- "name": "Get",
499
- "description": "Extract a value from an Object, Array or String at the specified path.",
463
+ "@toddle/greaterThan": {
464
+ "name": "Greater than",
465
+ "description": "Compute if a value is larger than another value.",
500
466
  "arguments": [
501
467
  {
502
- "name": "Object",
468
+ "name": "First",
503
469
  "formula": {
504
470
  "type": "value",
505
- "value": null
471
+ "value": ""
506
472
  },
507
- "description": "The Object, Array or String you want to extract an item from.",
473
+ "description": "First value to be compared.",
508
474
  "type": {
509
- "type": "Union",
510
- "types": [
511
- {
512
- "type": "Object"
513
- },
514
- {
515
- "type": "Array"
516
- },
517
- {
518
- "type": "String"
519
- }
520
- ]
475
+ "type": "Number"
521
476
  }
522
477
  },
523
478
  {
524
- "name": "Path",
479
+ "name": "Second",
525
480
  "formula": {
526
481
  "type": "value",
527
- "value": "Item"
482
+ "value": ""
528
483
  },
529
- "description": "The Path can be either a Number, a String, or an Array.",
484
+ "description": "Second value to be compared.",
530
485
  "type": {
531
- "type": "Union",
532
- "types": [
533
- {
534
- "type": "Array",
535
- "ofType": {
536
- "type": "String"
537
- }
538
- },
539
- {
540
- "type": "String"
541
- },
542
- {
543
- "type": "Number"
544
- }
545
- ]
486
+ "type": "Number"
546
487
  }
547
488
  }
548
489
  ],
549
490
  "output": {
550
- "description": "The value found at the Path. If no value is found, this value of the output is Null.",
491
+ "description": "Returns True if the first Number is larger than the second Number.",
551
492
  "type": {
552
- "type": "Any"
493
+ "type": "Boolean"
553
494
  }
554
495
  }
555
496
  },
556
- "@toddle/logarithm": {
557
- "name": "Logarithm",
558
- "description": "Return the logarithm of a Number.",
497
+ "@toddle/formatDate": {
498
+ "name": "Format Date",
559
499
  "arguments": [
560
500
  {
561
- "name": "Number",
562
- "formula": {
563
- "type": "value",
564
- "value": 1
565
- },
566
- "description": "A Number greater than or equal to 0.",
501
+ "name": "Date",
502
+ "description": "Date to format",
567
503
  "type": {
568
- "type": "Number"
504
+ "type": "Date"
505
+ },
506
+ "formula": {
507
+ "type": "Date",
508
+ "value": null
569
509
  }
570
- }
571
- ],
572
- "output": {
573
- "type": {
574
- "type": "Number"
575
510
  },
576
- "description": "The natural logarithm of the Number."
577
- }
578
- },
579
- "@toddle/encodeBase64": {
580
- "name": "Encode to base64",
581
- "arguments": [
582
511
  {
583
- "name": "Value",
512
+ "name": "Locale(s)",
513
+ "description": "Optional locale to use for formatting the Date, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
514
+ "type": {
515
+ "type": "String | Array"
516
+ },
584
517
  "formula": {
585
518
  "type": "value",
586
- "value": "Input value"
587
- },
519
+ "value": null
520
+ }
521
+ },
522
+ {
523
+ "name": "Options",
524
+ "description": "Optional Object for configuring the formatting of the output. See the [DateTimeFormat syntax on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#syntax).",
588
525
  "type": {
589
- "type": "String"
526
+ "type": "Object"
590
527
  },
591
- "description": "The input string to be encoded."
528
+ "formula": {
529
+ "type": "value",
530
+ "value": null
531
+ }
592
532
  }
593
533
  ],
594
- "description": "Encode a string to base64.",
534
+ "description": "Format a date using the Intl.DateTimeFormat API. See the [DateTimeFormat docs on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat).",
595
535
  "output": {
596
- "description": "The base 64 encoded string.",
536
+ "description": "The Date input formatted as a String.",
597
537
  "type": {
598
538
  "type": "String"
599
539
  }
600
540
  }
601
541
  },
602
- "@toddle/set": {
603
- "name": "Set",
604
- "description": "Set a value in an Object or Array based on a specified path.",
542
+ "@toddle/get": {
543
+ "name": "Get",
544
+ "description": "Extract a value from an Object, Array or String at the specified path.",
605
545
  "arguments": [
606
546
  {
607
547
  "name": "Object",
@@ -609,23 +549,37 @@
609
549
  "type": "value",
610
550
  "value": null
611
551
  },
612
- "description": "The input Object.",
552
+ "description": "The Object, Array or String you want to extract an item from.",
613
553
  "type": {
614
- "type": "Object"
554
+ "type": "Union",
555
+ "types": [
556
+ {
557
+ "type": "Object"
558
+ },
559
+ {
560
+ "type": "Array"
561
+ },
562
+ {
563
+ "type": "String"
564
+ }
565
+ ]
615
566
  }
616
567
  },
617
568
  {
618
569
  "name": "Path",
619
570
  "formula": {
620
571
  "type": "value",
621
- "value": "Key"
572
+ "value": "Item"
622
573
  },
623
- "description": "The Path can be either a Number, a String or an Array of Strings.",
574
+ "description": "The Path can be either a Number, a String, or an Array.",
624
575
  "type": {
625
576
  "type": "Union",
626
577
  "types": [
627
578
  {
628
- "type": "Array"
579
+ "type": "Array",
580
+ "ofType": {
581
+ "type": "String"
582
+ }
629
583
  },
630
584
  {
631
585
  "type": "String"
@@ -635,98 +589,120 @@
635
589
  }
636
590
  ]
637
591
  }
592
+ }
593
+ ],
594
+ "output": {
595
+ "description": "The value found at the Path. If no value is found, this value of the output is Null.",
596
+ "type": {
597
+ "type": "Any"
598
+ }
599
+ }
600
+ },
601
+ "@toddle/parseURL": {
602
+ "name": "Parse URL",
603
+ "description": "Parse a URL",
604
+ "arguments": [
605
+ {
606
+ "name": "URL",
607
+ "formula": {
608
+ "type": "value",
609
+ "value": null
610
+ },
611
+ "description": "The URL value to parse.",
612
+ "type": {
613
+ "type": "String"
614
+ }
638
615
  },
639
616
  {
640
- "name": "Value",
617
+ "name": "Base",
641
618
  "formula": {
642
619
  "type": "value",
643
- "value": "Item"
620
+ "value": null
644
621
  },
645
- "description": "The value to set.",
622
+ "description": "An optional base for the URL. Use this to resolve relative URLs.",
646
623
  "type": {
647
- "type": "Any"
624
+ "type": "String"
648
625
  }
649
626
  }
650
627
  ],
651
628
  "output": {
652
- "description": "The input Object with the new field.",
629
+ "description": "An object containing: \"hostname\", \"searchParams\", \"path\", \"hash\", \"href\", \"protocol\", \"port\", \"origin\"",
653
630
  "type": {
654
631
  "type": "Object"
655
632
  }
656
633
  }
657
634
  },
658
- "@toddle/minus": {
659
- "name": "Minus",
660
- "description": "Subtract a Number from a Number.",
635
+ "@toddle/userAgent": {
636
+ "name": "User Agent",
637
+ "description": "Get the user agent for the browser or from the User-Agent header on the server",
638
+ "arguments": [],
639
+ "output": {
640
+ "description": "The user agent string.",
641
+ "type": {
642
+ "type": "String"
643
+ }
644
+ }
645
+ },
646
+ "@toddle/lessThan": {
647
+ "name": "Less than",
648
+ "description": "Compute if a value is smaller than another value.",
661
649
  "arguments": [
662
650
  {
663
- "name": "Minuend",
651
+ "name": "First",
664
652
  "formula": {
665
653
  "type": "value",
666
- "value": 1
654
+ "value": ""
667
655
  },
668
- "description": "The number to subtract from.",
656
+ "description": "First Number to be compared.",
669
657
  "type": {
670
658
  "type": "Number"
671
659
  }
672
660
  },
673
661
  {
674
- "name": "Substrahend",
662
+ "name": "Second",
675
663
  "formula": {
676
664
  "type": "value",
677
- "value": 1
665
+ "value": ""
678
666
  },
679
- "description": "The number to subtract.",
667
+ "description": "Second Number to be compared.",
680
668
  "type": {
681
669
  "type": "Number"
682
670
  }
683
671
  }
684
672
  ],
685
673
  "output": {
686
- "description": "The result of subtracting the Substrahend from the Minuend.",
674
+ "description": "Returns True if the First Number is smaller than the second Number, otherwise it returns False.",
687
675
  "type": {
688
- "type": "Number"
676
+ "type": "Boolean"
689
677
  }
690
678
  }
691
679
  },
692
- "@toddle/keyBy": {
693
- "name": "Key by",
694
- "description": "Organize an Array of items into an Object based on a Key formula.",
680
+ "@toddle/trim": {
681
+ "name": "Trim",
682
+ "description": "Remove any leading and trailing white spaces from a String.",
695
683
  "arguments": [
696
684
  {
697
- "name": "Array",
698
- "formula": {
699
- "type": "value",
700
- "value": null
701
- },
702
- "description": "Array of items.",
703
- "type": {
704
- "type": "Array"
705
- }
706
- },
707
- {
708
- "name": "Formula",
709
- "isFunction": true,
685
+ "name": "String",
710
686
  "formula": {
711
687
  "type": "value",
712
- "value": null
688
+ "value": ""
713
689
  },
714
- "description": "The key formula used to index the items. The String returned from the formula will match the key in the output Object.",
690
+ "description": "The String to trim.",
715
691
  "type": {
716
- "type": "Formula"
692
+ "type": "String"
717
693
  }
718
694
  }
719
695
  ],
720
696
  "output": {
721
- "description": "An Object where each key matches a value returned by the key formula, and each value is the item that String was returned for.",
697
+ "description": "The trimmed String.",
722
698
  "type": {
723
- "type": "Object"
699
+ "type": "String"
724
700
  }
725
701
  }
726
702
  },
727
- "@toddle/first": {
728
- "name": "First",
729
- "description": "Return the first item in an Array.",
703
+ "@toddle/sort_by": {
704
+ "name": "Sort by",
705
+ "description": "Sort an Array using a formula.",
730
706
  "arguments": [
731
707
  {
732
708
  "name": "Array",
@@ -737,167 +713,220 @@
737
713
  "type": {
738
714
  "type": "Array"
739
715
  },
740
- "description": "An Array of items."
716
+ "description": "The input Array."
717
+ },
718
+ {
719
+ "name": "Formula",
720
+ "formula": {
721
+ "type": "path",
722
+ "path": [
723
+ "Args",
724
+ "item"
725
+ ]
726
+ },
727
+ "type": {
728
+ "type": "Formula"
729
+ },
730
+ "isFunction": true,
731
+ "description": "The sorting formula. The output of this formula will determine the sort order of the items. If the formula returns an Array, the items will first be sorted by the first item, then the second, etc."
732
+ },
733
+ {
734
+ "name": "Ascending?",
735
+ "formula": {
736
+ "type": "value",
737
+ "value": true
738
+ },
739
+ "type": {
740
+ "type": "Boolean"
741
+ },
742
+ "description": "Should the list be sorted in ascending order?"
741
743
  }
742
744
  ],
743
745
  "output": {
744
- "description": "The first item in the Array.",
746
+ "description": "The input Array sorted by the value returned by the sorting formula.",
745
747
  "type": {
746
- "type": "Any"
748
+ "type": "Number"
747
749
  }
748
750
  }
749
751
  },
750
- "@toddle/dateFromString": {
751
- "name": "Date From String",
752
+ "@toddle/parseJSON": {
753
+ "name": "Parse JSON",
754
+ "description": "Parse a String to JSON.",
752
755
  "arguments": [
753
756
  {
754
- "name": "Date string",
755
- "description": "A String representing a date, for example \"January 1, 1970\".",
756
- "type": {
757
- "type": "String"
758
- },
757
+ "name": "JSON string",
759
758
  "formula": {
760
759
  "type": "value",
761
- "value": "January 1, 1970"
760
+ "value": null
761
+ },
762
+ "description": "The String to be parsed.",
763
+ "type": {
764
+ "type": "String"
762
765
  }
763
766
  }
764
767
  ],
765
- "description": "Convert a string to a Date.",
766
768
  "output": {
767
- "description": "The input value converted to a Date.",
769
+ "description": "The parsed JSON value. If the input is not a valid String, this returns Null.",
768
770
  "type": {
769
- "type": "Date"
771
+ "type": "Any"
770
772
  }
771
773
  }
772
774
  },
773
- "@toddle/clamp": {
774
- "name": "Clamp",
775
- "description": "Limit a value to a specified Min and Max value.",
775
+ "@toddle/lessOrEqual": {
776
+ "name": "Less or equal",
777
+ "description": "Compute if a value is smaller than or equal to another value.",
776
778
  "arguments": [
777
779
  {
778
- "name": "Value",
779
- "type": {
780
- "type": "Number"
781
- },
780
+ "name": "First",
782
781
  "formula": {
783
782
  "type": "value",
784
- "value": null
783
+ "value": ""
785
784
  },
786
- "description": "Number to round."
787
- },
788
- {
789
- "name": "Min",
785
+ "description": "First Number to be compared.",
790
786
  "type": {
791
787
  "type": "Number"
792
- },
793
- "description": "The smallest allowed Number.",
794
- "formula": {
795
- "type": "value",
796
- "value": 0
797
788
  }
798
789
  },
799
790
  {
800
- "name": "Max",
801
- "type": {
802
- "type": "Number"
803
- },
804
- "description": "The largest allowed Number.",
791
+ "name": "Second",
805
792
  "formula": {
806
793
  "type": "value",
807
- "value": 100
794
+ "value": ""
795
+ },
796
+ "description": "Second Number to be compared.",
797
+ "type": {
798
+ "type": "Number"
808
799
  }
809
800
  }
810
801
  ],
811
802
  "output": {
803
+ "description": "Returns True if the First Number is smaller than or equal to the second Number, otherwise it returns False.",
812
804
  "type": {
813
- "type": "Number"
814
- },
815
- "description": "Returns the input value if between the specified Min and Max. Otherwise, it returns the Min or Max value."
805
+ "type": "Boolean"
806
+ }
816
807
  }
817
808
  },
818
- "@toddle/entries": {
819
- "name": "Entries",
820
- "description": "Get an Array of entries from a given Object.",
809
+ "@toddle/replaceAll": {
810
+ "name": "Replace all",
811
+ "description": "Replace all occurrences of a substring in a String.",
821
812
  "arguments": [
822
813
  {
823
- "name": "Object",
824
- "formula": {
825
- "type": "value",
826
- "value": null
814
+ "name": "Input",
815
+ "description": "The input String to search in.",
816
+ "type": {
817
+ "type": "String"
827
818
  },
828
- "description": "Input record",
819
+ "required": true
820
+ },
821
+ {
822
+ "name": "Search",
823
+ "description": "The substring to search for.",
829
824
  "type": {
830
- "type": "Object"
831
- }
825
+ "type": "String"
826
+ },
827
+ "required": true
828
+ },
829
+ {
830
+ "name": "Replace with",
831
+ "description": "The replacement value.",
832
+ "type": {
833
+ "type": "String"
834
+ },
835
+ "required": true
832
836
  }
833
837
  ],
834
838
  "output": {
835
- "description": "Returns an Array of entries for the given input record. The entries are Objects with a “Key” and “Value” property.",
836
- "type": {
837
- "type": "Array"
838
- }
839
- }
840
- },
841
- "@toddle/isServer": {
842
- "name": "Is Server",
843
- "description": "Get information about whether formulas are currently evaluated server-side or client-side.",
844
- "arguments": [],
845
- "output": {
846
- "description": "Returns True if formulas are evaluated server-side, and False if formulas are evaluated client-side.",
847
839
  "type": {
848
- "type": "Boolean"
849
- }
840
+ "type": "String"
841
+ },
842
+ "name": "Output",
843
+ "description": "The resulting String."
850
844
  }
851
845
  },
852
- "@toddle/typeOf": {
853
- "name": "Type of",
854
- "description": "Get the type of a given input.",
846
+ "@toddle/find": {
847
+ "name": "Find",
848
+ "description": "Search through an Array of items and apply a formula to each item, to return the first item where the provided formula returns True.",
855
849
  "arguments": [
856
850
  {
857
- "name": "Input",
851
+ "name": "Array",
858
852
  "formula": {
859
853
  "type": "value",
860
- "value": 1
854
+ "value": null
861
855
  },
862
- "description": "The input value.",
856
+ "description": "The array to search through",
863
857
  "type": {
864
- "type": "Any"
858
+ "type": "Array"
859
+ }
860
+ },
861
+ {
862
+ "name": "Formula",
863
+ "isFunction": true,
864
+ "formula": {
865
+ "type": "path",
866
+ "path": [
867
+ "Args",
868
+ "item"
869
+ ]
870
+ },
871
+ "description": "The predicate formula that each item in the array is passed to.",
872
+ "type": {
873
+ "type": "Formula"
865
874
  }
866
875
  }
867
876
  ],
868
877
  "output": {
869
- "description": "The type of the input value. Types can be one of: String, Boolean, Number, Array, Object, or Null.",
878
+ "description": "The first item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
870
879
  "type": {
871
880
  "type": "Any"
872
881
  }
873
882
  }
874
883
  },
875
- "@toddle/branchName": {
876
- "name": "Branch Name",
877
- "description": "Get the name of the current branch. For production, the branch name is 'main'.",
878
- "arguments": [],
884
+ "@toddle/add": {
885
+ "name": "Add",
886
+ "arguments": [
887
+ {
888
+ "name": "0",
889
+ "description": "Number to be added.",
890
+ "type": {
891
+ "type": "Number"
892
+ },
893
+ "formula": {
894
+ "type": "value",
895
+ "value": 1
896
+ }
897
+ },
898
+ {
899
+ "name": "1",
900
+ "type": {
901
+ "type": "Number"
902
+ },
903
+ "description": "Number to be added.",
904
+ "formula": {
905
+ "type": "value",
906
+ "value": 1
907
+ }
908
+ }
909
+ ],
910
+ "variableArguments": true,
911
+ "description": "Get the sum of multiple numbers.",
879
912
  "output": {
880
- "description": "Returns the name of the current branch.",
913
+ "description": "The sum of all the input numbers.",
881
914
  "type": {
882
- "type": "String"
915
+ "type": "Number"
883
916
  }
884
917
  }
885
918
  },
886
- "@toddle/size": {
887
- "name": "Size",
888
- "description": "Get the size of an Array, Object or String.",
919
+ "@toddle/dropLast": {
920
+ "name": "Drop last",
921
+ "description": "Remove item(s) from the end of an Array or String.",
889
922
  "arguments": [
890
923
  {
891
- "name": "Collection",
924
+ "name": "Array",
892
925
  "formula": {
893
926
  "type": "value",
894
- "value": [
895
- 1,
896
- 2,
897
- 3
898
- ]
927
+ "value": null
899
928
  },
900
- "description": "The collection to get the size of.",
929
+ "description": "Input array",
901
930
  "type": {
902
931
  "type": "Union",
903
932
  "types": [
@@ -906,48 +935,40 @@
906
935
  },
907
936
  {
908
937
  "type": "Array"
909
- },
910
- {
911
- "type": "Object"
912
938
  }
913
939
  ]
914
940
  }
915
- }
916
- ],
917
- "output": {
918
- "description": "The size of the collection.",
919
- "type": {
920
- "type": "Number"
921
- }
922
- }
923
- },
924
- "@toddle/getElementById": {
925
- "name": "Get element by id",
926
- "description": "Return a DOM element with a given id.",
927
- "cache": false,
928
- "arguments": [
941
+ },
929
942
  {
930
- "name": "Id",
943
+ "name": "Count",
931
944
  "formula": {
932
945
  "type": "value",
933
- "value": "element-id"
946
+ "value": 1
934
947
  },
935
948
  "type": {
936
- "type": "String"
949
+ "type": "Number"
937
950
  },
938
- "description": "The id of the DOM element to return."
951
+ "description": "Number of items to remove."
939
952
  }
940
953
  ],
941
954
  "output": {
942
- "description": "The DOM element with the given id. If no DOM element is found, this will return Null.",
955
+ "description": "A copy of the list without the last item(s).",
943
956
  "type": {
944
- "type": "Element"
957
+ "type": "Union",
958
+ "types": [
959
+ {
960
+ "type": "String"
961
+ },
962
+ {
963
+ "type": "Array"
964
+ }
965
+ ]
945
966
  }
946
967
  }
947
968
  },
948
- "@toddle/getFromLocalStorage": {
949
- "name": "Get from Local Storage",
950
- "description": "Read a value from local storage with the provided key.",
969
+ "@toddle/getFromSessionStorage": {
970
+ "name": "Get from Session Storage",
971
+ "description": "Read a value from session storage with the provided key.",
951
972
  "cache": false,
952
973
  "arguments": [
953
974
  {
@@ -956,102 +977,79 @@
956
977
  "type": "value",
957
978
  "value": null
958
979
  },
959
- "description": "The key to read from local storage.",
980
+ "description": "The key to read from session storage.",
960
981
  "type": {
961
982
  "type": "String"
962
983
  }
963
984
  }
964
985
  ],
965
986
  "output": {
966
- "description": "The value found in local storage. If no value is found, this will return Null.",
987
+ "description": "The value found in session storage.",
967
988
  "type": {
968
989
  "type": "Any"
969
990
  }
970
991
  }
971
992
  },
972
- "@toddle/randomNumber": {
973
- "name": "Random number",
974
- "description": "return a random Number between 0 and 1.",
975
- "arguments": [],
976
- "cache": false,
977
- "output": {
978
- "description": "A random Number between 0 and 1.",
979
- "type": {
980
- "type": "Number"
981
- }
982
- }
983
- },
984
- "@toddle/divide": {
985
- "name": "Divide",
986
- "description": "Perform a division calculation.",
993
+ "@toddle/equals": {
994
+ "name": "Equals",
995
+ "description": "Compute if values are identical.",
987
996
  "arguments": [
988
997
  {
989
- "name": "Dividend",
990
- "description": "The number to be divided.",
991
- "type": {
992
- "type": "Number"
993
- },
998
+ "name": "First",
994
999
  "formula": {
995
1000
  "type": "value",
996
- "value": 1
1001
+ "value": ""
1002
+ },
1003
+ "description": "First Value",
1004
+ "type": {
1005
+ "type": "Any"
997
1006
  }
998
1007
  },
999
1008
  {
1000
- "name": "Divisor",
1001
- "description": "The number to divide by.",
1002
- "type": {
1003
- "type": "Number"
1004
- },
1009
+ "name": "Second",
1005
1010
  "formula": {
1006
1011
  "type": "value",
1007
- "value": 1
1012
+ "value": ""
1013
+ },
1014
+ "description": "Second Value",
1015
+ "type": {
1016
+ "type": "Any"
1008
1017
  }
1009
1018
  }
1010
1019
  ],
1011
1020
  "output": {
1012
- "description": "The result of dividing the dividend with the divisor.",
1021
+ "description": "Returns True if the input values are identical, otherwise False.",
1013
1022
  "type": {
1014
- "type": "Number"
1023
+ "type": "Boolean"
1015
1024
  }
1016
1025
  }
1017
1026
  },
1018
- "@toddle/append": {
1019
- "name": "Append",
1020
- "description": "Add an element to the end of an Array.",
1027
+ "@toddle/logarithm": {
1028
+ "name": "Logarithm",
1029
+ "description": "Return the logarithm of a Number.",
1021
1030
  "arguments": [
1022
1031
  {
1023
- "name": "Array",
1024
- "type": {
1025
- "type": "Array"
1026
- },
1027
- "description": "The Array to append to.",
1028
- "formula": {
1029
- "type": "array",
1030
- "arguments": []
1031
- }
1032
- },
1033
- {
1034
- "name": "Item",
1035
- "type": {
1036
- "type": "Any"
1037
- },
1038
- "description": "The item to append to the Array.",
1032
+ "name": "Number",
1039
1033
  "formula": {
1040
1034
  "type": "value",
1041
- "value": "Item"
1035
+ "value": 1
1036
+ },
1037
+ "description": "A Number greater than or equal to 0.",
1038
+ "type": {
1039
+ "type": "Number"
1042
1040
  }
1043
1041
  }
1044
1042
  ],
1045
1043
  "output": {
1046
- "description": "A new Array containing all elements from the input Array, including the new item.",
1047
1044
  "type": {
1048
- "type": "Array"
1049
- }
1045
+ "type": "Number"
1046
+ },
1047
+ "description": "The natural logarithm of the Number."
1050
1048
  }
1051
1049
  },
1052
- "@toddle/groupBy": {
1053
- "name": "Group by",
1054
- "description": "Group an Array of items into an Object based on a grouping formula.",
1050
+ "@toddle/reverse": {
1051
+ "name": "Reverse",
1052
+ "description": "Reverse the order of an Array.",
1055
1053
  "arguments": [
1056
1054
  {
1057
1055
  "name": "Array",
@@ -1059,124 +1057,131 @@
1059
1057
  "type": "value",
1060
1058
  "value": null
1061
1059
  },
1062
- "description": "Array of items to be grouped.",
1060
+ "description": "The Array to be reversed.",
1063
1061
  "type": {
1064
1062
  "type": "Array"
1065
1063
  }
1064
+ }
1065
+ ],
1066
+ "output": {
1067
+ "type": {
1068
+ "type": "Array"
1066
1069
  },
1070
+ "description": "The reversed Array."
1071
+ }
1072
+ },
1073
+ "@toddle/flatten": {
1074
+ "name": "Flatten",
1075
+ "description": "Flatten a nested Array.",
1076
+ "arguments": [
1067
1077
  {
1068
- "name": "Formula",
1069
- "isFunction": true,
1070
- "formula": {
1071
- "type": "value",
1072
- "value": null
1073
- },
1074
- "description": "The grouping formula used to group the items. The String returned from the formula will match the key in the output Oject.",
1078
+ "name": "Array",
1079
+ "description": "An Array containing one or more Arrays.",
1075
1080
  "type": {
1076
- "type": "Formula"
1081
+ "type": "Array"
1082
+ },
1083
+ "formula": {
1084
+ "type": "array",
1085
+ "arguments": []
1077
1086
  }
1078
1087
  }
1079
1088
  ],
1080
1089
  "output": {
1081
- "description": "An Object where each key matches a value returned by the grouping formula, and each value is the list of items that share the return value.",
1090
+ "description": "A flattened Array where all items in the original array are concatenated.",
1082
1091
  "type": {
1083
- "type": "Object"
1092
+ "type": "Array"
1084
1093
  }
1085
1094
  }
1086
1095
  },
1087
- "@toddle/defaultTo": {
1088
- "name": "Default to",
1089
- "description": "Return the first value that is not False or Null.",
1096
+ "@toddle/encodeBase64": {
1097
+ "name": "Encode to base64",
1090
1098
  "arguments": [
1091
1099
  {
1092
- "name": "0",
1100
+ "name": "Value",
1093
1101
  "formula": {
1094
1102
  "type": "value",
1095
- "value": null
1103
+ "value": "Input value"
1096
1104
  },
1097
- "description": "The inital value.",
1098
- "type": {
1099
- "type": "Any"
1100
- }
1101
- },
1102
- {
1103
- "name": "1",
1104
- "description": "The first fallback value to be used if the primary value is Null or False.",
1105
1105
  "type": {
1106
- "type": "Any"
1106
+ "type": "String"
1107
1107
  },
1108
- "formula": {
1109
- "type": "value",
1110
- "value": "default"
1111
- }
1108
+ "description": "The input string to be encoded."
1112
1109
  }
1113
1110
  ],
1114
- "variableArguments": true,
1111
+ "description": "Encode a string to base64.",
1115
1112
  "output": {
1116
- "description": "Returns the first value that is not False or Null. Returns Null if no valid values is given.",
1113
+ "description": "The base 64 encoded string.",
1117
1114
  "type": {
1118
- "type": "Any"
1115
+ "type": "String"
1119
1116
  }
1120
1117
  }
1121
1118
  },
1122
- "@toddle/encodeURIComponent": {
1123
- "name": "Encode URI Component",
1124
- "description": "Encode a URI component, escaping certain characters to their UTF-8 representation.",
1119
+ "@toddle/json": {
1120
+ "name": "JSON",
1121
+ "description": "Convert a value into a JSON String.",
1125
1122
  "arguments": [
1126
1123
  {
1127
- "name": "URIComponent",
1124
+ "name": "Input",
1128
1125
  "formula": {
1129
1126
  "type": "value",
1130
1127
  "value": null
1131
1128
  },
1132
- "description": "The URI component to encode.",
1129
+ "description": "The input value.",
1133
1130
  "type": {
1134
- "type": "String"
1131
+ "type": "Any"
1132
+ }
1133
+ },
1134
+ {
1135
+ "name": "Indentation",
1136
+ "formula": {
1137
+ "type": "value",
1138
+ "value": 0
1139
+ },
1140
+ "description": "The number of spaces used for indentation in the JSON String.",
1141
+ "type": {
1142
+ "type": "Number"
1135
1143
  }
1136
1144
  }
1137
1145
  ],
1138
1146
  "output": {
1139
- "description": "The encoded URI component.",
1147
+ "description": "The JSON String.",
1140
1148
  "type": {
1141
1149
  "type": "String"
1142
1150
  }
1143
1151
  }
1144
1152
  },
1145
- "@toddle/replaceAll": {
1146
- "name": "Replace all",
1147
- "description": "Replace all occurrences of a substring in a String.",
1153
+ "@toddle/startsWith": {
1154
+ "name": "Starts with",
1155
+ "description": "Check if a String has a given prefix.",
1148
1156
  "arguments": [
1149
1157
  {
1150
- "name": "Input",
1151
- "description": "The input String to search in.",
1152
- "type": {
1153
- "type": "String"
1158
+ "name": "String",
1159
+ "formula": {
1160
+ "type": "value",
1161
+ "value": ""
1154
1162
  },
1155
- "required": true
1156
- },
1157
- {
1158
- "name": "Search",
1159
- "description": "The substring to search for.",
1163
+ "description": "The String to check.",
1160
1164
  "type": {
1161
1165
  "type": "String"
1162
- },
1163
- "required": true
1166
+ }
1164
1167
  },
1165
1168
  {
1166
- "name": "Replace with",
1167
- "description": "The replacement value.",
1169
+ "name": "Prefix",
1170
+ "formula": {
1171
+ "type": "value",
1172
+ "value": ""
1173
+ },
1174
+ "description": "The prefix to check for.",
1168
1175
  "type": {
1169
1176
  "type": "String"
1170
- },
1171
- "required": true
1177
+ }
1172
1178
  }
1173
1179
  ],
1174
1180
  "output": {
1181
+ "description": "Returns True if the input String starts with the prefix, otherwise False",
1175
1182
  "type": {
1176
- "type": "String"
1177
- },
1178
- "name": "Output",
1179
- "description": "The resulting String."
1183
+ "type": "Boolean"
1184
+ }
1180
1185
  }
1181
1186
  },
1182
1187
  "@toddle/decodeURIComponent": {
@@ -1202,43 +1207,78 @@
1202
1207
  }
1203
1208
  }
1204
1209
  },
1205
- "@toddle/lessThan": {
1206
- "name": "Less than",
1207
- "description": "Compute if a value is smaller than another value.",
1210
+ "@toddle/modulo": {
1211
+ "name": "Modulo",
1212
+ "description": "Get the remainder when dividing two Numbers.",
1208
1213
  "arguments": [
1209
1214
  {
1210
- "name": "First",
1215
+ "name": "Dividend",
1211
1216
  "formula": {
1212
1217
  "type": "value",
1213
- "value": ""
1218
+ "value": 1
1214
1219
  },
1215
- "description": "First Number to be compared.",
1220
+ "description": "The number to be divided.",
1216
1221
  "type": {
1217
1222
  "type": "Number"
1218
1223
  }
1219
1224
  },
1220
1225
  {
1221
- "name": "Second",
1226
+ "name": "Divider",
1222
1227
  "formula": {
1223
1228
  "type": "value",
1224
- "value": ""
1229
+ "value": 1
1225
1230
  },
1226
- "description": "Second Number to be compared.",
1231
+ "description": "The number to divide by.",
1227
1232
  "type": {
1228
1233
  "type": "Number"
1229
1234
  }
1230
1235
  }
1231
1236
  ],
1232
1237
  "output": {
1233
- "description": "Returns True if the First Number is smaller than the second Number, otherwise it returns False.",
1238
+ "description": "The remainder when the Dividend is divided by the Divider.",
1234
1239
  "type": {
1235
- "type": "Boolean"
1240
+ "type": "Number"
1236
1241
  }
1237
1242
  }
1238
1243
  },
1239
- "@toddle/take": {
1240
- "name": "Take",
1241
- "description": "Take items from the start of an Array or String.",
1244
+ "@toddle/branchName": {
1245
+ "name": "Branch Name",
1246
+ "description": "Get the name of the current branch. For production, the branch name is 'main'.",
1247
+ "arguments": [],
1248
+ "output": {
1249
+ "description": "Returns the name of the current branch.",
1250
+ "type": {
1251
+ "type": "String"
1252
+ }
1253
+ }
1254
+ },
1255
+ "@toddle/currentURL": {
1256
+ "name": "Current URL",
1257
+ "description": "Return the current URL of the browser. Use the \"Parse URL\" formula for working with the URL.",
1258
+ "arguments": [],
1259
+ "cache": false,
1260
+ "output": {
1261
+ "description": "The browser's current URL.",
1262
+ "type": {
1263
+ "type": "String"
1264
+ }
1265
+ }
1266
+ },
1267
+ "@toddle/now": {
1268
+ "name": "Now",
1269
+ "description": "Get a Date representing \"Now\"",
1270
+ "arguments": [],
1271
+ "cache": false,
1272
+ "output": {
1273
+ "description": "A Date object initialized at the current date/time.",
1274
+ "type": {
1275
+ "type": "Date"
1276
+ }
1277
+ }
1278
+ },
1279
+ "@toddle/join": {
1280
+ "name": "Join",
1281
+ "description": "Combine an Array of Strings in to a single String.",
1242
1282
  "arguments": [
1243
1283
  {
1244
1284
  "name": "Array",
@@ -1246,91 +1286,80 @@
1246
1286
  "type": "value",
1247
1287
  "value": null
1248
1288
  },
1249
- "description": "Input Array or String.",
1289
+ "description": "An array of Strings.",
1250
1290
  "type": {
1251
- "type": "Union",
1252
- "types": [
1253
- {
1254
- "type": "String"
1255
- },
1256
- {
1257
- "type": "Array"
1258
- }
1259
- ]
1291
+ "type": "Array"
1260
1292
  }
1261
1293
  },
1262
1294
  {
1263
- "name": "Count",
1295
+ "name": "Separator",
1264
1296
  "formula": {
1265
1297
  "type": "value",
1266
- "value": 1
1298
+ "value": ", "
1267
1299
  },
1300
+ "description": "A separator String that is inserted in between each item in the Array to join.",
1268
1301
  "type": {
1269
- "type": "Number"
1270
- },
1271
- "description": "Number of items to take."
1302
+ "type": "String"
1303
+ }
1272
1304
  }
1273
1305
  ],
1274
1306
  "output": {
1275
- "description": "The first items from the Array or String.",
1307
+ "description": "A String combining each item in the input Array separated by the separator String, e.g. joining [\"a\", \"b\", \"c\"] with a \",\" separator will return \"a,b,c\".",
1276
1308
  "type": {
1277
- "type": "Union",
1278
- "types": [
1279
- {
1280
- "type": "String"
1281
- },
1282
- {
1283
- "type": "Array"
1284
- }
1285
- ]
1309
+ "type": "String"
1286
1310
  }
1287
1311
  }
1288
1312
  },
1289
- "@toddle/includes": {
1290
- "name": "Includes",
1291
- "description": "Test if an Array or String includes a specific item or value.",
1313
+ "@toddle/getHttpOnlyCookie": {
1314
+ "name": "Get Http-Only Cookie",
1315
+ "description": "Get the value of an Http-Only cookie by name. This formula will is only intended to be used server-side for SSR/proxied API requests to read Http-Only cookies.",
1292
1316
  "arguments": [
1293
1317
  {
1294
- "name": "Array",
1318
+ "name": "Cookie name",
1295
1319
  "formula": {
1296
1320
  "type": "value",
1297
- "value": ""
1321
+ "value": null
1298
1322
  },
1299
- "description": "The Array to search.",
1323
+ "description": "The name of the Http-Only cookie you want to get the value of.",
1300
1324
  "type": {
1301
- "type": "Union",
1302
- "types": [
1303
- {
1304
- "type": "String"
1305
- },
1306
- {
1307
- "type": "Array"
1308
- }
1309
- ]
1325
+ "type": "String"
1310
1326
  }
1311
- },
1327
+ }
1328
+ ],
1329
+ "output": {
1330
+ "description": "The value of the cookie. If no cookie is found, this will return Null. If you use this formula client-side, it will return a placeholder template string.",
1331
+ "type": {
1332
+ "type": "String"
1333
+ }
1334
+ }
1335
+ },
1336
+ "@toddle/getFromLocalStorage": {
1337
+ "name": "Get from Local Storage",
1338
+ "description": "Read a value from local storage with the provided key.",
1339
+ "cache": false,
1340
+ "arguments": [
1312
1341
  {
1313
- "name": "Item",
1342
+ "name": "Key",
1314
1343
  "formula": {
1315
1344
  "type": "value",
1316
- "value": ""
1345
+ "value": null
1317
1346
  },
1318
- "description": "The item or value to search for.",
1347
+ "description": "The key to read from local storage.",
1319
1348
  "type": {
1320
- "type": "Any"
1349
+ "type": "String"
1321
1350
  }
1322
1351
  }
1323
1352
  ],
1324
1353
  "output": {
1325
- "description": "Returns True if the item or value exists in the Array or string. Returns False if no match is found.",
1354
+ "description": "The value found in local storage. If no value is found, this will return Null.",
1326
1355
  "type": {
1327
- "type": "Boolean"
1356
+ "type": "Any"
1328
1357
  }
1329
1358
  }
1330
1359
  },
1331
- "@toddle/every": {
1332
- "name": "Every",
1333
- "description": "Run a formula returns for all items in an Array.",
1360
+ "@toddle/reduce": {
1361
+ "name": "Reduce",
1362
+ "description": "Reduce a group of items to a single value by applying each item to a reducer formula.",
1334
1363
  "arguments": [
1335
1364
  {
1336
1365
  "name": "Array",
@@ -1338,31 +1367,47 @@
1338
1367
  "type": "value",
1339
1368
  "value": null
1340
1369
  },
1341
- "description": "The array of items to evaluate.",
1370
+ "description": "The Array or Object of items to be reduced.",
1342
1371
  "type": {
1343
- "type": "Array"
1372
+ "type": "Union",
1373
+ "types": [
1374
+ {
1375
+ "type": "Array"
1376
+ },
1377
+ {
1378
+ "type": "Object"
1379
+ }
1380
+ ]
1344
1381
  }
1345
1382
  },
1346
1383
  {
1347
1384
  "name": "Formula",
1348
1385
  "isFunction": true,
1349
1386
  "formula": {
1350
- "type": "path",
1351
- "path": [
1352
- "Args",
1353
- "item"
1354
- ]
1387
+ "type": "value",
1388
+ "value": null
1355
1389
  },
1356
- "description": "Predicate formula for evaluating each item.",
1390
+ "description": "The reducer formula. Each item in the Array is applied to the formula along with the accumulator. The result of this formula will be a new accumulator used for the next item.",
1357
1391
  "type": {
1358
1392
  "type": "Formula"
1359
1393
  }
1394
+ },
1395
+ {
1396
+ "name": "Accumulator",
1397
+ "formula": {
1398
+ "type": "value",
1399
+ "value": null
1400
+ },
1401
+ "description": "The initial value of the accumulator. This value is passed to the reducer formula along with the first item in the Array, and the result is used as the accumulator for the next item.",
1402
+ "type": {
1403
+ "type": "Any"
1404
+ }
1360
1405
  }
1361
1406
  ],
1362
1407
  "output": {
1363
- "description": "Returns True if the predicate formula returns true for all items in the Array, otherwise False.",
1408
+ "description": "The value returned from applying the last item to the reducer formula.",
1364
1409
  "type": {
1365
- "type": "Array"
1410
+ "type": "Any"
1366
1411
  }
1367
1412
  }
1368
1413
  },
@@ -1416,148 +1461,160 @@
1416
1461
  }
1417
1462
  }
1418
1463
  },
1419
- "@toddle/matches": {
1420
- "name": "Matches",
1421
- "description": "Finds the (global) matches in a String based on a regular expression.",
1464
+ "@toddle/max": {
1465
+ "name": "Max",
1466
+ "description": "Find the largest Number from a list of inputs.",
1422
1467
  "arguments": [
1423
1468
  {
1424
- "name": "Input",
1425
- "formula": {
1426
- "type": "value",
1427
- "value": ""
1428
- },
1429
- "description": "The string to search for matches in.",
1430
- "type": {
1431
- "type": "String"
1432
- }
1433
- },
1434
- {
1435
- "name": "Regular expression",
1469
+ "name": "0",
1436
1470
  "formula": {
1437
1471
  "type": "value",
1438
- "value": ""
1472
+ "value": null
1439
1473
  },
1440
- "description": "The regular expression to use for matching.",
1474
+ "description": "Input Number.",
1441
1475
  "type": {
1442
- "type": "String"
1476
+ "type": "Number"
1443
1477
  }
1444
1478
  },
1445
1479
  {
1446
- "name": "Global search",
1480
+ "name": "1",
1447
1481
  "formula": {
1448
1482
  "type": "value",
1449
- "value": true
1483
+ "value": null
1450
1484
  },
1451
- "description": "Test the regular expression against all possible matches in a string.",
1485
+ "description": "Input Number.",
1452
1486
  "type": {
1453
- "type": "Boolean"
1487
+ "type": "Number"
1454
1488
  }
1455
- },
1489
+ }
1490
+ ],
1491
+ "variableArguments": true,
1492
+ "output": {
1493
+ "description": "The largest of the input Numbers.",
1494
+ "type": {
1495
+ "type": "Number"
1496
+ }
1497
+ }
1498
+ },
1499
+ "@toddle/groupBy": {
1500
+ "name": "Group by",
1501
+ "description": "Group an Array of items into an Object based on a grouping formula.",
1502
+ "arguments": [
1456
1503
  {
1457
- "name": "Case insensitive",
1504
+ "name": "Array",
1458
1505
  "formula": {
1459
1506
  "type": "value",
1460
- "value": false
1507
+ "value": null
1461
1508
  },
1462
- "description": "Ignore case while attempting a match in a string.",
1509
+ "description": "Array of items to be grouped.",
1463
1510
  "type": {
1464
- "type": "Boolean"
1511
+ "type": "Array"
1465
1512
  }
1466
1513
  },
1467
1514
  {
1468
- "name": "Multi line",
1515
+ "name": "Formula",
1516
+ "isFunction": true,
1469
1517
  "formula": {
1470
1518
  "type": "value",
1471
- "value": false
1519
+ "value": null
1472
1520
  },
1473
- "description": "Treat multiline strings as multiple lines.",
1521
+ "description": "The grouping formula used to group the items. The String returned from the formula will match the key in the output Oject.",
1474
1522
  "type": {
1475
- "type": "Boolean"
1523
+ "type": "Formula"
1476
1524
  }
1477
1525
  }
1478
1526
  ],
1479
1527
  "output": {
1480
- "description": "An Array of Strings",
1528
+ "description": "An Object where each key matches a value returned by the grouping formula, and each value is the list of items that share the return value.",
1481
1529
  "type": {
1482
- "type": "Array"
1530
+ "type": "Object"
1483
1531
  }
1484
1532
  }
1485
1533
  },
1486
- "@toddle/dateFromTimestamp": {
1487
- "name": "Date From Timestamp",
1534
+ "@toddle/min": {
1535
+ "name": "Min",
1536
+ "description": "Find the smallest Number from a list of inputs.",
1488
1537
  "arguments": [
1489
1538
  {
1490
- "name": "Timestamp",
1491
- "description": "A Number in milliseconds since 1st January, 1970 (EPOCH).",
1539
+ "name": "0",
1540
+ "formula": {
1541
+ "type": "value",
1542
+ "value": null
1543
+ },
1544
+ "description": "Input number",
1492
1545
  "type": {
1493
1546
  "type": "Number"
1494
- },
1547
+ }
1548
+ },
1549
+ {
1550
+ "name": "1",
1495
1551
  "formula": {
1496
1552
  "type": "value",
1497
- "value": 1687787245933
1553
+ "value": null
1554
+ },
1555
+ "description": "Input number",
1556
+ "type": {
1557
+ "type": "Number"
1498
1558
  }
1499
1559
  }
1500
1560
  ],
1501
- "description": "Convert a timestamp (milliseconds) to a Date.",
1502
- "output": {
1503
- "description": "The input value converted to a Date.",
1504
- "type": {
1505
- "type": "Date"
1506
- }
1507
- }
1508
- },
1509
- "@toddle/languages": {
1510
- "name": "Languages",
1511
- "description": "An array of the preferred languages for the user, based on the Navigator.languages property (on the client) or the Accept-Language header (on the server).",
1512
- "arguments": [],
1561
+ "variableArguments": true,
1513
1562
  "output": {
1514
- "description": "An array with the preferred languages for the user.",
1563
+ "description": "The smallest of the input Numbers.",
1515
1564
  "type": {
1516
- "type": "Array"
1565
+ "type": "Number"
1517
1566
  }
1518
1567
  }
1519
1568
  },
1520
- "@toddle/parseURL": {
1521
- "name": "Parse URL",
1522
- "description": "Parse a URL",
1569
+ "@toddle/lastIndexOf": {
1570
+ "name": "Last Index of",
1571
+ "description": "Search an Array or String to find the index of the last occurrence of a specified item or substring.",
1523
1572
  "arguments": [
1524
1573
  {
1525
- "name": "URL",
1574
+ "name": "Array",
1526
1575
  "formula": {
1527
1576
  "type": "value",
1528
- "value": null
1577
+ "value": ""
1529
1578
  },
1530
- "description": "The URL value to parse.",
1579
+ "description": "The Array or String to search.",
1531
1580
  "type": {
1532
- "type": "String"
1581
+ "type": "Union",
1582
+ "types": [
1583
+ {
1584
+ "type": "String"
1585
+ },
1586
+ {
1587
+ "type": "Array"
1588
+ }
1589
+ ]
1533
1590
  }
1534
1591
  },
1535
1592
  {
1536
- "name": "Base",
1593
+ "name": "Item",
1537
1594
  "formula": {
1538
1595
  "type": "value",
1539
- "value": null
1596
+ "value": ""
1540
1597
  },
1541
- "description": "An optional base for the URL. Use this to resolve relative URLs.",
1598
+ "description": "The item or substring to search for.",
1542
1599
  "type": {
1543
- "type": "String"
1600
+ "type": "Any"
1544
1601
  }
1545
1602
  }
1546
1603
  ],
1547
1604
  "output": {
1548
- "description": "An object containing: \"hostname\", \"searchParams\", \"path\", \"hash\", \"href\", \"protocol\", \"port\", \"origin\"",
1605
+ "description": "If the item or substring exists in the Array, the last index of that item is returned. If the item is not found, -1 is returned.",
1549
1606
  "type": {
1550
- "type": "Object"
1607
+ "type": "Number"
1551
1608
  }
1552
1609
  }
1553
1610
  },
1554
- "@toddle/roundDown": {
1555
- "name": "Round down",
1556
- "description": "Round a Number down to the nearest decimal point.",
1611
+ "@toddle/round": {
1612
+ "name": "Round",
1613
+ "description": "Round a Number to the nearest decimal point.",
1557
1614
  "arguments": [
1558
1615
  {
1559
1616
  "name": "Input",
1560
- "description": "Number to round down.",
1617
+ "description": "Number to round.",
1561
1618
  "type": {
1562
1619
  "type": "Number"
1563
1620
  },
@@ -1585,55 +1642,43 @@
1585
1642
  "description": "The rounded Number."
1586
1643
  }
1587
1644
  },
1588
- "@toddle/absolute": {
1589
- "name": "Absolute",
1590
- "description": "Get the absolute value of a Number.",
1645
+ "@toddle/encodeJSON": {
1646
+ "name": "Encode JSON",
1647
+ "description": "Encode data as JSON.",
1591
1648
  "arguments": [
1592
1649
  {
1593
- "name": "Value",
1650
+ "name": "Data",
1594
1651
  "formula": {
1595
1652
  "type": "value",
1596
- "value": -1
1653
+ "value": null
1597
1654
  },
1655
+ "description": "The data to convert.",
1598
1656
  "type": {
1599
- "type": "Number"
1600
- },
1601
- "description": "The input Number."
1602
- }
1603
- ],
1604
- "output": {
1605
- "description": "The absolute value of the input.",
1606
- "type": {
1607
- "type": "Number"
1608
- }
1609
- }
1610
- },
1611
- "@toddle/timestamp": {
1612
- "name": "Timestamp",
1613
- "description": "Get the timestamp from a Date, e.g. 1633462980000.",
1614
- "arguments": [
1657
+ "type": "Any"
1658
+ }
1659
+ },
1615
1660
  {
1616
- "name": "Date",
1617
- "description": "The date to get the timestamp from.",
1618
- "type": {
1619
- "type": "Date"
1620
- },
1661
+ "name": "Indent",
1621
1662
  "formula": {
1622
1663
  "type": "value",
1623
- "value": null
1664
+ "value": 2
1665
+ },
1666
+ "description": "How many characters the encoded value will be indented.",
1667
+ "type": {
1668
+ "type": "Number"
1624
1669
  }
1625
1670
  }
1626
1671
  ],
1627
1672
  "output": {
1628
- "description": "The timestamp from the date input.",
1673
+ "description": "The encoded JSON value.",
1629
1674
  "type": {
1630
- "type": "Number"
1675
+ "type": "String"
1631
1676
  }
1632
1677
  }
1633
1678
  },
1634
- "@toddle/boolean": {
1635
- "name": "Boolean",
1636
- "description": "Convert a value of any type to a Boolean.",
1679
+ "@toddle/string": {
1680
+ "name": "String",
1681
+ "description": "Convert a value of any type to a String.",
1637
1682
  "arguments": [
1638
1683
  {
1639
1684
  "name": "Input",
@@ -1648,333 +1693,381 @@
1648
1693
  }
1649
1694
  ],
1650
1695
  "output": {
1651
- "description": "The input value converted to a Boolean. False and Null will return False, all other values will return True.",
1696
+ "description": "The input value converted to a String",
1652
1697
  "type": {
1653
- "type": "Boolean"
1698
+ "type": "String"
1654
1699
  }
1655
1700
  }
1656
1701
  },
1657
- "@toddle/deleteKey": {
1658
- "name": "Delete",
1659
- "description": "Return a copy of the input Object or Array without the specified key.",
1702
+ "@toddle/encodeURIComponent": {
1703
+ "name": "Encode URI Component",
1704
+ "description": "Encode a URI component, escaping certain characters to their UTF-8 representation.",
1660
1705
  "arguments": [
1661
1706
  {
1662
- "name": "Object",
1707
+ "name": "URIComponent",
1663
1708
  "formula": {
1664
1709
  "type": "value",
1665
1710
  "value": null
1666
1711
  },
1667
- "description": "The input record",
1668
- "type": {
1669
- "type": "Object"
1670
- }
1671
- },
1672
- {
1673
- "name": "Path",
1674
- "formula": {
1675
- "type": "value",
1676
- "value": "Item"
1677
- },
1678
- "description": "The path can be either a Number (if the first argument is an array), a String, or an Array of strings. If an Array is given, the property at that path will be removed.",
1712
+ "description": "The URI component to encode.",
1679
1713
  "type": {
1680
- "type": "Union",
1681
- "types": [
1682
- {
1683
- "type": "Array"
1684
- },
1685
- {
1686
- "type": "String"
1687
- }
1688
- ]
1714
+ "type": "String"
1689
1715
  }
1690
1716
  }
1691
1717
  ],
1692
1718
  "output": {
1693
- "description": "A copy of the record without the property specified in the Path.",
1719
+ "description": "The encoded URI component.",
1694
1720
  "type": {
1695
- "type": "Object"
1721
+ "type": "String"
1696
1722
  }
1697
1723
  }
1698
1724
  },
1699
- "@toddle/power": {
1700
- "name": "Power",
1701
- "description": "Raise a number to a power.",
1725
+ "@toddle/squareRoot": {
1726
+ "name": "Square root",
1727
+ "description": "Get the square root of a Number.",
1702
1728
  "arguments": [
1703
1729
  {
1704
- "name": "Base",
1730
+ "name": "Number",
1705
1731
  "formula": {
1706
1732
  "type": "value",
1707
- "value": 3
1733
+ "value": 1
1708
1734
  },
1709
- "description": "The number to be raised to the exponent.",
1735
+ "description": "The input Number.",
1710
1736
  "type": {
1711
1737
  "type": "Number"
1712
1738
  }
1713
- },
1739
+ }
1740
+ ],
1741
+ "output": {
1742
+ "description": "The square root of the input Number.",
1743
+ "type": {
1744
+ "type": "Number"
1745
+ }
1746
+ }
1747
+ },
1748
+ "@toddle/lowercase": {
1749
+ "name": "Lower case",
1750
+ "description": "Convert a string to lowercase.",
1751
+ "arguments": [
1714
1752
  {
1715
- "name": "Exponent",
1753
+ "name": "String",
1716
1754
  "formula": {
1717
1755
  "type": "value",
1718
- "value": 2
1756
+ "value": "string"
1719
1757
  },
1720
- "description": "The exponent to raise the base to.",
1758
+ "description": "Input String",
1721
1759
  "type": {
1722
- "type": "Number"
1760
+ "type": "String"
1723
1761
  }
1724
1762
  }
1725
1763
  ],
1726
1764
  "output": {
1765
+ "description": "The input String with all characters converted to lowercase.",
1727
1766
  "type": {
1728
- "type": "Number"
1729
- },
1730
- "description": "The result of raising the base to the exponent."
1767
+ "type": "String"
1768
+ }
1731
1769
  }
1732
1770
  },
1733
- "@toddle/max": {
1734
- "name": "Max",
1735
- "description": "Find the largest Number from a list of inputs.",
1771
+ "@toddle/some": {
1772
+ "name": "Some",
1773
+ "description": "Run a formula on all items of an Array to determine if any item matches a set of conditions.",
1736
1774
  "arguments": [
1737
1775
  {
1738
- "name": "0",
1776
+ "name": "Array",
1739
1777
  "formula": {
1740
1778
  "type": "value",
1741
1779
  "value": null
1742
1780
  },
1743
- "description": "Input Number.",
1781
+ "description": "The Array of items to evaluate.",
1744
1782
  "type": {
1745
- "type": "Number"
1783
+ "type": "Array"
1746
1784
  }
1747
1785
  },
1748
1786
  {
1749
- "name": "1",
1787
+ "name": "Formula",
1788
+ "isFunction": true,
1750
1789
  "formula": {
1751
- "type": "value",
1752
- "value": null
1790
+ "type": "path",
1791
+ "path": [
1792
+ "Args",
1793
+ "item"
1794
+ ]
1753
1795
  },
1754
- "description": "Input Number.",
1796
+ "description": "Predicate formula for evaluating each item.",
1755
1797
  "type": {
1756
- "type": "Number"
1798
+ "type": "Formula"
1757
1799
  }
1758
1800
  }
1759
1801
  ],
1760
- "variableArguments": true,
1761
1802
  "output": {
1762
- "description": "The largest of the input Numbers.",
1803
+ "description": "Returns True if the predicate formula returns True for any items in the Array, otherwise False.",
1763
1804
  "type": {
1764
- "type": "Number"
1805
+ "type": "Boolean"
1765
1806
  }
1766
1807
  }
1767
1808
  },
1768
- "@toddle/notEqual": {
1769
- "name": "Not equal",
1770
- "description": "Compute if values are not identical.",
1809
+ "@toddle/split": {
1810
+ "name": "Split",
1811
+ "description": "Split a String into an Array of smaller strings each time a delimiter occurs. The delimiter will not be part of the output",
1771
1812
  "arguments": [
1772
1813
  {
1773
- "name": "First",
1814
+ "name": "Input",
1774
1815
  "formula": {
1775
1816
  "type": "value",
1776
1817
  "value": ""
1777
1818
  },
1778
- "description": "First value.",
1819
+ "description": "The String to split.",
1779
1820
  "type": {
1780
- "type": "Any"
1821
+ "type": "String"
1781
1822
  }
1782
1823
  },
1783
1824
  {
1784
- "name": "Second",
1825
+ "name": "Delimiter",
1785
1826
  "formula": {
1786
1827
  "type": "value",
1787
1828
  "value": ""
1788
1829
  },
1789
- "description": "Second value.",
1830
+ "description": "The string to split by.",
1790
1831
  "type": {
1791
- "type": "Any"
1832
+ "type": "String"
1792
1833
  }
1793
1834
  }
1794
1835
  ],
1795
1836
  "output": {
1796
- "description": "Returns True if the values are not identical, otherwise False.",
1837
+ "description": "An array of Strings.",
1797
1838
  "type": {
1798
- "type": "Any"
1839
+ "type": "Array",
1840
+ "ofType": {
1841
+ "type": "String"
1842
+ }
1799
1843
  }
1800
1844
  }
1801
1845
  },
1802
- "@toddle/range": {
1803
- "name": "Range",
1804
- "description": "Create an Array of numbers between a Min and Max value.",
1846
+ "@toddle/keyBy": {
1847
+ "name": "Key by",
1848
+ "description": "Organize an Array of items into an Object based on a Key formula.",
1805
1849
  "arguments": [
1806
1850
  {
1851
+ "name": "Array",
1807
1852
  "formula": {
1808
1853
  "type": "value",
1809
- "value": 0
1854
+ "value": null
1810
1855
  },
1811
- "name": "Min",
1812
- "description": "The smallest value in the list.",
1856
+ "description": "Array of items.",
1813
1857
  "type": {
1814
- "type": "Number"
1858
+ "type": "Array"
1815
1859
  }
1816
1860
  },
1817
1861
  {
1818
- "name": "Max",
1862
+ "name": "Formula",
1863
+ "isFunction": true,
1819
1864
  "formula": {
1820
1865
  "type": "value",
1821
- "value": 10
1866
+ "value": null
1822
1867
  },
1823
- "description": "The largest value in the list.",
1868
+ "description": "The key formula used to index the items. The String returned from the formula will match the key in the output Object.",
1824
1869
  "type": {
1825
- "type": "Number"
1870
+ "type": "Formula"
1826
1871
  }
1827
1872
  }
1828
1873
  ],
1829
1874
  "output": {
1830
- "description": "An Array containing all the numbers between Min and Max, inclusive.",
1875
+ "description": "An Object where each key matches a value returned by the key formula, and each value is the item that String was returned for.",
1831
1876
  "type": {
1832
- "type": "Array"
1877
+ "type": "Object"
1833
1878
  }
1834
1879
  }
1835
1880
  },
1836
- "@toddle/round": {
1837
- "name": "Round",
1838
- "description": "Round a Number to the nearest decimal point.",
1881
+ "@toddle/absolute": {
1882
+ "name": "Absolute",
1883
+ "description": "Get the absolute value of a Number.",
1839
1884
  "arguments": [
1840
1885
  {
1841
- "name": "Input",
1842
- "description": "Number to round.",
1843
- "type": {
1844
- "type": "Number"
1845
- },
1886
+ "name": "Value",
1846
1887
  "formula": {
1847
1888
  "type": "value",
1848
- "value": 1
1849
- }
1850
- },
1851
- {
1852
- "name": "Decimals",
1853
- "description": "Number of decimals to round to.",
1889
+ "value": -1
1890
+ },
1854
1891
  "type": {
1855
1892
  "type": "Number"
1856
1893
  },
1857
- "formula": {
1858
- "type": "value",
1859
- "value": 0
1860
- }
1894
+ "description": "The input Number."
1861
1895
  }
1862
1896
  ],
1863
1897
  "output": {
1898
+ "description": "The absolute value of the input.",
1864
1899
  "type": {
1865
1900
  "type": "Number"
1866
- },
1867
- "description": "The rounded Number."
1901
+ }
1868
1902
  }
1869
1903
  },
1870
- "@toddle/split": {
1871
- "name": "Split",
1872
- "description": "Split a String into an Array of smaller strings each time a delimiter occurs. The delimiter will not be part of the output",
1904
+ "@toddle/every": {
1905
+ "name": "Every",
1906
+ "description": "Run a formula returns for all items in an Array.",
1873
1907
  "arguments": [
1874
1908
  {
1875
- "name": "Input",
1909
+ "name": "Array",
1876
1910
  "formula": {
1877
1911
  "type": "value",
1878
- "value": ""
1912
+ "value": null
1879
1913
  },
1880
- "description": "The String to split.",
1914
+ "description": "The array of items to evaluate.",
1881
1915
  "type": {
1882
- "type": "String"
1916
+ "type": "Array"
1883
1917
  }
1884
1918
  },
1885
1919
  {
1886
- "name": "Delimiter",
1920
+ "name": "Formula",
1921
+ "isFunction": true,
1887
1922
  "formula": {
1888
- "type": "value",
1889
- "value": ""
1923
+ "type": "path",
1924
+ "path": [
1925
+ "Args",
1926
+ "item"
1927
+ ]
1890
1928
  },
1891
- "description": "The string to split by.",
1929
+ "description": "Predicate formula for evaluating each item.",
1892
1930
  "type": {
1893
- "type": "String"
1931
+ "type": "Formula"
1894
1932
  }
1895
1933
  }
1896
1934
  ],
1897
1935
  "output": {
1898
- "description": "An array of Strings.",
1936
+ "description": "Returns True if the predicate formula returns true for all items in the Array, otherwise False.",
1899
1937
  "type": {
1900
- "type": "Array",
1901
- "ofType": {
1902
- "type": "String"
1903
- }
1938
+ "type": "Array"
1904
1939
  }
1905
1940
  }
1906
1941
  },
1907
- "@toddle/startsWith": {
1908
- "name": "Starts with",
1909
- "description": "Check if a String has a given prefix.",
1942
+ "@toddle/randomNumber": {
1943
+ "name": "Random number",
1944
+ "description": "return a random Number between 0 and 1.",
1945
+ "arguments": [],
1946
+ "cache": false,
1947
+ "output": {
1948
+ "description": "A random Number between 0 and 1.",
1949
+ "type": {
1950
+ "type": "Number"
1951
+ }
1952
+ }
1953
+ },
1954
+ "@toddle/languages": {
1955
+ "name": "Languages",
1956
+ "description": "An array of the preferred languages for the user, based on the Navigator.languages property (on the client) or the Accept-Language header (on the server).",
1957
+ "arguments": [],
1958
+ "output": {
1959
+ "description": "An array with the preferred languages for the user.",
1960
+ "type": {
1961
+ "type": "Array"
1962
+ }
1963
+ }
1964
+ },
1965
+ "@toddle/roundDown": {
1966
+ "name": "Round down",
1967
+ "description": "Round a Number down to the nearest decimal point.",
1910
1968
  "arguments": [
1911
1969
  {
1912
- "name": "String",
1970
+ "name": "Input",
1971
+ "description": "Number to round down.",
1972
+ "type": {
1973
+ "type": "Number"
1974
+ },
1913
1975
  "formula": {
1914
1976
  "type": "value",
1915
- "value": ""
1916
- },
1917
- "description": "The String to check.",
1977
+ "value": 1
1978
+ }
1979
+ },
1980
+ {
1981
+ "name": "Decimals",
1982
+ "description": "Number of decimals to round to.",
1918
1983
  "type": {
1919
- "type": "String"
1984
+ "type": "Number"
1985
+ },
1986
+ "formula": {
1987
+ "type": "value",
1988
+ "value": 0
1920
1989
  }
1990
+ }
1991
+ ],
1992
+ "output": {
1993
+ "type": {
1994
+ "type": "Number"
1921
1995
  },
1996
+ "description": "The rounded Number."
1997
+ }
1998
+ },
1999
+ "@toddle/uppercase": {
2000
+ "name": "Uppercase",
2001
+ "description": "Convert a String to uppercase.",
2002
+ "arguments": [
1922
2003
  {
1923
- "name": "Prefix",
2004
+ "name": "String",
1924
2005
  "formula": {
1925
2006
  "type": "value",
1926
- "value": ""
2007
+ "value": "string"
1927
2008
  },
1928
- "description": "The prefix to check for.",
2009
+ "description": "Input String.",
1929
2010
  "type": {
1930
2011
  "type": "String"
1931
2012
  }
1932
2013
  }
1933
2014
  ],
1934
2015
  "output": {
1935
- "description": "Returns True if the input String starts with the prefix, otherwise False",
2016
+ "description": "The input String with all characters converted to uppercase.",
1936
2017
  "type": {
1937
- "type": "Boolean"
2018
+ "type": "String"
1938
2019
  }
1939
2020
  }
1940
2021
  },
1941
- "@toddle/greaterThan": {
1942
- "name": "Greater than",
1943
- "description": "Compute if a value is larger than another value.",
2022
+ "@toddle/dateFromTimestamp": {
2023
+ "name": "Date From Timestamp",
1944
2024
  "arguments": [
1945
2025
  {
1946
- "name": "First",
1947
- "formula": {
1948
- "type": "value",
1949
- "value": ""
1950
- },
1951
- "description": "First value to be compared.",
2026
+ "name": "Timestamp",
2027
+ "description": "A Number in milliseconds since 1st January, 1970 (EPOCH).",
1952
2028
  "type": {
1953
2029
  "type": "Number"
2030
+ },
2031
+ "formula": {
2032
+ "type": "value",
2033
+ "value": 1687787245933
1954
2034
  }
1955
- },
2035
+ }
2036
+ ],
2037
+ "description": "Convert a timestamp (milliseconds) to a Date.",
2038
+ "output": {
2039
+ "description": "The input value converted to a Date.",
2040
+ "type": {
2041
+ "type": "Date"
2042
+ }
2043
+ }
2044
+ },
2045
+ "@toddle/boolean": {
2046
+ "name": "Boolean",
2047
+ "description": "Convert a value of any type to a Boolean.",
2048
+ "arguments": [
1956
2049
  {
1957
- "name": "Second",
2050
+ "name": "Input",
2051
+ "description": "Value of any type.",
2052
+ "type": {
2053
+ "type": "Any"
2054
+ },
1958
2055
  "formula": {
1959
2056
  "type": "value",
1960
- "value": ""
1961
- },
1962
- "description": "Second value to be compared.",
1963
- "type": {
1964
- "type": "Number"
2057
+ "value": "1"
1965
2058
  }
1966
2059
  }
1967
2060
  ],
1968
2061
  "output": {
1969
- "description": "Returns True if the first Number is larger than the second Number.",
2062
+ "description": "The input value converted to a Boolean. False and Null will return False, all other values will return True.",
1970
2063
  "type": {
1971
2064
  "type": "Boolean"
1972
2065
  }
1973
2066
  }
1974
2067
  },
1975
- "@toddle/join": {
1976
- "name": "Join",
1977
- "description": "Combine an Array of Strings in to a single String.",
2068
+ "@toddle/findLast": {
2069
+ "name": "Find Last",
2070
+ "description": "Search through an Array of items and apply a formula to each item, to return the last item where the formula returns True.",
1978
2071
  "arguments": [
1979
2072
  {
1980
2073
  "name": "Array",
@@ -1982,56 +2075,94 @@
1982
2075
  "type": "value",
1983
2076
  "value": null
1984
2077
  },
1985
- "description": "An array of Strings.",
2078
+ "description": "The array to search.",
1986
2079
  "type": {
1987
2080
  "type": "Array"
1988
2081
  }
1989
2082
  },
1990
2083
  {
1991
- "name": "Separator",
2084
+ "name": "Formula",
2085
+ "isFunction": true,
1992
2086
  "formula": {
1993
- "type": "value",
1994
- "value": ", "
2087
+ "type": "path",
2088
+ "path": [
2089
+ "Args",
2090
+ "item"
2091
+ ]
1995
2092
  },
1996
- "description": "A separator String that is inserted in between each item in the Array to join.",
2093
+ "description": "The predicate formula that each item in the Array is passed to.",
1997
2094
  "type": {
1998
- "type": "String"
2095
+ "type": "Formula"
1999
2096
  }
2000
2097
  }
2001
2098
  ],
2002
2099
  "output": {
2003
- "description": "A String combining each item in the input Array separated by the separator String, e.g. joining [\"a\", \"b\", \"c\"] with a \",\" separator will return \"a,b,c\".",
2100
+ "description": "The last item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
2004
2101
  "type": {
2005
- "type": "String"
2102
+ "type": "Any"
2006
2103
  }
2007
2104
  }
2008
2105
  },
2009
- "@toddle/not": {
2010
- "name": "Not",
2011
- "description": "Get the Boolean opposite of an input value.",
2106
+ "@toddle/entries": {
2107
+ "name": "Entries",
2108
+ "description": "Get an Array of entries from a given Object.",
2012
2109
  "arguments": [
2013
2110
  {
2014
- "name": "Input",
2111
+ "name": "Object",
2015
2112
  "formula": {
2016
2113
  "type": "value",
2017
- "value": true
2114
+ "value": null
2018
2115
  },
2019
- "description": "The input value.",
2116
+ "description": "Input record",
2020
2117
  "type": {
2021
- "type": "Boolean"
2118
+ "type": "Object"
2022
2119
  }
2023
2120
  }
2024
2121
  ],
2025
2122
  "output": {
2026
- "description": "Returns True if the input value is False, and False if the input value is True.",
2123
+ "description": "Returns an Array of entries for the given input record. The entries are Objects with a “Key” and “Value” property.",
2124
+ "type": {
2125
+ "type": "Array"
2126
+ }
2127
+ }
2128
+ },
2129
+ "@toddle/decodeBase64": {
2130
+ "name": "Decode base64",
2131
+ "arguments": [
2132
+ {
2133
+ "name": "Base64 value",
2134
+ "formula": {
2135
+ "type": "value",
2136
+ "value": "Input value"
2137
+ },
2138
+ "type": {
2139
+ "type": "String"
2140
+ },
2141
+ "description": "The input data encoded as base64."
2142
+ }
2143
+ ],
2144
+ "description": "Deocde a base64 string to utf-8.",
2145
+ "output": {
2146
+ "description": "The decoded string.",
2147
+ "type": {
2148
+ "type": "String"
2149
+ }
2150
+ }
2151
+ },
2152
+ "@toddle/isServer": {
2153
+ "name": "Is Server",
2154
+ "description": "Get information about whether formulas are currently evaluated server-side or client-side.",
2155
+ "arguments": [],
2156
+ "output": {
2157
+ "description": "Returns True if formulas are evaluated server-side, and False if formulas are evaluated client-side.",
2027
2158
  "type": {
2028
2159
  "type": "Boolean"
2029
2160
  }
2030
2161
  }
2031
2162
  },
2032
- "@toddle/lastIndexOf": {
2033
- "name": "Last Index of",
2034
- "description": "Search an Array or String to find the index of the last occurrence of a specified item or substring.",
2163
+ "@toddle/includes": {
2164
+ "name": "Includes",
2165
+ "description": "Test if an Array or String includes a specific item or value.",
2035
2166
  "arguments": [
2036
2167
  {
2037
2168
  "name": "Array",
@@ -2039,7 +2170,7 @@
2039
2170
  "type": "value",
2040
2171
  "value": ""
2041
2172
  },
2042
- "description": "The Array or String to search.",
2173
+ "description": "The Array to search.",
2043
2174
  "type": {
2044
2175
  "type": "Union",
2045
2176
  "types": [
@@ -2058,93 +2189,83 @@
2058
2189
  "type": "value",
2059
2190
  "value": ""
2060
2191
  },
2061
- "description": "The item or substring to search for.",
2192
+ "description": "The item or value to search for.",
2062
2193
  "type": {
2063
2194
  "type": "Any"
2064
2195
  }
2065
2196
  }
2066
2197
  ],
2067
2198
  "output": {
2068
- "description": "If the item or substring exists in the Array, the last index of that item is returned. If the item is not found, -1 is returned.",
2199
+ "description": "Returns True if the item or value exists in the Array or string. Returns False if no match is found.",
2069
2200
  "type": {
2070
- "type": "Number"
2201
+ "type": "Boolean"
2071
2202
  }
2072
2203
  }
2073
2204
  },
2074
- "@toddle/lowercase": {
2075
- "name": "Lower case",
2076
- "description": "Convert a string to lowercase.",
2205
+ "@toddle/timestamp": {
2206
+ "name": "Timestamp",
2207
+ "description": "Get the timestamp from a Date, e.g. 1633462980000.",
2077
2208
  "arguments": [
2078
2209
  {
2079
- "name": "String",
2210
+ "name": "Date",
2211
+ "description": "The date to get the timestamp from.",
2212
+ "type": {
2213
+ "type": "Date"
2214
+ },
2080
2215
  "formula": {
2081
2216
  "type": "value",
2082
- "value": "string"
2083
- },
2084
- "description": "Input String",
2085
- "type": {
2086
- "type": "String"
2217
+ "value": null
2087
2218
  }
2088
2219
  }
2089
2220
  ],
2090
2221
  "output": {
2091
- "description": "The input String with all characters converted to lowercase.",
2222
+ "description": "The timestamp from the date input.",
2092
2223
  "type": {
2093
- "type": "String"
2224
+ "type": "Number"
2094
2225
  }
2095
2226
  }
2096
2227
  },
2097
- "@toddle/equals": {
2098
- "name": "Equals",
2099
- "description": "Compute if values are identical.",
2228
+ "@toddle/fromEntries": {
2229
+ "name": "From entries",
2230
+ "description": "Create a record from an Array of entries. This formula is the reverse of Entries.",
2100
2231
  "arguments": [
2101
2232
  {
2102
- "name": "First",
2233
+ "name": "Array",
2103
2234
  "formula": {
2104
2235
  "type": "value",
2105
- "value": ""
2236
+ "value": null
2106
2237
  },
2107
- "description": "First Value",
2238
+ "description": "The array of entries.",
2108
2239
  "type": {
2109
- "type": "Any"
2110
- }
2111
- },
2112
- {
2113
- "name": "Second",
2114
- "formula": {
2115
- "type": "value",
2116
- "value": ""
2117
- },
2118
- "description": "Second Value",
2119
- "type": {
2120
- "type": "Any"
2240
+ "type": "Array"
2121
2241
  }
2122
2242
  }
2123
2243
  ],
2124
2244
  "output": {
2125
- "description": "Returns True if the input values are identical, otherwise False.",
2245
+ "description": "An Object containing all entries from the input Array.",
2126
2246
  "type": {
2127
- "type": "Boolean"
2247
+ "type": "Object"
2128
2248
  }
2129
2249
  }
2130
2250
  },
2131
- "@toddle/sort_by": {
2132
- "name": "Sort by",
2133
- "description": "Sort an Array using a formula.",
2251
+ "@toddle/filter": {
2252
+ "name": "Filter",
2253
+ "description": "Return a new Array containing only the elements for which the provided formula evaluates to True.",
2134
2254
  "arguments": [
2135
2255
  {
2136
2256
  "name": "Array",
2137
2257
  "formula": {
2138
2258
  "type": "value",
2139
- "value": []
2259
+ "value": null
2140
2260
  },
2261
+ "description": "The array of items to be filtered.",
2141
2262
  "type": {
2142
2263
  "type": "Array"
2143
- },
2144
- "description": "The input Array."
2264
+ }
2145
2265
  },
2146
2266
  {
2147
2267
  "name": "Formula",
2268
+ "isFunction": true,
2148
2269
  "formula": {
2149
2270
  "type": "path",
2150
2271
  "path": [
@@ -2152,46 +2273,22 @@
2152
2273
  "item"
2153
2274
  ]
2154
2275
  },
2276
+ "description": "Predicate formula for filtering items.",
2155
2277
  "type": {
2156
2278
  "type": "Formula"
2157
- },
2158
- "isFunction": true,
2159
- "description": "The sorting formula. The output of this formula will determine the sort order of the items. If the formula returns an Array, the items will first be sorted by the first item, then the second, etc."
2160
- },
2161
- {
2162
- "name": "Ascending?",
2163
- "formula": {
2164
- "type": "value",
2165
- "value": true
2166
- },
2167
- "type": {
2168
- "type": "Boolean"
2169
- },
2170
- "description": "Should the list be sorted in ascending order?"
2279
+ }
2171
2280
  }
2172
2281
  ],
2173
2282
  "output": {
2174
- "description": "The input Array sorted by the value returned by the sorting formula.",
2175
- "type": {
2176
- "type": "Number"
2177
- }
2178
- }
2179
- },
2180
- "@toddle/now": {
2181
- "name": "Now",
2182
- "description": "Get a Date representing \"Now\"",
2183
- "arguments": [],
2184
- "cache": false,
2185
- "output": {
2186
- "description": "A Date object initialized at the current date/time.",
2283
+ "description": "New Array containing only the items for which the Formula evaluated to True.",
2187
2284
  "type": {
2188
- "type": "Date"
2285
+ "type": "Array"
2189
2286
  }
2190
2287
  }
2191
2288
  },
2192
- "@toddle/getHttpOnlyCookie": {
2193
- "name": "Get Http-Only Cookie",
2194
- "description": "Get the value of an Http-Only cookie by name. This formula will is only intended to be used server-side for SSR/proxied API requests to read Http-Only cookies.",
2289
+ "@toddle/getCookie": {
2290
+ "name": "Get Cookie",
2291
+ "description": "Get the value of a cookie by name. This formula is available both server-side and client-side. Http-Only cookies will only be available server-side.",
2195
2292
  "arguments": [
2196
2293
  {
2197
2294
  "name": "Cookie name",
@@ -2199,14 +2296,14 @@
2199
2296
  "type": "value",
2200
2297
  "value": null
2201
2298
  },
2202
- "description": "The name of the Http-Only cookie you want to get the value of.",
2299
+ "description": "The name of the cookie you want to get the value of.",
2203
2300
  "type": {
2204
2301
  "type": "String"
2205
2302
  }
2206
2303
  }
2207
2304
  ],
2208
2305
  "output": {
2209
- "description": "The value of the cookie. If no cookie is found, this will return Null. If you use this formula client-side, it will return a placeholder template string.",
2306
+ "description": "The value of the cookie. If a value is not found, this return value will be Null.",
2210
2307
  "type": {
2211
2308
  "type": "String"
2212
2309
  }
@@ -2247,43 +2344,100 @@
2247
2344
  }
2248
2345
  }
2249
2346
  },
2250
- "@toddle/encodeJSON": {
2251
- "name": "Encode JSON",
2252
- "description": "Encode data as JSON.",
2347
+ "@toddle/last": {
2348
+ "name": "Last",
2349
+ "description": "Get the last item in an Array.",
2253
2350
  "arguments": [
2254
2351
  {
2255
- "name": "Data",
2352
+ "name": "Array",
2256
2353
  "formula": {
2257
2354
  "type": "value",
2258
- "value": null
2355
+ "value": []
2259
2356
  },
2260
- "description": "The data to convert.",
2357
+ "type": {
2358
+ "type": "Array"
2359
+ },
2360
+ "description": "The input Array."
2361
+ }
2362
+ ],
2363
+ "output": {
2364
+ "description": "The last item in the Array.",
2365
+ "type": {
2366
+ "type": "Any"
2367
+ }
2368
+ }
2369
+ },
2370
+ "@toddle/notEqual": {
2371
+ "name": "Not equal",
2372
+ "description": "Compute if values are not identical.",
2373
+ "arguments": [
2374
+ {
2375
+ "name": "First",
2376
+ "formula": {
2377
+ "type": "value",
2378
+ "value": ""
2379
+ },
2380
+ "description": "First value.",
2261
2381
  "type": {
2262
2382
  "type": "Any"
2263
2383
  }
2264
2384
  },
2265
2385
  {
2266
- "name": "Indent",
2386
+ "name": "Second",
2267
2387
  "formula": {
2268
2388
  "type": "value",
2269
- "value": 2
2389
+ "value": ""
2270
2390
  },
2271
- "description": "How many characters the encoded value will be indented.",
2391
+ "description": "Second value.",
2272
2392
  "type": {
2273
- "type": "Number"
2393
+ "type": "Any"
2274
2394
  }
2275
2395
  }
2276
2396
  ],
2277
2397
  "output": {
2278
- "description": "The encoded JSON value.",
2398
+ "description": "Returns True if the values are not identical, otherwise False.",
2279
2399
  "type": {
2280
- "type": "String"
2400
+ "type": "Any"
2281
2401
  }
2282
2402
  }
2283
2403
  },
2284
- "@toddle/dropLast": {
2285
- "name": "Drop last",
2286
- "description": "Remove item(s) from the end of an Array or String.",
2404
+ "@toddle/roundUp": {
2405
+ "name": "Round up",
2406
+ "description": "Round a Number up to the nearest decimal point.",
2407
+ "arguments": [
2408
+ {
2409
+ "name": "Input",
2410
+ "description": "Number to round up.",
2411
+ "type": {
2412
+ "type": "Number"
2413
+ },
2414
+ "formula": {
2415
+ "type": "value",
2416
+ "value": 1
2417
+ }
2418
+ },
2419
+ {
2420
+ "name": "Decimals",
2421
+ "description": "Number of decimals to round to.",
2422
+ "type": {
2423
+ "type": "Number"
2424
+ },
2425
+ "formula": {
2426
+ "type": "value",
2427
+ "value": 0
2428
+ }
2429
+ }
2430
+ ],
2431
+ "output": {
2432
+ "type": {
2433
+ "type": "Number"
2434
+ },
2435
+ "description": "The rounded Number."
2436
+ }
2437
+ },
2438
+ "@toddle/drop": {
2439
+ "name": "Drop",
2440
+ "description": "Remove items from the beginning of an Array or String.",
2287
2441
  "arguments": [
2288
2442
  {
2289
2443
  "name": "Array",
@@ -2306,18 +2460,18 @@
2306
2460
  },
2307
2461
  {
2308
2462
  "name": "Count",
2309
- "formula": {
2310
- "type": "value",
2311
- "value": 1
2312
- },
2463
+ "description": "Number of items to remove.",
2313
2464
  "type": {
2314
2465
  "type": "Number"
2315
2466
  },
2316
- "description": "Number of items to remove."
2467
+ "formula": {
2468
+ "type": "value",
2469
+ "value": 1
2470
+ }
2317
2471
  }
2318
2472
  ],
2319
2473
  "output": {
2320
- "description": "A copy of the list without the last item(s).",
2474
+ "description": "A copy of the list without the first items.",
2321
2475
  "type": {
2322
2476
  "type": "Union",
2323
2477
  "types": [
@@ -2331,26 +2485,88 @@
2331
2485
  }
2332
2486
  }
2333
2487
  },
2334
- "@toddle/getCookie": {
2335
- "name": "Get Cookie",
2336
- "description": "Get the value of a cookie by name. This formula is available both server-side and client-side. Http-Only cookies will only be available server-side.",
2488
+ "@toddle/unique": {
2489
+ "name": "Unique",
2490
+ "description": "Remove duplicate values from an Array.",
2337
2491
  "arguments": [
2338
2492
  {
2339
- "name": "Cookie name",
2493
+ "name": "Array",
2494
+ "formula": {
2495
+ "type": "value",
2496
+ "value": []
2497
+ },
2498
+ "type": {
2499
+ "type": "Array"
2500
+ },
2501
+ "description": "The input Array."
2502
+ }
2503
+ ],
2504
+ "output": {
2505
+ "description": "The input Array with all duplicate values removed.",
2506
+ "type": {
2507
+ "type": "Array"
2508
+ }
2509
+ }
2510
+ },
2511
+ "@toddle/canShare": {
2512
+ "name": "Can Share",
2513
+ "description": "Return a Boolean indicating whether the provided data can be shared (with the \"Share\" action).",
2514
+ "arguments": [
2515
+ {
2516
+ "name": "URL",
2517
+ "description": "The URL you want to check.",
2518
+ "type": {
2519
+ "type": "String"
2520
+ },
2340
2521
  "formula": {
2341
2522
  "type": "value",
2342
2523
  "value": null
2524
+ }
2525
+ },
2526
+ {
2527
+ "name": "Title",
2528
+ "description": "The title you want to check.",
2529
+ "type": {
2530
+ "type": "String"
2343
2531
  },
2344
- "description": "The name of the cookie you want to get the value of.",
2532
+ "formula": {
2533
+ "type": "value",
2534
+ "value": null
2535
+ }
2536
+ },
2537
+ {
2538
+ "name": "Text",
2539
+ "description": "The text you want to check.",
2345
2540
  "type": {
2346
2541
  "type": "String"
2542
+ },
2543
+ "formula": {
2544
+ "type": "value",
2545
+ "value": null
2546
+ }
2547
+ }
2548
+ ]
2549
+ },
2550
+ "@toddle/not": {
2551
+ "name": "Not",
2552
+ "description": "Get the Boolean opposite of an input value.",
2553
+ "arguments": [
2554
+ {
2555
+ "name": "Input",
2556
+ "formula": {
2557
+ "type": "value",
2558
+ "value": true
2559
+ },
2560
+ "description": "The input value.",
2561
+ "type": {
2562
+ "type": "Boolean"
2347
2563
  }
2348
2564
  }
2349
2565
  ],
2350
2566
  "output": {
2351
- "description": "The value of the cookie. If a value is not found, this return value will be Null.",
2567
+ "description": "Returns True if the input value is False, and False if the input value is True.",
2352
2568
  "type": {
2353
- "type": "String"
2569
+ "type": "Boolean"
2354
2570
  }
2355
2571
  }
2356
2572
  },
@@ -2392,123 +2608,146 @@
2392
2608
  }
2393
2609
  }
2394
2610
  },
2395
- "@toddle/string": {
2396
- "name": "String",
2397
- "description": "Convert a value of any type to a String.",
2611
+ "@toddle/minus": {
2612
+ "name": "Minus",
2613
+ "description": "Subtract a Number from a Number.",
2398
2614
  "arguments": [
2399
2615
  {
2400
- "name": "Input",
2401
- "description": "Value of any type.",
2402
- "type": {
2403
- "type": "Any"
2404
- },
2616
+ "name": "Minuend",
2405
2617
  "formula": {
2406
2618
  "type": "value",
2407
- "value": "1"
2619
+ "value": 1
2620
+ },
2621
+ "description": "The number to subtract from.",
2622
+ "type": {
2623
+ "type": "Number"
2624
+ }
2625
+ },
2626
+ {
2627
+ "name": "Substrahend",
2628
+ "formula": {
2629
+ "type": "value",
2630
+ "value": 1
2631
+ },
2632
+ "description": "The number to subtract.",
2633
+ "type": {
2634
+ "type": "Number"
2408
2635
  }
2409
2636
  }
2410
2637
  ],
2411
2638
  "output": {
2412
- "description": "The input value converted to a String",
2639
+ "description": "The result of subtracting the Substrahend from the Minuend.",
2413
2640
  "type": {
2414
- "type": "String"
2641
+ "type": "Number"
2415
2642
  }
2416
2643
  }
2417
2644
  },
2418
- "@toddle/roundUp": {
2419
- "name": "Round up",
2420
- "description": "Round a Number up to the nearest decimal point.",
2645
+ "@toddle/append": {
2646
+ "name": "Append",
2647
+ "description": "Add an element to the end of an Array.",
2421
2648
  "arguments": [
2422
2649
  {
2423
- "name": "Input",
2424
- "description": "Number to round up.",
2650
+ "name": "Array",
2425
2651
  "type": {
2426
- "type": "Number"
2652
+ "type": "Array"
2427
2653
  },
2654
+ "description": "The Array to append to.",
2428
2655
  "formula": {
2429
- "type": "value",
2430
- "value": 1
2656
+ "type": "array",
2657
+ "arguments": []
2431
2658
  }
2432
2659
  },
2433
2660
  {
2434
- "name": "Decimals",
2435
- "description": "Number of decimals to round to.",
2661
+ "name": "Item",
2436
2662
  "type": {
2437
- "type": "Number"
2663
+ "type": "Any"
2438
2664
  },
2665
+ "description": "The item to append to the Array.",
2439
2666
  "formula": {
2440
2667
  "type": "value",
2441
- "value": 0
2668
+ "value": "Item"
2442
2669
  }
2443
2670
  }
2444
2671
  ],
2445
2672
  "output": {
2673
+ "description": "A new Array containing all elements from the input Array, including the new item.",
2446
2674
  "type": {
2447
- "type": "Number"
2448
- },
2449
- "description": "The rounded Number."
2675
+ "type": "Array"
2676
+ }
2450
2677
  }
2451
2678
  },
2452
- "@toddle/reverse": {
2453
- "name": "Reverse",
2454
- "description": "Reverse the order of an Array.",
2679
+ "@toddle/clamp": {
2680
+ "name": "Clamp",
2681
+ "description": "Limit a value to a specified Min and Max value.",
2455
2682
  "arguments": [
2456
2683
  {
2457
- "name": "Array",
2684
+ "name": "Value",
2685
+ "type": {
2686
+ "type": "Number"
2687
+ },
2458
2688
  "formula": {
2459
2689
  "type": "value",
2460
2690
  "value": null
2461
2691
  },
2462
- "description": "The Array to be reversed.",
2692
+ "description": "Number to round."
2693
+ },
2694
+ {
2695
+ "name": "Min",
2463
2696
  "type": {
2464
- "type": "Array"
2697
+ "type": "Number"
2698
+ },
2699
+ "description": "The smallest allowed Number.",
2700
+ "formula": {
2701
+ "type": "value",
2702
+ "value": 0
2703
+ }
2704
+ },
2705
+ {
2706
+ "name": "Max",
2707
+ "type": {
2708
+ "type": "Number"
2709
+ },
2710
+ "description": "The largest allowed Number.",
2711
+ "formula": {
2712
+ "type": "value",
2713
+ "value": 100
2465
2714
  }
2466
2715
  }
2467
2716
  ],
2468
2717
  "output": {
2469
2718
  "type": {
2470
- "type": "Array"
2719
+ "type": "Number"
2471
2720
  },
2472
- "description": "The reversed Array."
2721
+ "description": "Returns the input value if between the specified Min and Max. Otherwise, it returns the Min or Max value."
2473
2722
  }
2474
2723
  },
2475
- "@toddle/prepend": {
2476
- "name": "Prepend",
2477
- "description": "Add an element to the start of an Array.",
2724
+ "@toddle/getElementById": {
2725
+ "name": "Get element by id",
2726
+ "description": "Return a DOM element with a given id.",
2727
+ "cache": false,
2478
2728
  "arguments": [
2479
2729
  {
2480
- "name": "Array",
2481
- "type": {
2482
- "type": "Array"
2483
- },
2484
- "description": "The Array to prepend to.",
2730
+ "name": "Id",
2485
2731
  "formula": {
2486
- "type": "array",
2487
- "arguments": []
2488
- }
2489
- },
2490
- {
2491
- "name": "Item",
2732
+ "type": "value",
2733
+ "value": "element-id"
2734
+ },
2492
2735
  "type": {
2493
- "type": "Any"
2736
+ "type": "String"
2494
2737
  },
2495
- "description": "The item to prepend to the Array.",
2496
- "formula": {
2497
- "type": "value",
2498
- "value": "Item"
2499
- }
2738
+ "description": "The id of the DOM element to return."
2500
2739
  }
2501
2740
  ],
2502
2741
  "output": {
2503
- "description": "A new Array containing the new item and all the elements from the input Array.",
2742
+ "description": "The DOM element with the given id. If no DOM element is found, this will return Null.",
2504
2743
  "type": {
2505
- "type": "Array"
2744
+ "type": "Element"
2506
2745
  }
2507
2746
  }
2508
2747
  },
2509
- "@toddle/last": {
2510
- "name": "Last",
2511
- "description": "Get the last item in an Array.",
2748
+ "@toddle/first": {
2749
+ "name": "First",
2750
+ "description": "Return the first item in an Array.",
2512
2751
  "arguments": [
2513
2752
  {
2514
2753
  "name": "Array",
@@ -2519,81 +2758,85 @@
2519
2758
  "type": {
2520
2759
  "type": "Array"
2521
2760
  },
2522
- "description": "The input Array."
2761
+ "description": "An Array of items."
2523
2762
  }
2524
2763
  ],
2525
2764
  "output": {
2526
- "description": "The last item in the Array.",
2765
+ "description": "The first item in the Array.",
2527
2766
  "type": {
2528
2767
  "type": "Any"
2529
2768
  }
2530
2769
  }
2531
2770
  },
2532
- "@toddle/modulo": {
2533
- "name": "Modulo",
2534
- "description": "Get the remainder when dividing two Numbers.",
2771
+ "@toddle/size": {
2772
+ "name": "Size",
2773
+ "description": "Get the size of an Array, Object or String.",
2535
2774
  "arguments": [
2536
2775
  {
2537
- "name": "Dividend",
2538
- "formula": {
2539
- "type": "value",
2540
- "value": 1
2541
- },
2542
- "description": "The number to be divided.",
2543
- "type": {
2544
- "type": "Number"
2545
- }
2546
- },
2547
- {
2548
- "name": "Divider",
2776
+ "name": "Collection",
2549
2777
  "formula": {
2550
2778
  "type": "value",
2551
- "value": 1
2779
+ "value": [
2780
+ 1,
2781
+ 2,
2782
+ 3
2783
+ ]
2552
2784
  },
2553
- "description": "The number to divide by.",
2785
+ "description": "The collection to get the size of.",
2554
2786
  "type": {
2555
- "type": "Number"
2787
+ "type": "Union",
2788
+ "types": [
2789
+ {
2790
+ "type": "String"
2791
+ },
2792
+ {
2793
+ "type": "Array"
2794
+ },
2795
+ {
2796
+ "type": "Object"
2797
+ }
2798
+ ]
2556
2799
  }
2557
2800
  }
2558
2801
  ],
2559
2802
  "output": {
2560
- "description": "The remainder when the Dividend is divided by the Divider.",
2803
+ "description": "The size of the collection.",
2561
2804
  "type": {
2562
2805
  "type": "Number"
2563
2806
  }
2564
2807
  }
2565
2808
  },
2566
- "@toddle/json": {
2567
- "name": "JSON",
2568
- "description": "Convert a value into a JSON String.",
2809
+ "@toddle/range": {
2810
+ "name": "Range",
2811
+ "description": "Create an Array of numbers between a Min and Max value.",
2569
2812
  "arguments": [
2570
2813
  {
2571
- "name": "Input",
2572
2814
  "formula": {
2573
2815
  "type": "value",
2574
- "value": null
2816
+ "value": 0
2575
2817
  },
2576
- "description": "The input value.",
2818
+ "name": "Min",
2819
+ "description": "The smallest value in the list.",
2577
2820
  "type": {
2578
- "type": "Any"
2821
+ "type": "Number"
2579
2822
  }
2580
2823
  },
2581
2824
  {
2582
- "name": "Indentation",
2825
+ "name": "Max",
2583
2826
  "formula": {
2584
2827
  "type": "value",
2585
- "value": 0
2828
+ "value": 10
2586
2829
  },
2587
- "description": "The number of spaces used for indentation in the JSON String.",
2830
+ "description": "The largest value in the list.",
2588
2831
  "type": {
2589
2832
  "type": "Number"
2590
2833
  }
2591
2834
  }
2592
2835
  ],
2593
2836
  "output": {
2594
- "description": "The JSON String.",
2837
+ "description": "An Array containing all the numbers between Min and Max, inclusive.",
2595
2838
  "type": {
2596
- "type": "String"
2839
+ "type": "Array"
2597
2840
  }
2598
2841
  }
2599
2842
  },
@@ -2620,267 +2863,143 @@
2620
2863
  }
2621
2864
  }
2622
2865
  },
2623
- "@toddle/add": {
2624
- "name": "Add",
2866
+ "@toddle/take": {
2867
+ "name": "Take",
2868
+ "description": "Take items from the start of an Array or String.",
2625
2869
  "arguments": [
2626
2870
  {
2627
- "name": "0",
2628
- "description": "Number to be added.",
2629
- "type": {
2630
- "type": "Number"
2631
- },
2871
+ "name": "Array",
2632
2872
  "formula": {
2633
2873
  "type": "value",
2634
- "value": 1
2874
+ "value": null
2875
+ },
2876
+ "description": "Input Array or String.",
2877
+ "type": {
2878
+ "type": "Union",
2879
+ "types": [
2880
+ {
2881
+ "type": "String"
2882
+ },
2883
+ {
2884
+ "type": "Array"
2885
+ }
2886
+ ]
2635
2887
  }
2636
2888
  },
2637
2889
  {
2638
- "name": "1",
2639
- "type": {
2640
- "type": "Number"
2641
- },
2642
- "description": "Number to be added.",
2890
+ "name": "Count",
2643
2891
  "formula": {
2644
2892
  "type": "value",
2645
2893
  "value": 1
2646
- }
2894
+ },
2895
+ "type": {
2896
+ "type": "Number"
2897
+ },
2898
+ "description": "Number of items to take."
2647
2899
  }
2648
2900
  ],
2649
- "variableArguments": true,
2650
- "description": "Get the sum of multiple numbers.",
2651
2901
  "output": {
2652
- "description": "The sum of all the input numbers.",
2902
+ "description": "The first items from the Array or String.",
2653
2903
  "type": {
2654
- "type": "Number"
2904
+ "type": "Union",
2905
+ "types": [
2906
+ {
2907
+ "type": "String"
2908
+ },
2909
+ {
2910
+ "type": "Array"
2911
+ }
2912
+ ]
2655
2913
  }
2656
2914
  }
2657
2915
  },
2658
- "@toddle/greaterOrEqueal": {
2659
- "name": "Greater or equal",
2660
- "description": "Compute whether a value is larger than or equal to another value.",
2916
+ "@toddle/matches": {
2917
+ "name": "Matches",
2918
+ "description": "Finds the (global) matches in a String based on a regular expression.",
2661
2919
  "arguments": [
2662
2920
  {
2663
- "name": "First",
2921
+ "name": "Input",
2664
2922
  "formula": {
2665
2923
  "type": "value",
2666
2924
  "value": ""
2667
2925
  },
2668
- "description": "First value to be compared.",
2926
+ "description": "The string to search for matches in.",
2669
2927
  "type": {
2670
- "type": "Number"
2928
+ "type": "String"
2671
2929
  }
2672
2930
  },
2673
2931
  {
2674
- "name": "Second",
2932
+ "name": "Regular expression",
2675
2933
  "formula": {
2676
2934
  "type": "value",
2677
2935
  "value": ""
2678
2936
  },
2679
- "description": "Second value to be compared.",
2680
- "type": {
2681
- "type": "Number"
2682
- }
2683
- }
2684
- ],
2685
- "output": {
2686
- "description": "Returns True if the first Number is larger than or equal to the second Number.",
2687
- "type": {
2688
- "type": "Boolean"
2689
- }
2690
- }
2691
- },
2692
- "@toddle/reduce": {
2693
- "name": "Reduce",
2694
- "description": "Reduce a group of items to a single value by applying each item to a reducer formula.",
2695
- "arguments": [
2696
- {
2697
- "name": "Array",
2698
- "formula": {
2699
- "type": "value",
2700
- "value": null
2701
- },
2702
- "description": "The Array or Object of items to be reduced.",
2937
+ "description": "The regular expression to use for matching.",
2703
2938
  "type": {
2704
- "type": "Union",
2705
- "types": [
2706
- {
2707
- "type": "Array"
2708
- },
2709
- {
2710
- "type": "Object"
2711
- }
2712
- ]
2939
+ "type": "String"
2713
2940
  }
2714
2941
  },
2715
2942
  {
2716
- "name": "Formula",
2717
- "isFunction": true,
2943
+ "name": "Global search",
2718
2944
  "formula": {
2719
2945
  "type": "value",
2720
- "value": null
2946
+ "value": true
2721
2947
  },
2722
- "description": "The reducer formula. Each item in the Array is applied to the formula along with the accumulator. The result of this formula will be a new accumulator used for the next item.",
2948
+ "description": "Test the regular expression against all possible matches in a string.",
2723
2949
  "type": {
2724
- "type": "Formula"
2950
+ "type": "Boolean"
2725
2951
  }
2726
2952
  },
2727
2953
  {
2728
- "name": "Accumulator",
2729
- "formula": {
2730
- "type": "value",
2731
- "value": null
2732
- },
2733
- "description": "The initial value of the accumulator. This value is passed to the reducer formula along with the first item in the Array, and the result is used as the accumulator for the next item.",
2734
- "type": {
2735
- "type": "Any"
2736
- }
2737
- }
2738
- ],
2739
- "output": {
2740
- "description": "The value returned from applying the last item to the reducer formula.",
2741
- "type": {
2742
- "type": "Any"
2743
- }
2744
- }
2745
- },
2746
- "@toddle/decodeBase64": {
2747
- "name": "Decode base64",
2748
- "arguments": [
2749
- {
2750
- "name": "Base64 value",
2751
- "formula": {
2752
- "type": "value",
2753
- "value": "Input value"
2754
- },
2755
- "type": {
2756
- "type": "String"
2757
- },
2758
- "description": "The input data encoded as base64."
2759
- }
2760
- ],
2761
- "description": "Deocde a base64 string to utf-8.",
2762
- "output": {
2763
- "description": "The decoded string.",
2764
- "type": {
2765
- "type": "String"
2766
- }
2767
- }
2768
- },
2769
- "@toddle/findIndex": {
2770
- "name": "Find index",
2771
- "description": "Search through an Array of items and apply a formula to each item, to return the index of the first item where the formula returns True.",
2772
- "arguments": [
2773
- {
2774
- "name": "Array",
2954
+ "name": "Case insensitive",
2775
2955
  "formula": {
2776
2956
  "type": "value",
2777
- "value": null
2957
+ "value": false
2778
2958
  },
2779
- "description": "The array to search.",
2959
+ "description": "Ignore case while attempting a match in a string.",
2780
2960
  "type": {
2781
- "type": "Array"
2961
+ "type": "Boolean"
2782
2962
  }
2783
2963
  },
2784
2964
  {
2785
- "name": "Formula",
2786
- "isFunction": true,
2787
- "formula": {
2788
- "type": "path",
2789
- "path": [
2790
- "Args",
2791
- "item"
2792
- ]
2793
- },
2794
- "description": "The predicate formula that each item in the Array is passed to.",
2795
- "type": {
2796
- "type": "Formula"
2797
- }
2798
- }
2799
- ],
2800
- "output": {
2801
- "description": "The index of the first item in the Array where the predicate formula returns True. Returns -1 if the predicate formula did not return True for any item.",
2802
- "type": {
2803
- "type": "Any"
2804
- }
2805
- }
2806
- },
2807
- "@toddle/currentURL": {
2808
- "name": "Current URL",
2809
- "description": "Return the current URL of the browser. Use the \"Parse URL\" formula for working with the URL.",
2810
- "arguments": [],
2811
- "cache": false,
2812
- "output": {
2813
- "description": "The browser's current URL.",
2814
- "type": {
2815
- "type": "String"
2816
- }
2817
- }
2818
- },
2819
- "@toddle/unique": {
2820
- "name": "Unique",
2821
- "description": "Remove duplicate values from an Array.",
2822
- "arguments": [
2823
- {
2824
- "name": "Array",
2965
+ "name": "Multi line",
2825
2966
  "formula": {
2826
2967
  "type": "value",
2827
- "value": []
2968
+ "value": false
2828
2969
  },
2970
+ "description": "Treat multiline strings as multiple lines.",
2829
2971
  "type": {
2830
- "type": "Array"
2831
- },
2832
- "description": "The input Array."
2972
+ "type": "Boolean"
2973
+ }
2833
2974
  }
2834
2975
  ],
2835
2976
  "output": {
2836
- "description": "The input Array with all duplicate values removed.",
2977
+ "description": "An Array of Strings",
2837
2978
  "type": {
2838
2979
  "type": "Array"
2839
2980
  }
2840
2981
  }
2841
2982
  },
2842
- "@toddle/formatNumber": {
2843
- "name": "Format Number",
2983
+ "@toddle/dateFromString": {
2984
+ "name": "Date From String",
2844
2985
  "arguments": [
2845
2986
  {
2846
- "name": "Input",
2847
- "description": "Number to format.",
2848
- "type": {
2849
- "type": "Number"
2850
- },
2851
- "formula": {
2852
- "type": "Number",
2853
- "value": 100
2854
- }
2855
- },
2856
- {
2857
- "name": "Locale(s)",
2858
- "description": "Optional locale to use for formatting the Number, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
2859
- "type": {
2860
- "type": "String | Array"
2861
- },
2862
- "formula": {
2863
- "type": "value",
2864
- "value": null
2865
- }
2866
- },
2867
- {
2868
- "name": "Options",
2869
- "description": "Optional Object for configuring the formatting of the output. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locale_options for all options.",
2987
+ "name": "Date string",
2988
+ "description": "A String representing a date, for example \"January 1, 1970\".",
2870
2989
  "type": {
2871
- "type": "Object"
2990
+ "type": "String"
2872
2991
  },
2873
2992
  "formula": {
2874
2993
  "type": "value",
2875
- "value": null
2994
+ "value": "January 1, 1970"
2876
2995
  }
2877
2996
  }
2878
2997
  ],
2879
- "description": "Format a Number using the Intl.NumberFormat API. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat for more information.",
2998
+ "description": "Convert a string to a Date.",
2880
2999
  "output": {
2881
- "description": "The Number input formatted as a String.",
3000
+ "description": "The input value converted to a Date.",
2882
3001
  "type": {
2883
- "type": "String"
3002
+ "type": "Date"
2884
3003
  }
2885
3004
  }
2886
3005
  },
@@ -2907,141 +3026,45 @@
2907
3026
  }
2908
3027
  }
2909
3028
  },
2910
- "@toddle/findLast": {
2911
- "name": "Find Last",
2912
- "description": "Search through an Array of items and apply a formula to each item, to return the last item where the formula returns True.",
2913
- "arguments": [
2914
- {
2915
- "name": "Array",
2916
- "formula": {
2917
- "type": "value",
2918
- "value": null
2919
- },
2920
- "description": "The array to search.",
2921
- "type": {
2922
- "type": "Array"
2923
- }
2924
- },
2925
- {
2926
- "name": "Formula",
2927
- "isFunction": true,
2928
- "formula": {
2929
- "type": "path",
2930
- "path": [
2931
- "Args",
2932
- "item"
2933
- ]
2934
- },
2935
- "description": "The predicate formula that each item in the Array is passed to.",
2936
- "type": {
2937
- "type": "Formula"
2938
- }
2939
- }
2940
- ],
2941
- "output": {
2942
- "description": "The last item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
2943
- "type": {
2944
- "type": "Any"
2945
- }
2946
- }
2947
- },
2948
- "@toddle/canShare": {
2949
- "name": "Can Share",
2950
- "description": "Return a Boolean indicating whether the provided data can be shared (with the \"Share\" action).",
2951
- "arguments": [
2952
- {
2953
- "name": "URL",
2954
- "description": "The URL you want to check.",
2955
- "type": {
2956
- "type": "String"
2957
- },
2958
- "formula": {
2959
- "type": "value",
2960
- "value": null
2961
- }
2962
- },
2963
- {
2964
- "name": "Title",
2965
- "description": "The title you want to check.",
2966
- "type": {
2967
- "type": "String"
2968
- },
2969
- "formula": {
2970
- "type": "value",
2971
- "value": null
2972
- }
2973
- },
2974
- {
2975
- "name": "Text",
2976
- "description": "The text you want to check.",
2977
- "type": {
2978
- "type": "String"
2979
- },
2980
- "formula": {
2981
- "type": "value",
2982
- "value": null
2983
- }
2984
- }
2985
- ]
2986
- },
2987
- "@toddle/filter": {
2988
- "name": "Filter",
2989
- "description": "Return a new Array containing only the elements for which the provided formula evaluates to True.",
3029
+ "@toddle/deleteKey": {
3030
+ "name": "Delete",
3031
+ "description": "Return a copy of the input Object or Array without the specified key.",
2990
3032
  "arguments": [
2991
3033
  {
2992
- "name": "Array",
3034
+ "name": "Object",
2993
3035
  "formula": {
2994
3036
  "type": "value",
2995
3037
  "value": null
2996
3038
  },
2997
- "description": "The array of items to be filtered.",
3039
+ "description": "The input record",
2998
3040
  "type": {
2999
- "type": "Array"
3041
+ "type": "Object"
3000
3042
  }
3001
3043
  },
3002
3044
  {
3003
- "name": "Formula",
3004
- "isFunction": true,
3005
- "formula": {
3006
- "type": "path",
3007
- "path": [
3008
- "Args",
3009
- "item"
3010
- ]
3011
- },
3012
- "description": "Predicate formula for filtering items.",
3013
- "type": {
3014
- "type": "Formula"
3015
- }
3016
- }
3017
- ],
3018
- "output": {
3019
- "description": "New Array containing only the items for which the Formula evaluated to True.",
3020
- "type": {
3021
- "type": "Array"
3022
- }
3023
- }
3024
- },
3025
- "@toddle/uppercase": {
3026
- "name": "Uppercase",
3027
- "description": "Convert a String to uppercase.",
3028
- "arguments": [
3029
- {
3030
- "name": "String",
3045
+ "name": "Path",
3031
3046
  "formula": {
3032
3047
  "type": "value",
3033
- "value": "string"
3048
+ "value": "Item"
3034
3049
  },
3035
- "description": "Input String.",
3050
+ "description": "The path can be either a Number (if the first argument is an array), a String, or an Array of strings. If an Array is given, the property at that path will be removed.",
3036
3051
  "type": {
3037
- "type": "String"
3052
+ "type": "Union",
3053
+ "types": [
3054
+ {
3055
+ "type": "Array"
3056
+ },
3057
+ {
3058
+ "type": "String"
3059
+ }
3060
+ ]
3038
3061
  }
3039
3062
  }
3040
3063
  ],
3041
3064
  "output": {
3042
- "description": "The input String with all characters converted to uppercase.",
3065
+ "description": "A copy of the record without the property specified in the Path.",
3043
3066
  "type": {
3044
- "type": "String"
3067
+ "type": "Object"
3045
3068
  }
3046
3069
  }
3047
3070
  },
@@ -3067,44 +3090,38 @@
3067
3090
  "type": "Number"
3068
3091
  }
3069
3092
  }
3070
- },
3071
- "@toddle/parseJSON": {
3072
- "name": "Parse JSON",
3073
- "description": "Parse a String to JSON.",
3093
+ }
3094
+ };
3095
+ export const actions = {
3096
+ "@toddle/copyToClipboard": {
3097
+ "name": "Copy to clipboard",
3098
+ "description": "Copy contents to the clipboard.",
3074
3099
  "arguments": [
3075
3100
  {
3076
- "name": "JSON string",
3077
- "formula": {
3078
- "type": "value",
3079
- "value": null
3080
- },
3081
- "description": "The String to be parsed.",
3101
+ "name": "Value",
3102
+ "description": "The value you want to copy.",
3082
3103
  "type": {
3083
3104
  "type": "String"
3105
+ },
3106
+ "formula": {
3107
+ "type": "value",
3108
+ "value": "<Param Value>"
3084
3109
  }
3085
3110
  }
3086
- ],
3087
- "output": {
3088
- "description": "The parsed JSON value. If the input is not a valid String, this returns Null.",
3089
- "type": {
3090
- "type": "Any"
3091
- }
3092
- }
3093
- }
3094
- };
3095
- export const actions = {
3111
+ ]
3112
+ },
3096
3113
  "@toddle/clearSessionStorage": {
3097
3114
  "name": "Clear Session Storage",
3098
3115
  "description": "Delete all values in session storage.",
3099
3116
  "arguments": []
3100
3117
  },
3101
- "@toddle/saveToSessionStorage": {
3102
- "name": "Save to Session Storage",
3103
- "description": "Save a provided key/value to session storage by JSON encoding the value.",
3118
+ "@toddle/deleteFromSessionStorage": {
3119
+ "name": "Delete from Session Storage",
3120
+ "description": "Delete a value from session storage (if found) based on the provided key.",
3104
3121
  "arguments": [
3105
3122
  {
3106
3123
  "name": "Key",
3107
- "description": "The key to be used in session storage.",
3124
+ "description": "The key in session storage to delete.",
3108
3125
  "type": {
3109
3126
  "type": "String"
3110
3127
  },
@@ -3112,57 +3129,65 @@
3112
3129
  "type": "value",
3113
3130
  "value": ""
3114
3131
  }
3132
+ }
3133
+ ]
3134
+ },
3135
+ "@toddle/logToConsole": {
3136
+ "name": "Log to console",
3137
+ "description": "Log a message to the browser console.",
3138
+ "arguments": [
3139
+ {
3140
+ "name": "Label",
3141
+ "description": "A label for the message.",
3142
+ "formula": {
3143
+ "type": "value",
3144
+ "value": ""
3145
+ }
3115
3146
  },
3116
3147
  {
3117
- "name": "Value",
3118
- "description": "The value that should be saved in session storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3148
+ "name": "Data",
3119
3149
  "type": {
3120
3150
  "type": "Any"
3121
3151
  },
3152
+ "description": "The data you want to log to the console.",
3122
3153
  "formula": {
3123
3154
  "type": "value",
3124
- "value": null
3155
+ "value": "<Data>"
3125
3156
  }
3126
3157
  }
3127
3158
  ]
3128
3159
  },
3129
- "@toddle/copyToClipboard": {
3130
- "name": "Copy to clipboard",
3131
- "description": "Copy contents to the clipboard.",
3160
+ "@toddle/share": {
3161
+ "name": "Share",
3162
+ "description": "Share data with title, text, and/or URL using the Navigator.share API.",
3132
3163
  "arguments": [
3133
3164
  {
3134
- "name": "Value",
3135
- "description": "The value you want to copy.",
3165
+ "name": "URL",
3166
+ "description": "The URL to share.",
3136
3167
  "type": {
3137
3168
  "type": "String"
3138
3169
  },
3139
3170
  "formula": {
3140
3171
  "type": "value",
3141
- "value": "<Param Value>"
3172
+ "value": null
3142
3173
  }
3143
- }
3144
- ]
3145
- },
3146
- "@toddle/saveToLocalStorage": {
3147
- "name": "Save to Local Storage",
3148
- "description": "Save a provided key/value to local storage by JSON encoding the value.",
3149
- "arguments": [
3174
+ },
3150
3175
  {
3151
- "name": "Key",
3152
- "description": "The key to be used in local storage.",
3176
+ "name": "Title",
3177
+ "description": "The title to share.",
3153
3178
  "type": {
3154
3179
  "type": "String"
3155
3180
  },
3156
3181
  "formula": {
3157
3182
  "type": "value",
3158
- "value": ""
3183
+ "value": null
3159
3184
  }
3160
3185
  },
3161
3186
  {
3162
- "name": "Value",
3163
- "description": "The value that should be saved in local storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3187
+ "name": "Text",
3188
+ "description": "The text to share.",
3164
3189
  "type": {
3165
- "type": "Any"
3190
+ "type": "String"
3166
3191
  },
3167
3192
  "formula": {
3168
3193
  "type": "value",
@@ -3171,10 +3196,32 @@
3171
3196
  }
3172
3197
  ]
3173
3198
  },
3174
- "@toddle/stopPropagation": {
3175
- "name": "Stop propagation",
3176
- "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation",
3177
- "description": "Stop the event from bubbling up the DOM to parent elements.",
3199
+ "@toddle/interval": {
3200
+ "name": "Interval",
3201
+ "description": "Run an action every \"delay\" milliseconds.",
3202
+ "arguments": [
3203
+ {
3204
+ "name": "Interval in milliseconds",
3205
+ "description": "The interval \"delay\".",
3206
+ "type": {
3207
+ "type": "Number"
3208
+ },
3209
+ "formula": {
3210
+ "type": "value",
3211
+ "value": 1000
3212
+ }
3213
+ }
3214
+ ],
3215
+ "events": {
3216
+ "tick": {
3217
+ "actions": []
3218
+ }
3219
+ }
3220
+ },
3221
+ "@toddle/preventDefault": {
3222
+ "name": "Prevent default",
3223
+ "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault",
3224
+ "description": "Prevent default browser behavior for this event.",
3178
3225
  "arguments": []
3179
3226
  },
3180
3227
  "@toddle/clearLocalStorage": {
@@ -3182,13 +3229,13 @@
3182
3229
  "description": "Delete all values in local storage.",
3183
3230
  "arguments": []
3184
3231
  },
3185
- "@toddle/deleteFromSessionStorage": {
3186
- "name": "Delete from Session Storage",
3187
- "description": "Delete a value from session storage (if found) based on the provided key.",
3232
+ "@toddle/deleteFromLocalStorage": {
3233
+ "name": "Delete from Local Storage",
3234
+ "description": "Delete a value from local storage (if found) based on the provided key.",
3188
3235
  "arguments": [
3189
3236
  {
3190
3237
  "name": "Key",
3191
- "description": "The key in session storage to delete.",
3238
+ "description": "The key in local storage to delete.",
3192
3239
  "type": {
3193
3240
  "type": "String"
3194
3241
  },
@@ -3199,37 +3246,26 @@
3199
3246
  }
3200
3247
  ]
3201
3248
  },
3202
- "@toddle/share": {
3203
- "name": "Share",
3204
- "description": "Share data with title, text, and/or URL using the Navigator.share API.",
3249
+ "@toddle/saveToLocalStorage": {
3250
+ "name": "Save to Local Storage",
3251
+ "description": "Save a provided key/value to local storage by JSON encoding the value.",
3205
3252
  "arguments": [
3206
3253
  {
3207
- "name": "URL",
3208
- "description": "The URL to share.",
3209
- "type": {
3210
- "type": "String"
3211
- },
3212
- "formula": {
3213
- "type": "value",
3214
- "value": null
3215
- }
3216
- },
3217
- {
3218
- "name": "Title",
3219
- "description": "The title to share.",
3254
+ "name": "Key",
3255
+ "description": "The key to be used in local storage.",
3220
3256
  "type": {
3221
3257
  "type": "String"
3222
3258
  },
3223
3259
  "formula": {
3224
3260
  "type": "value",
3225
- "value": null
3261
+ "value": ""
3226
3262
  }
3227
3263
  },
3228
3264
  {
3229
- "name": "Text",
3230
- "description": "The text to share.",
3265
+ "name": "Value",
3266
+ "description": "The value that should be saved in local storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3231
3267
  "type": {
3232
- "type": "String"
3268
+ "type": "Any"
3233
3269
  },
3234
3270
  "formula": {
3235
3271
  "type": "value",
@@ -3238,53 +3274,34 @@
3238
3274
  }
3239
3275
  ]
3240
3276
  },
3241
- "@toddle/logToConsole": {
3242
- "name": "Log to console",
3243
- "description": "Log a message to the browser console.",
3277
+ "@toddle/saveToSessionStorage": {
3278
+ "name": "Save to Session Storage",
3279
+ "description": "Save a provided key/value to session storage by JSON encoding the value.",
3244
3280
  "arguments": [
3245
3281
  {
3246
- "name": "Label",
3247
- "description": "A label for the message.",
3282
+ "name": "Key",
3283
+ "description": "The key to be used in session storage.",
3284
+ "type": {
3285
+ "type": "String"
3286
+ },
3248
3287
  "formula": {
3249
3288
  "type": "value",
3250
3289
  "value": ""
3251
3290
  }
3252
3291
  },
3253
3292
  {
3254
- "name": "Data",
3293
+ "name": "Value",
3294
+ "description": "The value that should be saved in session storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3255
3295
  "type": {
3256
3296
  "type": "Any"
3257
3297
  },
3258
- "description": "The data you want to log to the console.",
3259
3298
  "formula": {
3260
3299
  "type": "value",
3261
- "value": "<Data>"
3300
+ "value": null
3262
3301
  }
3263
3302
  }
3264
3303
  ]
3265
3304
  },
3266
- "@toddle/sleep": {
3267
- "name": "Sleep",
3268
- "description": "Run an action after a delay.",
3269
- "arguments": [
3270
- {
3271
- "name": "Delay in milliseconds",
3272
- "description": "The number of milliseconds to wait before an action is executed.",
3273
- "type": {
3274
- "type": "Number"
3275
- },
3276
- "formula": {
3277
- "type": "value",
3278
- "value": 500
3279
- }
3280
- }
3281
- ],
3282
- "events": {
3283
- "tick": {
3284
- "actions": []
3285
- }
3286
- }
3287
- },
3288
3305
  "@toddle/setSessionCookies": {
3289
3306
  "name": "Set session cookies",
3290
3307
  "description": "Save authentication tokens as session cookies.",
@@ -3323,36 +3340,19 @@
3323
3340
  }
3324
3341
  }
3325
3342
  },
3326
- "@toddle/deleteFromLocalStorage": {
3327
- "name": "Delete from Local Storage",
3328
- "description": "Delete a value from local storage (if found) based on the provided key.",
3329
- "arguments": [
3330
- {
3331
- "name": "Key",
3332
- "description": "The key in local storage to delete.",
3333
- "type": {
3334
- "type": "String"
3335
- },
3336
- "formula": {
3337
- "type": "value",
3338
- "value": ""
3339
- }
3340
- }
3341
- ]
3342
- },
3343
- "@toddle/interval": {
3344
- "name": "Interval",
3345
- "description": "Run an action every \"delay\" milliseconds.",
3343
+ "@toddle/sleep": {
3344
+ "name": "Sleep",
3345
+ "description": "Run an action after a delay.",
3346
3346
  "arguments": [
3347
3347
  {
3348
- "name": "Interval in milliseconds",
3349
- "description": "The interval \"delay\".",
3348
+ "name": "Delay in milliseconds",
3349
+ "description": "The number of milliseconds to wait before an action is executed.",
3350
3350
  "type": {
3351
3351
  "type": "Number"
3352
3352
  },
3353
3353
  "formula": {
3354
3354
  "type": "value",
3355
- "value": 1000
3355
+ "value": 500
3356
3356
  }
3357
3357
  }
3358
3358
  ],
@@ -3362,12 +3362,6 @@
3362
3362
  }
3363
3363
  }
3364
3364
  },
3365
- "@toddle/preventDefault": {
3366
- "name": "Prevent default",
3367
- "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault",
3368
- "description": "Prevent default browser behavior for this event.",
3369
- "arguments": []
3370
- },
3371
3365
  "@toddle/gotToURL": {
3372
3366
  "name": "Go to URL",
3373
3367
  "description": "Navigate to a specified URL.",
@@ -3401,5 +3395,11 @@
3401
3395
  }
3402
3396
  }
3403
3397
  ]
3398
+ },
3399
+ "@toddle/stopPropagation": {
3400
+ "name": "Stop propagation",
3401
+ "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation",
3402
+ "description": "Stop the event from bubbling up the DOM to parent elements.",
3403
+ "arguments": []
3404
3404
  }
3405
3405
  };