-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataset.json
2410 lines (2410 loc) · 186 KB
/
dataset.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
[
{
"prompt": "Fetch data from URL\n\n###\n\n",
"completion": " GET Request | url,headers,params | data | IMPLICIT | NONE\n({ url, headers, params }, { data }) => {\n return axios\n .get(url, { headers, params })\n .then((res) => data.next(res.data));\n }###"
},
{
"prompt": "HTTP GET request\n\n###\n\n",
"completion": " GET Request | url,headers,params | data | IMPLICIT | NONE\nfunction (inputData, outputData, adv) {\n const { url, headers, params } = inputData;\n const { data } = outputData;\n\n fetch(url, { headers, params })\n .then((response) => response.json())\n .then((responseData) => data.next(responseData));\n}###"
},
{
"prompt": "Retrieve data from URL\n\n###\n\n",
"completion": " GET Request | url,headers,params | data | IMPLICIT | NONE\n({ url, headers, params }, { data }) => {\n return axios\n .get(url, { headers, params })\n .then((res) => data.next(res.data));\n }###"
},
{
"prompt": "Get data from URL\n\n###\n\n",
"completion": " GET Request | url,headers,params | data | IMPLICIT | NONE\nfunction (inputData, outputData, adv) {\n const { url, headers, params } = inputData;\n const { data } = outputData;\n\n fetch(url, { headers, params })\n .then((response) => response.json())\n .then((responseData) => data.next(responseData));\n}###"
},
{
"prompt": "Send HTTP POST requests\n\n###\n\n",
"completion": " POST Request | url,headers,params,data | data | IMPLICIT | NONE\n({ url, headers, params, data: body }, { data }) => {\n const config: AxiosRequestConfig = { headers, params };\n return axios.post(url, body, config).then((res) => data.next(res.data));\n }###"
},
{
"prompt": "HTTP POST Request\n\n###\n\n",
"completion": " POST Request | url,headers,params,data | data | IMPLICIT | NONE\nfunction ({ url: endpoint, headers: requestHeaders, params: queryParams, data: body }, { data: response }) {\n const config: AxiosRequestConfig = { headers: requestHeaders, params: queryParams };\n return axios.post(endpoint, body, config).then((res) => response.next(res.data));\n}###"
},
{
"prompt": "Part that sends data via HTTP POST\n\n###\n\n",
"completion": " POST Request | url,headers,params,data | data | IMPLICIT | NONE\n({ url, headers, params, data: body }, { data }) => {\n const config: AxiosRequestConfig = { headers, params };\n return axios.post(url, body, config).then((res) => data.next(res.data));\n }###"
},
{
"prompt": "Send data via HTTP POST\n\n###\n\n",
"completion": " POST Request | url,headers,params,data | data | IMPLICIT | NONE\nfunction ({ url: endpoint, headers: requestHeaders, params: queryParams, data: body }, { data: response }) {\n const config: AxiosRequestConfig = { headers: requestHeaders, params: queryParams };\n return axios.post(endpoint, body, config).then((res) => response.next(res.data));\n}###"
},
{
"prompt": "Update data with PUT request\n\n###\n\n",
"completion": " PUT Request | url,headers,params,data | data | IMPLICIT | NONE\n({ url, headers, params, data: body }, { data }) => {\n const config: AxiosRequestConfig = { headers, params };\n return axios.put(url, body, config).then((res) => data.next(res.data));\n }###"
},
{
"prompt": "Send PUT request to URL\n\n###\n\n",
"completion": " PUT Request | url,headers,params,data | data | IMPLICIT | NONE\nfunction ({ url: endpoint, headers: requestHeaders, params: queryParams, data: body }, { data: result }, adv) {\n const config: AxiosRequestConfig = { headers: requestHeaders, params: queryParams };\n return axios.put(endpoint, body, config).then((res) => result.next(res.data));\n }###"
},
{
"prompt": "Update data using PUT method\n\n###\n\n",
"completion": " PUT Request | url,headers,params,data | data | IMPLICIT | NONE\n({ url, headers, params, data: body }, { data }) => {\n const config: AxiosRequestConfig = { headers, params };\n return axios.put(url, body, config).then((res) => data.next(res.data));\n }###"
},
{
"prompt": "Update data with PUT method to specified URL\n\n###\n\n",
"completion": " PUT Request | url,headers,params,data | data | IMPLICIT | NONE\nfunction ({ url: endpoint, headers: requestHeaders, params: queryParams, data: body }, { data: result }, adv) {\n const config: AxiosRequestConfig = { headers: requestHeaders, params: queryParams };\n return axios.put(endpoint, body, config).then((res) => result.next(res.data));\n }###"
},
{
"prompt": "HTTP Request Sender\n\n###\n\n",
"completion": " Request | url,method,headers,params,data | data | IMPLICIT | NONE\n({ url, method, headers, params, data: body }, { data }) => {\n const config: AxiosRequestConfig = { method, headers, params };\n return axios\n .request({ url, data: body, ...config })\n .then((res) => data.next(res.data));\n }###"
},
{
"prompt": "Send HTTP Request\n\n###\n\n",
"completion": " Request | url,method,headers,params,data | data | IMPLICIT | NONE\nfunction (request, response, state) {\n const { url, method, headers, params, data: body } = request;\n const { data } = response;\n\n const config: AxiosRequestConfig = { method, headers, params };\n return axios\n .request({ url, data: body, ...config })\n .then((res) => data.next(res.data));\n}###"
},
{
"prompt": "HTTP Request with Axios\n\n###\n\n",
"completion": " Request | url,method,headers,params,data | data | IMPLICIT | NONE\n({ url, method, headers, params, data: body }, { data }) => {\n const config: AxiosRequestConfig = { method, headers, params };\n return axios\n .request({ url, data: body, ...config })\n .then((res) => data.next(res.data));\n }###"
},
{
"prompt": "Send HTTP Request with Axios\n\n###\n\n",
"completion": " Request | url,method,headers,params,data | data | IMPLICIT | NONE\nfunction (request, response, state) {\n const { url, method, headers, params, data: body } = request;\n const { data } = response;\n\n const config: AxiosRequestConfig = { method, headers, params };\n return axios\n .request({ url, data: body, ...config })\n .then((res) => data.next(res.data));\n}###"
},
{
"prompt": "Convert object to JSON string\n\n###\n\n",
"completion": " JSON Stringify | object | json | IMPLICIT | NONE\n({ object }, { json }) => json.next(JSON.stringify(object))###"
},
{
"prompt": "Create JSON string from object\n\n###\n\n",
"completion": " JSON Stringify | object | json | IMPLICIT | NONE\nfunction ({ inputObject }, { outputJSON }) {\n const jsonString = JSON.stringify(inputObject);\n outputJSON.next(jsonString);\n}###"
},
{
"prompt": "JSON stringifier\n\n###\n\n",
"completion": " JSON Stringify | object | json | IMPLICIT | NONE\n({ object }, { json }) => json.next(JSON.stringify(object))###"
},
{
"prompt": "Object to JSON converter\n\n###\n\n",
"completion": " JSON Stringify | object | json | IMPLICIT | NONE\nfunction ({ inputObject }, { outputJSON }) {\n const jsonString = JSON.stringify(inputObject);\n outputJSON.next(jsonString);\n}###"
},
{
"prompt": "Extract object keys\n\n###\n\n",
"completion": " Keys | object | keys | IMPLICIT | NONE\n({ object }, { keys }) => keys.next(Object.keys(object))###"
},
{
"prompt": "Get keys from object\n\n###\n\n",
"completion": " Keys | object | keys | IMPLICIT | NONE\nfunction (inputObj, outputKeys) {\n const { object } = inputObj;\n const { keys } = outputKeys;\n const objectKeys = Object.keys(object);\n keys.next(objectKeys);\n}###"
},
{
"prompt": "List object keys\n\n###\n\n",
"completion": " Keys | object | keys | IMPLICIT | NONE\n({ object }, { keys }) => keys.next(Object.keys(object))###"
},
{
"prompt": "Retrieve keys from object\n\n###\n\n",
"completion": " Keys | object | keys | IMPLICIT | NONE\nfunction (inputObj, outputKeys) {\n const { object } = inputObj;\n const { keys } = outputKeys;\n const objectKeys = Object.keys(object);\n keys.next(objectKeys);\n}###"
},
{
"prompt": "Extract values from object\n\n###\n\n",
"completion": " Values | object | values | IMPLICIT | NONE\n({ object }, { values }) => values.next(Object.values(object))###"
},
{
"prompt": "Get values from object\n\n###\n\n",
"completion": " Values | object | values | IMPLICIT | NONE\nfunction (inputObj, outputValues) {\n const { input } = inputObj;\n const { output } = outputValues;\n const valuesArr = Object.values(input);\n output.next(valuesArr);\n}###"
},
{
"prompt": "Extract object values\n\n###\n\n",
"completion": " Values | object | values | IMPLICIT | NONE\n({ object }, { values }) => values.next(Object.values(object))###"
},
{
"prompt": "Get object values\n\n###\n\n",
"completion": " Values | object | values | IMPLICIT | NONE\nfunction (inputObj, outputValues) {\n const { input } = inputObj;\n const { output } = outputValues;\n const valuesArr = Object.values(input);\n output.next(valuesArr);\n}###"
},
{
"prompt": "Extract object entries\n\n###\n\n",
"completion": " Entries | object | entries | IMPLICIT | NONE\n({ object }, { entries }) => entries.next(Object.entries(object))###"
},
{
"prompt": "Convert object to entries\n\n###\n\n",
"completion": " Entries | object | entries | IMPLICIT | NONE\nfunction (inputObj, outputEntries) {\n const { object } = inputObj;\n const { entries } = outputEntries;\n const objectEntries = Object.entries(object);\n entries.next(objectEntries);\n}###"
},
{
"prompt": "Get object key-value pairs\n\n###\n\n",
"completion": " Entries | object | entries | IMPLICIT | NONE\n({ object }, { entries }) => entries.next(Object.entries(object))###"
},
{
"prompt": "Create entries from object\n\n###\n\n",
"completion": " Entries | object | entries | IMPLICIT | NONE\nfunction (inputObj, outputEntries) {\n const { object } = inputObj;\n const { entries } = outputEntries;\n const objectEntries = Object.entries(object);\n entries.next(objectEntries);\n}###"
},
{
"prompt": "Create object from entries\n\n###\n\n",
"completion": " From Entries | entries | object | IMPLICIT | NONE\n({ entries }, { object }) => object.next(Object.fromEntries(entries))###"
},
{
"prompt": "Convert entries to object\n\n###\n\n",
"completion": " From Entries | entries | object | IMPLICIT | NONE\nfunction (inputData, outputData) {\n const { entries } = inputData;\n const { object } = outputData;\n\n const result = {};\n for (const [key, value] of entries) {\n result[key] = value;\n }\n object.next(result);\n}###"
},
{
"prompt": "Entries to object converter\n\n###\n\n",
"completion": " From Entries | entries | object | IMPLICIT | NONE\n({ entries }, { object }) => object.next(Object.fromEntries(entries))###"
},
{
"prompt": "Part that transforms entries to object\n\n###\n\n",
"completion": " From Entries | entries | object | IMPLICIT | NONE\nfunction (inputData, outputData) {\n const { entries } = inputData;\n const { object } = outputData;\n\n const result = {};\n for (const [key, value] of entries) {\n result[key] = value;\n }\n object.next(result);\n}###"
},
{
"prompt": "Combine objects\n\n###\n\n",
"completion": " Assign | target,sources | object | IMPLICIT | NONE\n({ target, sources }, { object }) =>\n object.next(Object.assign(target, ...sources))###"
},
{
"prompt": "Merge objects together\n\n###\n\n",
"completion": " Assign | target,sources | object | IMPLICIT | NONE\nfunction (inputs, outputs, adv) {\n const { target, sources } = inputs;\n const { object } = outputs;\n\n const newObj = Object.assign(target, ...sources);\n object.next(newObj);\n}###"
},
{
"prompt": "Combine multiple objects into one\n\n###\n\n",
"completion": " Assign | target,sources | object | IMPLICIT | NONE\n({ target, sources }, { object }) =>\n object.next(Object.assign(target, ...sources))###"
},
{
"prompt": "Assign values from multiple objects\n\n###\n\n",
"completion": " Assign | target,sources | object | IMPLICIT | NONE\nfunction (inputs, outputs, adv) {\n const { target, sources } = inputs;\n const { object } = outputs;\n\n const newObj = Object.assign(target, ...sources);\n object.next(newObj);\n}###"
},
{
"prompt": "Get value from object attribute\n\n###\n\n",
"completion": " Get Attribute | object,attribute | value | IMPLICIT | NONE\n({ object, attribute }, { value }) =>\n value.next(attribute.split(\".\").reduce((obj, i) => obj[i], object))###"
},
{
"prompt": "Extract value from object\n\n###\n\n",
"completion": " Get Attribute | object,attribute | value | IMPLICIT | NONE\nfunction (inputObj, outputObj, adv) {\n const { obj, attr } = inputObj;\n const { val } = outputObj;\n const attributeArray = attr.split('.');\n let value = obj;\n for (let i = 0; i < attributeArray.length; i++) {\n value = value[attributeArray[i]];\n }\n val.next(value);\n}###"
},
{
"prompt": "Get attribute value\n\n###\n\n",
"completion": " Get Attribute | object,attribute | value | IMPLICIT | NONE\n({ object, attribute }, { value }) =>\n value.next(attribute.split(\".\").reduce((obj, i) => obj[i], object))###"
},
{
"prompt": "Retrieve value from object attribute\n\n###\n\n",
"completion": " Get Attribute | object,attribute | value | IMPLICIT | NONE\nfunction (inputObj, outputObj, adv) {\n const { obj, attr } = inputObj;\n const { val } = outputObj;\n const attributeArray = attr.split('.');\n let value = obj;\n for (let i = 0; i < attributeArray.length; i++) {\n value = value[attributeArray[i]];\n }\n val.next(value);\n}###"
},
{
"prompt": "Set object attribute value\n\n###\n\n",
"completion": " Set Attribute | object,attribute,value | object | IMPLICIT | NONE\n({ object, attribute, value }, { object: outputObject }) => {\n const attributes = attribute.split(\".\");\n const last = attributes.pop();\n const target = attributes.reduce((obj, i) => obj[i], object);\n target[last] = value;\n return outputObject.next(object);\n }###"
},
{
"prompt": "Change object attribute\n\n###\n\n",
"completion": " Set Attribute | object,attribute,value | object | IMPLICIT | NONE\nfunction ({ inputObject, attributeName, attributeValue }, { outputObject }) {\n inputObject[attributeName] = attributeValue;\n outputObject.next(inputObject);\n}###"
},
{
"prompt": "Update object attribute\n\n###\n\n",
"completion": " Set Attribute | object,attribute,value | object | IMPLICIT | NONE\n({ object, attribute, value }, { object: outputObject }) => {\n const attributes = attribute.split(\".\");\n const last = attributes.pop();\n const target = attributes.reduce((obj, i) => obj[i], object);\n target[last] = value;\n return outputObject.next(object);\n }###"
},
{
"prompt": "Modify object attribute\n\n###\n\n",
"completion": " Set Attribute | object,attribute,value | object | IMPLICIT | NONE\nfunction ({ inputObject, attributeName, attributeValue }, { outputObject }) {\n inputObject[attributeName] = attributeValue;\n outputObject.next(inputObject);\n}###"
},
{
"prompt": "Remove object attribute\n\n###\n\n",
"completion": " Delete Attribute | object,attribute | object | IMPLICIT | NONE\n({ object, attribute }, { object: outputObject }) => {\n // delete attribute from object while supporting dot notation\n const attributes = attribute.value.split(\".\");\n const last = attributes.pop();\n const target = attributes.reduce((obj, i) => obj[i], object.value);\n delete target[last];\n outputObject.next(object.value);\n }###"
},
{
"prompt": "Delete object property\n\n###\n\n",
"completion": " Delete Attribute | object,attribute | object | IMPLICIT | NONE\nfunction ({ obj, attr }, { obj: outputObj }) {\n const { [attr]: _, ...rest } = obj.value;\n outputObj.next(rest);\n}###"
},
{
"prompt": "Remove property from object\n\n###\n\n",
"completion": " Delete Attribute | object,attribute | object | IMPLICIT | NONE\n({ object, attribute }, { object: outputObject }) => {\n // delete attribute from object while supporting dot notation\n const attributes = attribute.value.split(\".\");\n const last = attributes.pop();\n const target = attributes.reduce((obj, i) => obj[i], object.value);\n delete target[last];\n outputObject.next(object.value);\n }###"
},
{
"prompt": "Delete object attribute using dot notation\n\n###\n\n",
"completion": " Delete Attribute | object,attribute | object | IMPLICIT | NONE\nfunction ({ obj, attr }, { obj: outputObj }) {\n const { [attr]: _, ...rest } = obj.value;\n outputObj.next(rest);\n}###"
},
{
"prompt": "Check if object attribute equals value\n\n###\n\n",
"completion": " Property Equals | object,attribute,value | true,false | IMPLICIT | NONE\n(inputs, outputs) => {\n // get attribute from object while supporting dot notation\n const value = inputs.attribute\n .split(\".\")\n .reduce((obj, i) => obj[i], inputs.object);\n if (value === inputs.value) {\n outputs.true.next(inputs.object);\n } else {\n outputs.false.next(inputs.object);\n }\n }###"
},
{
"prompt": "Compare object attribute to value\n\n###\n\n",
"completion": " Property Equals | object,attribute,value | true,false | IMPLICIT | NONE\nfunction (inputObj, outputObj) {\n const { obj, attr, val } = inputObj;\n const { trueOutput, falseOutput } = outputObj;\n const attributeValue = attr.split('.').reduce((obj, i) => obj[i], obj);\n if (attributeValue === val) {\n trueOutput.next(obj);\n } else {\n falseOutput.next(obj);\n }\n}###"
},
{
"prompt": "Object attribute value checker\n\n###\n\n",
"completion": " Property Equals | object,attribute,value | true,false | IMPLICIT | NONE\n(inputs, outputs) => {\n // get attribute from object while supporting dot notation\n const value = inputs.attribute\n .split(\".\")\n .reduce((obj, i) => obj[i], inputs.object);\n if (value === inputs.value) {\n outputs.true.next(inputs.object);\n } else {\n outputs.false.next(inputs.object);\n }\n }###"
},
{
"prompt": "Object attribute value comparison\n\n###\n\n",
"completion": " Property Equals | object,attribute,value | true,false | IMPLICIT | NONE\nfunction (inputObj, outputObj) {\n const { obj, attr, val } = inputObj;\n const { trueOutput, falseOutput } = outputObj;\n const attributeValue = attr.split('.').reduce((obj, i) => obj[i], obj);\n if (attributeValue === val) {\n trueOutput.next(obj);\n } else {\n falseOutput.next(obj);\n }\n}###"
},
{
"prompt": "Subtract two numbers\n\n###\n\n",
"completion": " Subtract | n1,n2 | difference | IMPLICIT | NONE\n({ n1, n2 }, { difference }) => difference.next(n1 - n2)###"
},
{
"prompt": "Calculate difference between two numbers\n\n###\n\n",
"completion": " Subtract | n1,n2 | difference | IMPLICIT | NONE\nfunction ({ num1, num2 }, { result }) { result.next(num1 - num2); }###"
},
{
"prompt": "Simple subtraction\n\n###\n\n",
"completion": " Subtract | n1,n2 | difference | IMPLICIT | NONE\n({ n1, n2 }, { difference }) => difference.next(n1 - n2)###"
},
{
"prompt": "Subtract values\n\n###\n\n",
"completion": " Subtract | n1,n2 | difference | IMPLICIT | NONE\nfunction ({ num1, num2 }, { result }) { result.next(num1 - num2); }###"
},
{
"prompt": "Multiply two numbers\n\n###\n\n",
"completion": " Multiply | n1,n2 | product | IMPLICIT | NONE\n({ n1, n2 }, { product }) => product.next(n1 * n2)###"
},
{
"prompt": "Calculate product of two numbers\n\n###\n\n",
"completion": " Multiply | n1,n2 | product | IMPLICIT | NONE\nfunction ({ num1, num2 }, { result }) { result.next(num1 * num2); }###"
},
{
"prompt": "Simple multiplication\n\n###\n\n",
"completion": " Multiply | n1,n2 | product | IMPLICIT | NONE\n({ n1, n2 }, { product }) => product.next(n1 * n2)###"
},
{
"prompt": "Multiply inputs to get product\n\n###\n\n",
"completion": " Multiply | n1,n2 | product | IMPLICIT | NONE\nfunction ({ num1, num2 }, { result }) { result.next(num1 * num2); }###"
},
{
"prompt": "Divide two numbers\n\n###\n\n",
"completion": " Divide | n1,n2 | quotient | IMPLICIT | NONE\n({ n1, n2 }, { quotient }) => quotient.next(n1 / n2)###"
},
{
"prompt": "Calculate quotient of two numbers\n\n###\n\n",
"completion": " Divide | n1,n2 | quotient | IMPLICIT | NONE\nfunction ({ dividend, divisor }, { quotient }) { quotient.next(dividend / divisor); }###"
},
{
"prompt": "Part that divides two numbers\n\n###\n\n",
"completion": " Divide | n1,n2 | quotient | IMPLICIT | NONE\n({ n1, n2 }, { quotient }) => quotient.next(n1 / n2)###"
},
{
"prompt": "A node that outputs the quotient of two numbers\n\n###\n\n",
"completion": " Divide | n1,n2 | quotient | IMPLICIT | NONE\nfunction ({ dividend, divisor }, { quotient }) { quotient.next(dividend / divisor); }###"
},
{
"prompt": "Calculate remainder of division\n\n###\n\n",
"completion": " Modulo | n1,n2 | remainder | IMPLICIT | NONE\n({ n1, n2 }, { remainder }) => remainder.next(n1 % n2)###"
},
{
"prompt": "Modulo operation\n\n###\n\n",
"completion": " Modulo | n1,n2 | remainder | IMPLICIT | NONE\nfunction ({ dividend, divisor }, { remainder }) {\n remainder.next(dividend % divisor);\n}###"
},
{
"prompt": "Calculate remainder\n\n###\n\n",
"completion": " Modulo | n1,n2 | remainder | IMPLICIT | NONE\n({ n1, n2 }, { remainder }) => remainder.next(n1 % n2)###"
},
{
"prompt": "Calculate power of two numbers\n\n###\n\n",
"completion": " Power | n1,n2 | power | IMPLICIT | NONE\n({ n1, n2 }, { power }) => power.next(Math.pow(n1, n2))###"
},
{
"prompt": "Calculate exponentiation\n\n###\n\n",
"completion": " Power | n1,n2 | power | IMPLICIT | NONE\nfunction ({ base, exponent }, { result }) {\n result.next(Math.pow(base, exponent));\n}###"
},
{
"prompt": "Calculate n1 to the power of n2\n\n###\n\n",
"completion": " Power | n1,n2 | power | IMPLICIT | NONE\n({ n1, n2 }, { power }) => power.next(Math.pow(n1, n2))###"
},
{
"prompt": "Calculate the result of n1 raised to the power of n2\n\n###\n\n",
"completion": " Power | n1,n2 | power | IMPLICIT | NONE\nfunction ({ base, exponent }, { result }) {\n result.next(Math.pow(base, exponent));\n}###"
},
{
"prompt": "Calculate square root\n\n###\n\n",
"completion": " Square Root | n | root | IMPLICIT | NONE\n({ n }, { root }) => root.next(Math.sqrt(n))###"
},
{
"prompt": "Find root of a number\n\n###\n\n",
"completion": " Square Root | n | root | IMPLICIT | NONE\nfunction ({ number }, { result }) {\n return result.next(Math.sqrt(number));\n}###"
},
{
"prompt": "Calculate the square root of a number\n\n###\n\n",
"completion": " Square Root | n | root | IMPLICIT | NONE\n({ n }, { root }) => root.next(Math.sqrt(n))###"
},
{
"prompt": "Get the square root of a number\n\n###\n\n",
"completion": " Square Root | n | root | IMPLICIT | NONE\nfunction ({ number }, { result }) {\n return result.next(Math.sqrt(number));\n}###"
},
{
"prompt": "Calculate absolute value\n\n###\n\n",
"completion": " Absolute Value | n | absolute | IMPLICIT | NONE\n({ n }, { absolute }) => absolute.next(Math.abs(n))###"
},
{
"prompt": "Get absolute value of a number\n\n###\n\n",
"completion": " Absolute Value | n | absolute | IMPLICIT | NONE\nfunction (input, output) {\n const { n } = input;\n const { absolute } = output;\n absolute.next(Math.abs(n));\n}###"
},
{
"prompt": "Part that returns the absolute value\n\n###\n\n",
"completion": " Absolute Value | n | absolute | IMPLICIT | NONE\n({ n }, { absolute }) => absolute.next(Math.abs(n))###"
},
{
"prompt": "A node that outputs the absolute value of an input\n\n###\n\n",
"completion": " Absolute Value | n | absolute | IMPLICIT | NONE\nfunction (input, output) {\n const { n } = input;\n const { absolute } = output;\n absolute.next(Math.abs(n));\n}###"
},
{
"prompt": "Round down number\n\n###\n\n",
"completion": " Floor | n | floor | IMPLICIT | NONE\n({ n }, { floor }) => floor.next(Math.floor(n))###"
},
{
"prompt": "Calculate floor value\n\n###\n\n",
"completion": " Floor | n | floor | IMPLICIT | NONE\nfunction ({ inputNumber }, { outputFloor }) {\n outputFloor.next(Math.floor(inputNumber));\n}###"
},
{
"prompt": "Get integer part of number\n\n###\n\n",
"completion": " Floor | n | floor | IMPLICIT | NONE\n({ n }, { floor }) => floor.next(Math.floor(n))###"
},
{
"prompt": "Find the largest integer less than or equal to a number\n\n###\n\n",
"completion": " Floor | n | floor | IMPLICIT | NONE\nfunction ({ inputNumber }, { outputFloor }) {\n outputFloor.next(Math.floor(inputNumber));\n}###"
},
{
"prompt": "Round up number\n\n###\n\n",
"completion": " Ceiling | n | ceiling | IMPLICIT | NONE\n({ n }, { ceiling }) => ceiling.next(Math.ceil(n))###"
},
{
"prompt": "Calculate ceiling\n\n###\n\n",
"completion": " Ceiling | n | ceiling | IMPLICIT | NONE\nfunction ({ inputNumber }, { outputCeiling }) {\n const { inputNumber } = inputs;\n const { outputCeiling } = outputs;\n outputCeiling.next(Math.ceil(inputNumber));\n}###"
},
{
"prompt": "Get integer ceiling\n\n###\n\n",
"completion": " Ceiling | n | ceiling | IMPLICIT | NONE\n({ n }, { ceiling }) => ceiling.next(Math.ceil(n))###"
},
{
"prompt": "Get rounded up value\n\n###\n\n",
"completion": " Ceiling | n | ceiling | IMPLICIT | NONE\nfunction ({ inputNumber }, { outputCeiling }) {\n const { inputNumber } = inputs;\n const { outputCeiling } = outputs;\n outputCeiling.next(Math.ceil(inputNumber));\n}###"
},
{
"prompt": "Shorten Number\n\n###\n\n",
"completion": " Truncate | n | truncated | IMPLICIT | NONE\n({ n }, { truncated }) => truncated.next(Math.trunc(n))###"
},
{
"prompt": "Truncate Decimal\n\n###\n\n",
"completion": " Truncate | n | truncated | IMPLICIT | NONE\nfunction ({ number }, { truncated }) {truncated.next(Math.trunc(number))}###"
},
{
"prompt": "Remove Decimal Places\n\n###\n\n",
"completion": " Truncate | n | truncated | IMPLICIT | NONE\n({ n }, { truncated }) => truncated.next(Math.trunc(n))###"
},
{
"prompt": "Round Down\n\n###\n\n",
"completion": " Truncate | n | truncated | IMPLICIT | NONE\nfunction ({ number }, { truncated }) {truncated.next(Math.trunc(number))}###"
},
{
"prompt": "Calculate sine of an angle\n\n###\n\n",
"completion": " Sin | angle | sine | IMPLICIT | NONE\n({ angle }, { sine }) => sine.next(Math.sin(angle))###"
},
{
"prompt": "Sine calculator\n\n###\n\n",
"completion": " Sin | angle | sine | IMPLICIT | NONE\nfunction (input, output) {\n const { angle } = input;\n const { sine } = output;\n sine.next(Math.sin(angle));\n}###"
},
{
"prompt": "Calculate the sine value\n\n###\n\n",
"completion": " Sin | angle | sine | IMPLICIT | NONE\n({ angle }, { sine }) => sine.next(Math.sin(angle))###"
},
{
"prompt": "Get the sine of an angle\n\n###\n\n",
"completion": " Sin | angle | sine | IMPLICIT | NONE\nfunction (input, output) {\n const { angle } = input;\n const { sine } = output;\n sine.next(Math.sin(angle));\n}###"
},
{
"prompt": "Calculate cosine of an angle\n\n###\n\n",
"completion": " Cos | angle | cosine | IMPLICIT | NONE\n({ angle }, { cosine }) => cosine.next(Math.cos(angle))###"
},
{
"prompt": "Calculate the cosine value\n\n###\n\n",
"completion": " Cos | angle | cosine | IMPLICIT | NONE\nfunction ({ angleInput }, { cosineOutput }) {\n const { angle } = angleInput;\n const { cosine } = cosineOutput;\n cosine.next(Math.cos(angle));\n}###"
},
{
"prompt": "Part that calculates cosine\n\n###\n\n",
"completion": " Cos | angle | cosine | IMPLICIT | NONE\n({ angle }, { cosine }) => cosine.next(Math.cos(angle))###"
},
{
"prompt": "Calculate the cosine of an angle in radians\n\n###\n\n",
"completion": " Cos | angle | cosine | IMPLICIT | NONE\nfunction ({ angleInput }, { cosineOutput }) {\n const { angle } = angleInput;\n const { cosine } = cosineOutput;\n cosine.next(Math.cos(angle));\n}###"
},
{
"prompt": "Find minimum value\n\n###\n\n",
"completion": " Min | n1,n2 | min | IMPLICIT | NONE\n({ n1, n2 }, { min }) => min.next(Math.min(n1, n2))###"
},
{
"prompt": "Calculate minimum\n\n###\n\n",
"completion": " Min | n1,n2 | min | IMPLICIT | NONE\nfunction (inputs, outputs, adv) {\n const { num1, num2 } = inputs;\n const { minimum } = outputs;\n \n const newMinimum = Math.min(num1, num2);\n minimum.next(newMinimum);\n}###"
},
{
"prompt": "Get smallest number\n\n###\n\n",
"completion": " Min | n1,n2 | min | IMPLICIT | NONE\n({ n1, n2 }, { min }) => min.next(Math.min(n1, n2))###"
},
{
"prompt": "Determine the minimum value\n\n###\n\n",
"completion": " Min | n1,n2 | min | IMPLICIT | NONE\nfunction (inputs, outputs, adv) {\n const { num1, num2 } = inputs;\n const { minimum } = outputs;\n \n const newMinimum = Math.min(num1, num2);\n minimum.next(newMinimum);\n}###"
},
{
"prompt": "Find maximum of two numbers\n\n###\n\n",
"completion": " Max | n1,n2 | max | IMPLICIT | NONE\n({ n1, n2 }, { max }) => max.next(Math.max(n1, n2))###"
},
{
"prompt": "Calculate the larger number\n\n###\n\n",
"completion": " Max | n1,n2 | max | IMPLICIT | NONE\nfunction ({ num1, num2 }, { maxVal }) { maxVal.next(Math.max(num1, num2)); }###"
},
{
"prompt": "Determine the maximum value\n\n###\n\n",
"completion": " Max | n1,n2 | max | IMPLICIT | NONE\n({ n1, n2 }, { max }) => max.next(Math.max(n1, n2))###"
},
{
"prompt": "Get the highest number\n\n###\n\n",
"completion": " Max | n1,n2 | max | IMPLICIT | NONE\nfunction ({ num1, num2 }, { maxVal }) { maxVal.next(Math.max(num1, num2)); }###"
},
{
"prompt": "Convert string to integer\n\n###\n\n",
"completion": " Parse Int | str | int | IMPLICIT | NONE\n({ str }, { int }) => int.next(parseInt(str))###"
},
{
"prompt": "Parse string as integer\n\n###\n\n",
"completion": " Parse Int | str | int | IMPLICIT | NONE\nfunction ({ inputStr }, { outputInt }) {\n const { inputStr } = inputs;\n const { outputInt } = outputs;\n outputInt.next(parseInt(inputStr));\n}###"
},
{
"prompt": "Extract integer from string\n\n###\n\n",
"completion": " Parse Int | str | int | IMPLICIT | NONE\n({ str }, { int }) => int.next(parseInt(str))###"
},
{
"prompt": "Convert text to number\n\n###\n\n",
"completion": " Parse Int | str | int | IMPLICIT | NONE\nfunction ({ inputStr }, { outputInt }) {\n const { inputStr } = inputs;\n const { outputInt } = outputs;\n outputInt.next(parseInt(inputStr));\n}###"
},
{
"prompt": "Convert string to float\n\n###\n\n",
"completion": " Parse Float | str | float | IMPLICIT | NONE\n({ str }, { float }) => float.next(parseFloat(str))###"
},
{
"prompt": "Parse string as float\n\n###\n\n",
"completion": " Parse Float | str | float | IMPLICIT | NONE\nfunction (inputData, outputData) {\n const { str } = inputData;\n const { float } = outputData;\n \n const parsedFloat = parseFloat(str);\n float.next(parsedFloat);\n}###"
},
{
"prompt": "String to float converter\n\n###\n\n",
"completion": " Parse Float | str | float | IMPLICIT | NONE\n({ str }, { float }) => float.next(parseFloat(str))###"
},
{
"prompt": "Convert a string to a floating point number\n\n###\n\n",
"completion": " Parse Float | str | float | IMPLICIT | NONE\nfunction (inputData, outputData) {\n const { str } = inputData;\n const { float } = outputData;\n \n const parsedFloat = parseFloat(str);\n float.next(parsedFloat);\n}###"
},
{
"prompt": "Round number to fixed decimal places\n\n###\n\n",
"completion": " To Fixed | number,places | fixed | IMPLICIT | NONE\n({ number, places }, { fixed }) => fixed.next(number.toFixed(places))###"
},
{
"prompt": "Convert number to fixed decimal format\n\n###\n\n",
"completion": " To Fixed | number,places | fixed | IMPLICIT | NONE\nfunction ({ inputNumber, decimalPlaces }, { fixedNumber }) {\n const { inputNumber, decimalPlaces } = inputs;\n const { fixedNumber } = outputs;\n fixedNumber.next(inputNumber.toFixed(decimalPlaces));\n}###"
},
{
"prompt": "Create fixed decimal number\n\n###\n\n",
"completion": " To Fixed | number,places | fixed | IMPLICIT | NONE\n({ number, places }, { fixed }) => fixed.next(number.toFixed(places))###"
},
{
"prompt": "Limit decimal places of number\n\n###\n\n",
"completion": " To Fixed | number,places | fixed | IMPLICIT | NONE\nfunction ({ inputNumber, decimalPlaces }, { fixedNumber }) {\n const { inputNumber, decimalPlaces } = inputs;\n const { fixedNumber } = outputs;\n fixedNumber.next(inputNumber.toFixed(decimalPlaces));\n}###"
},
{
"prompt": "Convert number to exponential notation\n\n###\n\n",
"completion": " To Exponential | number,places | exponential | IMPLICIT | NONE\n({ number, places }, { exponential }) =>\n exponential.next(number.toExponential(places))###"
},
{
"prompt": "Convert number to scientific notation\n\n###\n\n",
"completion": " To Exponential | number,places | exponential | IMPLICIT | NONE\nfunction ({ num, dec }, { exp }) { exp.next(num.toExponential(dec)) }###"
},
{
"prompt": "Get exponential notation of number\n\n###\n\n",
"completion": " To Exponential | number,places | exponential | IMPLICIT | NONE\n({ number, places }, { exponential }) =>\n exponential.next(number.toExponential(places))###"
},
{
"prompt": "Transform number to exponential notation\n\n###\n\n",
"completion": " To Exponential | number,places | exponential | IMPLICIT | NONE\nfunction ({ num, dec }, { exp }) { exp.next(num.toExponential(dec)) }###"
},
{
"prompt": "Compare two numbers\n\n###\n\n",
"completion": " Greater Than | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 > n2)###"
},
{
"prompt": "Check if first number is greater than second\n\n###\n\n",
"completion": " Greater Than | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) {\n output.next(num1 > num2);\n}###"
},
{
"prompt": "Number comparison\n\n###\n\n",
"completion": " Greater Than | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 > n2)###"
},
{
"prompt": "Compare two numbers\n\n###\n\n",
"completion": " Greater Than Or Equal | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 >= n2)###"
},
{
"prompt": "Check if first number is greater than or equal to second number\n\n###\n\n",
"completion": " Greater Than Or Equal | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) {\n output.next(num1 >= num2);\n}###"
},
{
"prompt": "Number comparison\n\n###\n\n",
"completion": " Greater Than Or Equal | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 >= n2)###"
},
{
"prompt": "Check if one number is greater than or equal to another\n\n###\n\n",
"completion": " Greater Than Or Equal | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) {\n output.next(num1 >= num2);\n}###"
},
{
"prompt": "Compare two numbers\n\n###\n\n",
"completion": " Less Than | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 < n2)###"
},
{
"prompt": "Check if first number is less than second\n\n###\n\n",
"completion": " Less Than | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) {\n output.next(num1 < num2);\n}###"
},
{
"prompt": "Number comparison\n\n###\n\n",
"completion": " Less Than | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 < n2)###"
},
{
"prompt": "Part that checks if one number is less than another\n\n###\n\n",
"completion": " Less Than | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) {\n output.next(num1 < num2);\n}###"
},
{
"prompt": "Compare two numbers\n\n###\n\n",
"completion": " Less Than Or Equal | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 <= n2)###"
},
{
"prompt": "Check if first number is less than or equal to second number\n\n###\n\n",
"completion": " Less Than Or Equal | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) { output.next(num1 <= num2); }###"
},
{
"prompt": "Number comparison\n\n###\n\n",
"completion": " Less Than Or Equal | n1,n2 | result | IMPLICIT | NONE\n({ n1, n2 }, { result }) => result.next(n1 <= n2)###"
},
{
"prompt": "Determine if first number is less than or equal to second number\n\n###\n\n",
"completion": " Less Than Or Equal | n1,n2 | result | IMPLICIT | NONE\nfunction ({ num1, num2 }, { output }) { output.next(num1 <= num2); }###"
},
{
"prompt": "Calculate sum of list\n\n###\n\n",
"completion": " Sum List | list | sum | IMPLICIT | NONE\n({ list }, { sum }) => sum.next(list.reduce((a, b) => a + b, 0))###"
},
{
"prompt": "Sum up a list of numbers\n\n###\n\n",
"completion": " Sum List | list | sum | IMPLICIT | NONE\nfunction ({ inputList }, { outputSum }) {\n const { list } = inputList;\n const { sum } = outputSum;\n sum.next(list.reduce((a, b) => a + b, 0));\n}###"
},
{
"prompt": "Add up a list of values\n\n###\n\n",
"completion": " Sum List | list | sum | IMPLICIT | NONE\n({ list }, { sum }) => sum.next(list.reduce((a, b) => a + b, 0))###"
},
{
"prompt": "Calculate the total of a list\n\n###\n\n",
"completion": " Sum List | list | sum | IMPLICIT | NONE\nfunction ({ inputList }, { outputSum }) {\n const { list } = inputList;\n const { sum } = outputSum;\n sum.next(list.reduce((a, b) => a + b, 0));\n}###"
},
{
"prompt": "Split a string\n\n###\n\n",
"completion": " Split | string,separator | value | IMPLICIT | NONE\n({ string, separator }, { value }) =>\n value.next(string.split(separator))###"
},
{
"prompt": "Divide string into parts\n\n###\n\n",
"completion": " Split | string,separator | value | IMPLICIT | NONE\nfunction ({ inputString, separator }, { outputArray }) {\n const splitArray = inputString.split(separator);\n outputArray.next(splitArray);\n}###"
},
{
"prompt": "Split string into array\n\n###\n\n",
"completion": " Split | string,separator | value | IMPLICIT | NONE\n({ string, separator }, { value }) =>\n value.next(string.split(separator))###"
},
{
"prompt": "Separate string into multiple parts\n\n###\n\n",
"completion": " Split | string,separator | value | IMPLICIT | NONE\nfunction ({ inputString, separator }, { outputArray }) {\n const splitArray = inputString.split(separator);\n outputArray.next(splitArray);\n}###"
},
{
"prompt": "Join an array with a separator\n\n###\n\n",
"completion": " Join | array,separator | value | IMPLICIT | NONE\n({ array, separator }, { value }) => value.next(array.join(separator))###"
},
{
"prompt": "Combine array elements with a separator\n\n###\n\n",
"completion": " Join | array,separator | value | IMPLICIT | NONE\nfunction ({ inputArray, separator }, { outputValue }) {\n const joinedArray = inputArray.join(separator);\n outputValue.next(joinedArray);\n}###"
},
{
"prompt": "Create a string from an array with a separator\n\n###\n\n",
"completion": " Join | array,separator | value | IMPLICIT | NONE\n({ array, separator }, { value }) => value.next(array.join(separator))###"
},
{
"prompt": "Join array elements using a separator\n\n###\n\n",
"completion": " Join | array,separator | value | IMPLICIT | NONE\nfunction ({ inputArray, separator }, { outputValue }) {\n const joinedArray = inputArray.join(separator);\n outputValue.next(joinedArray);\n}###"
},
{
"prompt": "Replace text in string\n\n###\n\n",
"completion": " Replace | string,searchValue,replaceValue | value | IMPLICIT | NONE\n({ string, searchValue, replaceValue }, { value }) =>\n value.next(string.replace(searchValue, replaceValue))###"
},
{
"prompt": "Replace values in string\n\n###\n\n",
"completion": " Replace | string,searchValue,replaceValue | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, replaceValue }, { outputString }) => { outputString.next(inputString.replace(searchValue, replaceValue)) }###"
},
{
"prompt": "Modify string content\n\n###\n\n",
"completion": " Replace | string,searchValue,replaceValue | value | IMPLICIT | NONE\n({ string, searchValue, replaceValue }, { value }) =>\n value.next(string.replace(searchValue, replaceValue))###"
},
{
"prompt": "Change text in string\n\n###\n\n",
"completion": " Replace | string,searchValue,replaceValue | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, replaceValue }, { outputString }) => { outputString.next(inputString.replace(searchValue, replaceValue)) }###"
},
{
"prompt": "Remove whitespace from string\n\n###\n\n",
"completion": " Trim | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.trim())###"
},
{
"prompt": "Trim string\n\n###\n\n",
"completion": " Trim | string | value | IMPLICIT | NONE\nfunction (input, output) {\n const { string } = input;\n const { value } = output;\n const trimmedString = string.trim();\n value.next(trimmedString);\n}###"
},
{
"prompt": "Trim leading/trailing spaces\n\n###\n\n",
"completion": " Trim | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.trim())###"
},
{
"prompt": "Clean up string\n\n###\n\n",
"completion": " Trim | string | value | IMPLICIT | NONE\nfunction (input, output) {\n const { string } = input;\n const { value } = output;\n const trimmedString = string.trim();\n value.next(trimmedString);\n}###"
},
{
"prompt": "Convert string to lowercase\n\n###\n\n",
"completion": " To Lower Case | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.toLowerCase())###"
},
{
"prompt": "Lowercase string\n\n###\n\n",
"completion": " To Lower Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n const { string } = inputString;\n const { value } = outputValue;\n value.next(string.toLowerCase());\n}###"
},
{
"prompt": "Transform string to lowercase\n\n###\n\n",
"completion": " To Lower Case | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.toLowerCase())###"
},
{
"prompt": "Change string to lowercase\n\n###\n\n",
"completion": " To Lower Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n const { string } = inputString;\n const { value } = outputValue;\n value.next(string.toLowerCase());\n}###"
},
{
"prompt": "Convert string to uppercase\n\n###\n\n",
"completion": " To Upper Case | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.toUpperCase())###"
},
{
"prompt": "Uppercase string\n\n###\n\n",
"completion": " To Upper Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n const { inputString } = inputs;\n const { outputValue } = outputs;\n outputValue.next(inputString.toUpperCase());\n}###"
},
{
"prompt": "Convert text to uppercase letters\n\n###\n\n",
"completion": " To Upper Case | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.toUpperCase())###"
},
{
"prompt": "Transform string to all uppercase\n\n###\n\n",
"completion": " To Upper Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n const { inputString } = inputs;\n const { outputValue } = outputs;\n outputValue.next(inputString.toUpperCase());\n}###"
},
{
"prompt": "Extract a part of a string\n\n###\n\n",
"completion": " Substring | string,start,end | value | IMPLICIT | NONE\n({ string, start, end }, { value }) =>\n value.next(string.substring(start, end))###"
},
{
"prompt": "Get a substring from a string\n\n###\n\n",
"completion": " Substring | string,start,end | value | IMPLICIT | NONE\nfunction (inputs, outputs) {\n const { string, start, end } = inputs;\n const { value } = outputs;\n\n const subString = string.substring(start, end);\n value.next(subString);\n}###"
},
{
"prompt": "Select a portion of a string\n\n###\n\n",
"completion": " Substring | string,start,end | value | IMPLICIT | NONE\n({ string, start, end }, { value }) =>\n value.next(string.substring(start, end))###"
},
{
"prompt": "Get a part of a string based on start and end positions\n\n###\n\n",
"completion": " Substring | string,start,end | value | IMPLICIT | NONE\nfunction (inputs, outputs) {\n const { string, start, end } = inputs;\n const { value } = outputs;\n\n const subString = string.substring(start, end);\n value.next(subString);\n}###"
},
{
"prompt": "Measure string length\n\n###\n\n",
"completion": " Length | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.length)###"
},
{
"prompt": "Count characters in string\n\n###\n\n",
"completion": " Length | string | value | IMPLICIT | NONE\nfunction (input, output) {\n const { inputString } = input;\n const { outputValue } = output;\n outputValue.next(inputString.length);\n}###"
},
{
"prompt": "Length of input string\n\n###\n\n",
"completion": " Length | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.length)###"
},
{
"prompt": "Calculate string length\n\n###\n\n",
"completion": " Length | string | value | IMPLICIT | NONE\nfunction (input, output) {\n const { inputString } = input;\n const { outputValue } = output;\n outputValue.next(inputString.length);\n}###"
},
{
"prompt": "Find index of substring\n\n###\n\n",
"completion": " Index Of | string,searchValue,fromIndex | value | IMPLICIT | NONE\n({ string, searchValue, fromIndex }, { value }) =>\n value.next(string.indexOf(searchValue, fromIndex))###"
},
{
"prompt": "Get index of substring\n\n###\n\n",
"completion": " Index Of | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, startIndex }, { result }) { result.next(inputString.indexOf(searchValue, startIndex)); }###"
},
{
"prompt": "Locate substring index\n\n###\n\n",
"completion": " Index Of | string,searchValue,fromIndex | value | IMPLICIT | NONE\n({ string, searchValue, fromIndex }, { value }) =>\n value.next(string.indexOf(searchValue, fromIndex))###"
},
{
"prompt": "Search for substring index\n\n###\n\n",
"completion": " Index Of | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, startIndex }, { result }) { result.next(inputString.indexOf(searchValue, startIndex)); }###"
},
{
"prompt": "Get character at index\n\n###\n\n",
"completion": " Char At | string,index | value | IMPLICIT | NONE\n({ string, index }, { value }) => value.next(string.charAt(index))###"
},
{
"prompt": "Retrieve character from string\n\n###\n\n",
"completion": " Char At | string,index | value | IMPLICIT | NONE\nfunction ({ str, idx }, { val }) {\n return val.next(str.charAt(idx));\n}###"
},
{
"prompt": "Extract character from string\n\n###\n\n",
"completion": " Char At | string,index | value | IMPLICIT | NONE\n({ string, index }, { value }) => value.next(string.charAt(index))###"
},
{
"prompt": "Get single character from string\n\n###\n\n",
"completion": " Char At | string,index | value | IMPLICIT | NONE\nfunction ({ str, idx }, { val }) {\n return val.next(str.charAt(idx));\n}###"
},
{
"prompt": "Convert string to kebab case\n\n###\n\n",
"completion": " To Kebab Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/\\s+/g, \"-\")\n .toLowerCase()\n )###"
},
{
"prompt": "Change string to kebab case\n\n###\n\n",
"completion": " To Kebab Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n outputValue.next(inputString.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/\\s+/g, '-').toLowerCase());\n}###"
},
{
"prompt": "Transform string to kebab case\n\n###\n\n",
"completion": " To Kebab Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/\\s+/g, \"-\")\n .toLowerCase()\n )###"
},
{
"prompt": "Convert string to kebab-case format\n\n###\n\n",
"completion": " To Kebab Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n outputValue.next(inputString.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/\\s+/g, '-').toLowerCase());\n}###"
},
{
"prompt": "Convert string to camel case\n\n###\n\n",
"completion": " To Camel Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) => {\n if (+match === 0) return \"\";\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n })\n )###"
},
{
"prompt": "Camel case a string\n\n###\n\n",
"completion": " To Camel Case | string | value | IMPLICIT | NONE\nfunction (inputString, outputValue) {\n const { value } = outputValue;\n const camelCaseString = inputString.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) => {\n if (+match === 0) return \"\";\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n });\n value.next(camelCaseString);\n}###"
},
{
"prompt": "Transform string to camel case\n\n###\n\n",
"completion": " To Camel Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) => {\n if (+match === 0) return \"\";\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n })\n )###"
},
{
"prompt": "Change string to camel case\n\n###\n\n",
"completion": " To Camel Case | string | value | IMPLICIT | NONE\nfunction (inputString, outputValue) {\n const { value } = outputValue;\n const camelCaseString = inputString.replace(/(?:^\\w|[A-Z]|\\b\\w|\\s+)/g, (match, index) => {\n if (+match === 0) return \"\";\n return index === 0 ? match.toLowerCase() : match.toUpperCase();\n });\n value.next(camelCaseString);\n}###"
},
{
"prompt": "Convert string to Pascal Case\n\n###\n\n",
"completion": " To Pascal Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (match, index) => {\n return index === 0 ? match.toUpperCase() : match.toLowerCase();\n })\n .replace(/\\s+/g, \"\")\n )###"
},
{
"prompt": "Convert string to PascalCase\n\n###\n\n",
"completion": " To Pascal Case | string | value | IMPLICIT | NONE\nfunction (inputString, outputValue) {\n const words = inputString.split(/\\s+/);\n const pascalCase = words.map((word) => {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n }).join('');\n outputValue.next(pascalCase);\n}###"
},
{
"prompt": "Convert string to PascalCase format\n\n###\n\n",
"completion": " To Pascal Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (match, index) => {\n return index === 0 ? match.toUpperCase() : match.toLowerCase();\n })\n .replace(/\\s+/g, \"\")\n )###"
},
{
"prompt": "Convert a string to Pascal Case format\n\n###\n\n",
"completion": " To Pascal Case | string | value | IMPLICIT | NONE\nfunction (inputString, outputValue) {\n const words = inputString.split(/\\s+/);\n const pascalCase = words.map((word) => {\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n }).join('');\n outputValue.next(pascalCase);\n}###"
},
{
"prompt": "Convert string to snake case\n\n###\n\n",
"completion": " To Snake Case | string | value | IMPLICIT | NONE\n(string) =>\n string\n .replace(/([a-z])([A-Z])/g, \"$1_$2\")\n .replace(/\\s+/g, \"_\")\n .toLowerCase()###"
},
{
"prompt": "Snake case string\n\n###\n\n",
"completion": " To Snake Case | string | value | IMPLICIT | NONE\nfunction (inputString, outputValue) {\n const snakeCaseString = inputString.replace(/([a-z])([A-Z])/g, '$1_$2').replace(/\\s+/g, '_').toLowerCase();\n outputValue.next(snakeCaseString);\n}###"
},
{
"prompt": "Transform string to snake case format\n\n###\n\n",
"completion": " To Snake Case | string | value | IMPLICIT | NONE\n(string) =>\n string\n .replace(/([a-z])([A-Z])/g, \"$1_$2\")\n .replace(/\\s+/g, \"_\")\n .toLowerCase()###"
},
{
"prompt": "Change string to snake case\n\n###\n\n",
"completion": " To Snake Case | string | value | IMPLICIT | NONE\nfunction (inputString, outputValue) {\n const snakeCaseString = inputString.replace(/([a-z])([A-Z])/g, '$1_$2').replace(/\\s+/g, '_').toLowerCase();\n outputValue.next(snakeCaseString);\n}###"
},
{
"prompt": "Capitalize First Letter of Each Word\n\n###\n\n",
"completion": " To Title Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string.replace(\n /\\w\\S*/g,\n (match) => match.charAt(0).toUpperCase() + match.substr(1).toLowerCase()\n )\n )###"
},
{
"prompt": "Convert String to Title Case\n\n###\n\n",
"completion": " To Title Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n const words = inputString.split(' ');\n const capitalizedWords = words.map(word => word.charAt(0).toUpperCase() + word.slice(1));\n const titleCaseString = capitalizedWords.join(' ');\n outputValue.next(titleCaseString);\n}###"
},
{
"prompt": "Title Case Converter\n\n###\n\n",
"completion": " To Title Case | string | value | IMPLICIT | NONE\n({ string }, { value }) =>\n value.next(\n string.replace(\n /\\w\\S*/g,\n (match) => match.charAt(0).toUpperCase() + match.substr(1).toLowerCase()\n )\n )###"
},
{
"prompt": "Part that Capitalizes First Letter of Each Word\n\n###\n\n",
"completion": " To Title Case | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n const words = inputString.split(' ');\n const capitalizedWords = words.map(word => word.charAt(0).toUpperCase() + word.slice(1));\n const titleCaseString = capitalizedWords.join(' ');\n outputValue.next(titleCaseString);\n}###"
},
{
"prompt": "Check if string includes value\n\n###\n\n",
"completion": " Includes | string,searchValue,fromIndex | value | IMPLICIT | NONE\n({ string, searchValue, fromIndex }, { value }) =>\n value.next(string.includes(searchValue, fromIndex))###"
},
{
"prompt": "String contains value?\n\n###\n\n",
"completion": " Includes | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, startIndex }, { result }) {\n const includesValue = inputString.includes(searchValue, startIndex);\n result.next(includesValue);\n}###"
},
{
"prompt": "Part that checks if string includes value\n\n###\n\n",
"completion": " Includes | string,searchValue,fromIndex | value | IMPLICIT | NONE\n({ string, searchValue, fromIndex }, { value }) =>\n value.next(string.includes(searchValue, fromIndex))###"
},
{
"prompt": "A component that verifies if a string includes a specific value\n\n###\n\n",
"completion": " Includes | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, startIndex }, { result }) {\n const includesValue = inputString.includes(searchValue, startIndex);\n result.next(includesValue);\n}###"
},
{
"prompt": "Check if string starts with value\n\n###\n\n",
"completion": " Starts With | string,searchValue,fromIndex | value | IMPLICIT | NONE\n({ string, searchValue, fromIndex }, { value }) =>\n value.next(string.startsWith(searchValue, fromIndex))###"
},
{
"prompt": "String start checker\n\n###\n\n",
"completion": " Starts With | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, startIndex }, { result }) { result.next(inputString.startsWith(searchValue, startIndex)); }###"
},
{
"prompt": "Part that checks if string starts with value\n\n###\n\n",
"completion": " Starts With | string,searchValue,fromIndex | value | IMPLICIT | NONE\n({ string, searchValue, fromIndex }, { value }) =>\n value.next(string.startsWith(searchValue, fromIndex))###"
},
{
"prompt": "A component that verifies if a string starts with a given value\n\n###\n\n",
"completion": " Starts With | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({ inputString, searchValue, startIndex }, { result }) { result.next(inputString.startsWith(searchValue, startIndex)); }###"
},
{
"prompt": "Check if string ends with value\n\n###\n\n",
"completion": " Ends With | string,searchValue,fromIndex | value | IMPLICIT | NONE\n(string, searchValue, fromIndex) =>\n string.endsWith(searchValue, fromIndex)###"
},
{
"prompt": "Ends with string check\n\n###\n\n",
"completion": " Ends With | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({stringToCheck, valueToSearch, startingIndex}, {result}) {\n result.next(stringToCheck.endsWith(valueToSearch, startingIndex));\n}###"
},
{
"prompt": "String ending check\n\n###\n\n",
"completion": " Ends With | string,searchValue,fromIndex | value | IMPLICIT | NONE\n(string, searchValue, fromIndex) =>\n string.endsWith(searchValue, fromIndex)###"
},
{
"prompt": "Check if string ends with specified value\n\n###\n\n",
"completion": " Ends With | string,searchValue,fromIndex | value | IMPLICIT | NONE\nfunction ({stringToCheck, valueToSearch, startingIndex}, {result}) {\n result.next(stringToCheck.endsWith(valueToSearch, startingIndex));\n}###"
},
{
"prompt": "Check if string is empty\n\n###\n\n",
"completion": " Is Empty | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.length === 0)###"
},
{
"prompt": "Detect empty string\n\n###\n\n",
"completion": " Is Empty | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n return outputValue.next(inputString.length === 0);\n}###"
},
{
"prompt": "String emptiness checker\n\n###\n\n",
"completion": " Is Empty | string | value | IMPLICIT | NONE\n({ string }, { value }) => value.next(string.length === 0)###"
},
{
"prompt": "Part that verifies if a string is empty\n\n###\n\n",
"completion": " Is Empty | string | value | IMPLICIT | NONE\nfunction ({ inputString }, { outputValue }) {\n return outputValue.next(inputString.length === 0);\n}###"
},
{
"prompt": "Match a string with a regular expression\n\n###\n\n",
"completion": " Match Regex | string,regex | value | IMPLICIT | NONE\n({ string, regex }, { value }) => value.next(string.match(regex))###"
},
{
"prompt": "Find matches in a string using a regex\n\n###\n\n",
"completion": " Match Regex | string,regex | value | IMPLICIT | NONE\nfunction ({ inputString, regex }, { matches }) {\n const newMatches = inputString.match(regex);\n matches.next(newMatches);\n}###"
},
{
"prompt": "Regex matcher\n\n###\n\n",
"completion": " Match Regex | string,regex | value | IMPLICIT | NONE\n({ string, regex }, { value }) => value.next(string.match(regex))###"
},
{
"prompt": "Part that matches a string with a regular expression\n\n###\n\n",
"completion": " Match Regex | string,regex | value | IMPLICIT | NONE\nfunction ({ inputString, regex }, { matches }) {\n const newMatches = inputString.match(regex);\n matches.next(newMatches);\n}###"
},
{
"prompt": "Create an empty string\n\n###\n\n",
"completion": " Empty String | | string | IMPLICIT | NONE\n({}, { string }) => string.next(\"\")###"
},
{
"prompt": "Generate an empty string\n\n###\n\n",
"completion": " Empty String | | string | IMPLICIT | NONE\nfunction (inputs, outputs) {\n const { string } = outputs;\n string.next(\"\");\n}###"
},
{
"prompt": "Produce an empty string\n\n###\n\n",
"completion": " Empty String | | string | IMPLICIT | NONE\n({}, { string }) => string.next(\"\")###"
},
{
"prompt": "Create a blank string\n\n###\n\n",
"completion": " Empty String | | string | IMPLICIT | NONE\nfunction (inputs, outputs) {\n const { string } = outputs;\n string.next(\"\");\n}###"
},
{
"prompt": "Round Robin output distributor\n\n###\n\n",
"completion": " Round Robin 3 | value | r1,r2,r3 | | value\nfunction (inputs, outputs, adv) {\n const { state } = adv;\n const { r1, r2, r3 } = outputs;\n const curr = state.get(\"curr\") || 0;\n\n const o = [r1, r2, r3][curr];\n\n const nextCurr = (curr + 1) % 3;\n\n o.next(inputs.item);\n state.set(\"curr\", nextCurr);\n }###"
},
{
"prompt": "Distribute values in a round-robin fashion\n\n###\n\n",
"completion": " Round Robin 3 | value | r1,r2,r3 | | value\nfunction ({ item }, { out1, out2, out3 }) {\n const outputs = [out1, out2, out3];\n let curr = 0;\n\n return function () {\n const o = outputs[curr];\n o.next(item);\n curr = (curr + 1) % 3;\n };\n}###"
},
{
"prompt": "A part that distributes values equally to three outputs\n\n###\n\n",
"completion": " Round Robin 3 | value | r1,r2,r3 | | value\nfunction (inputs, outputs, adv) {\n const { state } = adv;\n const { r1, r2, r3 } = outputs;\n const curr = state.get(\"curr\") || 0;\n\n const o = [r1, r2, r3][curr];\n\n const nextCurr = (curr + 1) % 3;\n\n o.next(inputs.item);\n state.set(\"curr\", nextCurr);\n }###"
},
{
"prompt": "A component that cycles through three outputs to distribute values\n\n###\n\n",
"completion": " Round Robin 3 | value | r1,r2,r3 | | value\nfunction ({ item }, { out1, out2, out3 }) {\n const outputs = [out1, out2, out3];\n let curr = 0;\n\n return function () {\n const o = outputs[curr];\n o.next(item);\n curr = (curr + 1) % 3;\n };\n}###"
},
{
"prompt": "Alternate between two outputs\n\n###\n\n",
"completion": " Round Robin 2 | value | r1,r2 | | value\nfunction (inputs, outputs, adv) {\n const { state } = adv;\n const { r1, r2 } = outputs;\n const curr = state.get(\"curr\") || 0;\n\n const o = [r1, r2][curr];\n\n const nextCurr = (curr + 1) % 2;\n\n o.next(inputs.item);\n state.set(\"curr\", nextCurr);\n }###"
},
{
"prompt": "Round Robin output\n\n###\n\n",
"completion": " Round Robin 2 | value | r1,r2 | | value\nfunction ({ item }, { output1, output2 }) {\n const { state } = adv;\n const curr = state.get('curr') || 0;\n\n const o = [output1, output2][curr];\n\n const nextCurr = (curr + 1) % 2;\n\n o.next(item);\n state.set('curr', nextCurr);\n}###"
},
{
"prompt": "Switch between two outputs\n\n###\n\n",
"completion": " Round Robin 2 | value | r1,r2 | | value\nfunction (inputs, outputs, adv) {\n const { state } = adv;\n const { r1, r2 } = outputs;\n const curr = state.get(\"curr\") || 0;\n\n const o = [r1, r2][curr];\n\n const nextCurr = (curr + 1) % 2;\n\n o.next(inputs.item);\n state.set(\"curr\", nextCurr);\n }###"
},
{
"prompt": "Output to two destinations in turns\n\n###\n\n",
"completion": " Round Robin 2 | value | r1,r2 | | value\nfunction ({ item }, { output1, output2 }) {\n const { state } = adv;\n const curr = state.get('curr') || 0;\n\n const o = [output1, output2][curr];\n\n const nextCurr = (curr + 1) % 2;\n\n o.next(item);\n state.set('curr', nextCurr);\n}###"
},
{
"prompt": "Round Robin output distributor\n\n###\n\n",
"completion": " Round Robin 4 | value | r1,r2,r3,r4 | | value\nfunction (inputs, outputs, adv) {\n const { state } = adv;\n const { r1, r2, r3, r4 } = outputs;\n const curr = state.get(\"curr\") || 0;\n\n const o = [r1, r2, r3, r4][curr];\n\n const nextCurr = (curr + 1) % 4;\n\n o.next(inputs.item);\n state.set(\"curr\", nextCurr);\n }###"
},
{
"prompt": "Distribute values in a round-robin fashion\n\n###\n\n",
"completion": " Round Robin 4 | value | r1,r2,r3,r4 | | value\nfunction (inpt, out1, out2, out3, out4) {\n let curr = 0;\n return function (value) {\n const o = [out1, out2, out3, out4][curr];\n o.next(value);\n curr = (curr + 1) % 4;\n };\n}###"
},
{
"prompt": "A part that distributes values equally to 4 outputs\n\n###\n\n",
"completion": " Round Robin 4 | value | r1,r2,r3,r4 | | value\nfunction (inputs, outputs, adv) {\n const { state } = adv;\n const { r1, r2, r3, r4 } = outputs;\n const curr = state.get(\"curr\") || 0;\n\n const o = [r1, r2, r3, r4][curr];\n\n const nextCurr = (curr + 1) % 4;\n\n o.next(inputs.item);\n state.set(\"curr\", nextCurr);\n }###"
},
{
"prompt": "A component that cycles through 4 outputs to distribute values\n\n###\n\n",
"completion": " Round Robin 4 | value | r1,r2,r3,r4 | | value\nfunction (inpt, out1, out2, out3, out4) {\n let curr = 0;\n return function (value) {\n const o = [out1, out2, out3, out4][curr];\n o.next(value);\n curr = (curr + 1) % 4;\n };\n}###"
},
{
"prompt": "Publish a value to a channel\n\n###\n\n",
"completion": " Publish | key,value | | IMPLICIT | NONE\nfunction (inputs, _, adv) {\n // magic here\n const nsKey = `${adv.ancestorsInsIds}__${inputs.key}`;\n\n PubSub.publish(nsKey, inputs.value);\n }###"
},
{
"prompt": "Send data to a channel\n\n###\n\n",
"completion": " Publish | key,value | | IMPLICIT | NONE\nfunction ({channel, data}, _, adv) {\n const nsKey = `${adv.ancestorsInsIds}__${channel}`;\n\n PubSub.publish(nsKey, data);\n }###"
},
{
"prompt": "Publish data to a channel\n\n###\n\n",
"completion": " Publish | key,value | | IMPLICIT | NONE\nfunction (inputs, _, adv) {\n // magic here\n const nsKey = `${adv.ancestorsInsIds}__${inputs.key}`;\n\n PubSub.publish(nsKey, inputs.value);\n }###"
},
{
"prompt": "Broadcast data to a channel\n\n###\n\n",
"completion": " Publish | key,value | | IMPLICIT | NONE\nfunction ({channel, data}, _, adv) {\n const nsKey = `${adv.ancestorsInsIds}__${channel}`;\n\n PubSub.publish(nsKey, data);\n }###"
},
{
"prompt": "Subscribe to a PubSub channel\n\n###\n\n",
"completion": " Subscribe | key,initial | value | | NONE\nfunction (inputs, outputs, adv) {\n const { value } = outputs;\n const nsKey = `${adv.ancestorsInsIds}__${inputs.key}`;\n const token = PubSub.subscribe(nsKey, (_, data) => {\n value.next(data);\n });\n\n if (typeof inputs.initial !== \"undefined\") {\n value.next(inputs.initial);\n }\n\n adv.onCleanup(() => {\n PubSub.unsubscribe(token);\n });\n }###"
},
{
"prompt": "Subscribe to a channel and receive updates\n\n###\n\n",
"completion": " Subscribe | key,initial | value | | NONE\nfunction (inputs, outputs, adv) {\n const { value } = outputs;\n const channelName = `${adv.ancestorsInsIds}__${inputs.channel}`;\n const token = PubSub.subscribe(channelName, (_, data) => {\n value.next(data);\n });\n\n if (typeof inputs.initial !== \"undefined\") {\n value.next(inputs.initial);\n }\n\n adv.onCleanup(() => {\n PubSub.unsubscribe(token);\n });\n }###"
},
{
"prompt": "Subscribe to a channel for updates\n\n###\n\n",
"completion": " Subscribe | key,initial | value | | NONE\nfunction (inputs, outputs, adv) {\n const { value } = outputs;\n const nsKey = `${adv.ancestorsInsIds}__${inputs.key}`;\n const token = PubSub.subscribe(nsKey, (_, data) => {\n value.next(data);\n });\n\n if (typeof inputs.initial !== \"undefined\") {\n value.next(inputs.initial);\n }\n\n adv.onCleanup(() => {\n PubSub.unsubscribe(token);\n });\n }###"
},
{
"prompt": "Subscribe to a channel and receive notifications\n\n###\n\n",
"completion": " Subscribe | key,initial | value | | NONE\nfunction (inputs, outputs, adv) {\n const { value } = outputs;\n const channelName = `${adv.ancestorsInsIds}__${inputs.channel}`;\n const token = PubSub.subscribe(channelName, (_, data) => {\n value.next(data);\n });\n\n if (typeof inputs.initial !== \"undefined\") {\n value.next(inputs.initial);\n }\n\n adv.onCleanup(() => {\n PubSub.unsubscribe(token);\n });\n }###"