bare-script 3.8.0 → 3.8.2
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/README.md +4 -9
- package/lib/include/args.bare +10 -10
- package/lib/include/baredoc.bare +313 -0
- package/lib/include/dataLineChart.bare +90 -0
- package/lib/include/dataTable.bare +3 -3
- package/lib/include/diff.bare +3 -3
- package/lib/include/forms.bare +1 -1
- package/lib/include/markdownUp.bare +310 -1
- package/lib/include/pager.bare +6 -6
- package/lib/include/unittest.bare +1 -1
- package/lib/include/unittestMock.bare +1 -1
- package/lib/library.js +118 -116
- package/package.json +4 -3
package/lib/library.js
CHANGED
|
@@ -26,7 +26,7 @@ export const defaultMaxStatements = 1e9;
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
// $function: arrayCopy
|
|
29
|
-
// $group:
|
|
29
|
+
// $group: array
|
|
30
30
|
// $doc: Create a copy of an array
|
|
31
31
|
// $arg array: The array to copy
|
|
32
32
|
// $return: The array copy
|
|
@@ -41,7 +41,7 @@ const arrayCopyArgs = valueArgsModel([
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
// $function: arrayDelete
|
|
44
|
-
// $group:
|
|
44
|
+
// $group: array
|
|
45
45
|
// $doc: Delete an array element
|
|
46
46
|
// $arg array: The array
|
|
47
47
|
// $arg index: The index of the element to delete
|
|
@@ -61,7 +61,7 @@ const arrayDeleteArgs = valueArgsModel([
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
// $function: arrayExtend
|
|
64
|
-
// $group:
|
|
64
|
+
// $group: array
|
|
65
65
|
// $doc: Extend one array with another
|
|
66
66
|
// $arg array: The array to extend
|
|
67
67
|
// $arg array2: The array to extend with
|
|
@@ -79,22 +79,24 @@ const arrayExtendArgs = valueArgsModel([
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
// $function: arrayFlat
|
|
82
|
-
// $group:
|
|
82
|
+
// $group: array
|
|
83
83
|
// $doc: Flat an array hierarchy
|
|
84
84
|
// $arg array: The array to flat
|
|
85
|
+
// $arg depth: The maximum depth of the array hierarchy
|
|
85
86
|
// $return: The flated array
|
|
86
87
|
function arrayFlat(args) {
|
|
87
|
-
const [array] = valueArgsValidate(arrayFlatArgs, args);
|
|
88
|
-
return array.flat(
|
|
88
|
+
const [array, depth] = valueArgsValidate(arrayFlatArgs, args);
|
|
89
|
+
return array.flat(depth);
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
const arrayFlatArgs = valueArgsModel([
|
|
92
|
-
{'name': 'array', 'type': 'array'}
|
|
93
|
+
{'name': 'array', 'type': 'array'},
|
|
94
|
+
{'name': 'depth', 'type': 'number', 'integer': true, 'default': 10}
|
|
93
95
|
]);
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
// $function: arrayGet
|
|
97
|
-
// $group:
|
|
99
|
+
// $group: array
|
|
98
100
|
// $doc: Get an array element
|
|
99
101
|
// $arg array: The array
|
|
100
102
|
// $arg index: The array element's index
|
|
@@ -115,7 +117,7 @@ const arrayGetArgs = valueArgsModel([
|
|
|
115
117
|
|
|
116
118
|
|
|
117
119
|
// $function: arrayIndexOf
|
|
118
|
-
// $group:
|
|
120
|
+
// $group: array
|
|
119
121
|
// $doc: Find the index of a value in an array
|
|
120
122
|
// $arg array: The array
|
|
121
123
|
// $arg value: The value to find in the array, or a match function, f(value) -> bool
|
|
@@ -148,7 +150,7 @@ const arrayIndexOfArgs = valueArgsModel([
|
|
|
148
150
|
|
|
149
151
|
|
|
150
152
|
// $function: arrayJoin
|
|
151
|
-
// $group:
|
|
153
|
+
// $group: array
|
|
152
154
|
// $doc: Join an array with a separator string
|
|
153
155
|
// $arg array: The array
|
|
154
156
|
// $arg separator: The separator string
|
|
@@ -165,7 +167,7 @@ const arrayJoinArgs = valueArgsModel([
|
|
|
165
167
|
|
|
166
168
|
|
|
167
169
|
// $function: arrayLastIndexOf
|
|
168
|
-
// $group:
|
|
170
|
+
// $group: array
|
|
169
171
|
// $doc: Find the last index of a value in an array
|
|
170
172
|
// $arg array: The array
|
|
171
173
|
// $arg value: The value to find in the array, or a match function, f(value) -> bool
|
|
@@ -202,7 +204,7 @@ const arrayLastIndexOfArgs = valueArgsModel([
|
|
|
202
204
|
|
|
203
205
|
|
|
204
206
|
// $function: arrayLength
|
|
205
|
-
// $group:
|
|
207
|
+
// $group: array
|
|
206
208
|
// $doc: Get the length of an array
|
|
207
209
|
// $arg array: The array
|
|
208
210
|
// $return: The array's length; zero if not an array
|
|
@@ -217,7 +219,7 @@ const arrayLengthArgs = valueArgsModel([
|
|
|
217
219
|
|
|
218
220
|
|
|
219
221
|
// $function: arrayNew
|
|
220
|
-
// $group:
|
|
222
|
+
// $group: array
|
|
221
223
|
// $doc: Create a new array
|
|
222
224
|
// $arg values...: The new array's values
|
|
223
225
|
// $return: The new array
|
|
@@ -227,7 +229,7 @@ function arrayNew(values) {
|
|
|
227
229
|
|
|
228
230
|
|
|
229
231
|
// $function: arrayNewSize
|
|
230
|
-
// $group:
|
|
232
|
+
// $group: array
|
|
231
233
|
// $doc: Create a new array of a specific size
|
|
232
234
|
// $arg size: Optional (default is 0). The new array's size.
|
|
233
235
|
// $arg value: Optional (default is 0). The value with which to fill the new array.
|
|
@@ -244,7 +246,7 @@ const arrayNewSizeArgs = valueArgsModel([
|
|
|
244
246
|
|
|
245
247
|
|
|
246
248
|
// $function: arrayPop
|
|
247
|
-
// $group:
|
|
249
|
+
// $group: array
|
|
248
250
|
// $doc: Remove the last element of the array and return it
|
|
249
251
|
// $arg array: The array
|
|
250
252
|
// $return: The last element of the array; null if the array is empty.
|
|
@@ -262,7 +264,7 @@ const arrayPopArgs = valueArgsModel([
|
|
|
262
264
|
|
|
263
265
|
|
|
264
266
|
// $function: arrayPush
|
|
265
|
-
// $group:
|
|
267
|
+
// $group: array
|
|
266
268
|
// $doc: Add one or more values to the end of the array
|
|
267
269
|
// $arg array: The array
|
|
268
270
|
// $arg values...: The values to add to the end of the array
|
|
@@ -280,7 +282,7 @@ const arrayPushArgs = valueArgsModel([
|
|
|
280
282
|
|
|
281
283
|
|
|
282
284
|
// $function: arraySet
|
|
283
|
-
// $group:
|
|
285
|
+
// $group: array
|
|
284
286
|
// $doc: Set an array element value
|
|
285
287
|
// $arg array: The array
|
|
286
288
|
// $arg index: The index of the element to set
|
|
@@ -304,7 +306,7 @@ const arraySetArgs = valueArgsModel([
|
|
|
304
306
|
|
|
305
307
|
|
|
306
308
|
// $function: arrayShift
|
|
307
|
-
// $group:
|
|
309
|
+
// $group: array
|
|
308
310
|
// $doc: Remove the first element of the array and return it
|
|
309
311
|
// $arg array: The array
|
|
310
312
|
// $return: The first element of the array; null if the array is empty.
|
|
@@ -322,7 +324,7 @@ const arrayShiftArgs = valueArgsModel([
|
|
|
322
324
|
|
|
323
325
|
|
|
324
326
|
// $function: arraySlice
|
|
325
|
-
// $group:
|
|
327
|
+
// $group: array
|
|
326
328
|
// $doc: Copy a portion of an array
|
|
327
329
|
// $arg array: The array
|
|
328
330
|
// $arg start: Optional (default is 0). The start index of the slice.
|
|
@@ -349,7 +351,7 @@ const arraySliceArgs = valueArgsModel([
|
|
|
349
351
|
|
|
350
352
|
|
|
351
353
|
// $function: arraySort
|
|
352
|
-
// $group:
|
|
354
|
+
// $group: array
|
|
353
355
|
// $doc: Sort an array
|
|
354
356
|
// $arg array: The array
|
|
355
357
|
// $arg compareFn: Optional (default is null). The comparison function.
|
|
@@ -378,7 +380,7 @@ export const coverageGlobalName = '__bareScriptCoverage';
|
|
|
378
380
|
|
|
379
381
|
|
|
380
382
|
// $function: coverageGlobalGet
|
|
381
|
-
// $group:
|
|
383
|
+
// $group: coverage
|
|
382
384
|
// $doc: Get the coverage global object
|
|
383
385
|
// $return: The [coverage global object](https://craigahobbs.github.io/bare-script/model/#var.vName='CoverageGlobal')
|
|
384
386
|
function coverageGlobalGet(unusedArgs, options) {
|
|
@@ -388,7 +390,7 @@ function coverageGlobalGet(unusedArgs, options) {
|
|
|
388
390
|
|
|
389
391
|
|
|
390
392
|
// $function: coverageGlobalName
|
|
391
|
-
// $group:
|
|
393
|
+
// $group: coverage
|
|
392
394
|
// $doc: Get the coverage global variable name
|
|
393
395
|
// $return: The coverage global variable name
|
|
394
396
|
function coverageGlobalNameFn() {
|
|
@@ -397,7 +399,7 @@ function coverageGlobalNameFn() {
|
|
|
397
399
|
|
|
398
400
|
|
|
399
401
|
// $function: coverageStart
|
|
400
|
-
// $group:
|
|
402
|
+
// $group: coverage
|
|
401
403
|
// $doc: Start coverage data collection
|
|
402
404
|
function coverageStart(unusedArgs, options) {
|
|
403
405
|
const globals = (options !== null ? (options.globals ?? null) : null);
|
|
@@ -409,7 +411,7 @@ function coverageStart(unusedArgs, options) {
|
|
|
409
411
|
|
|
410
412
|
|
|
411
413
|
// $function: coverageStop
|
|
412
|
-
// $group:
|
|
414
|
+
// $group: coverage
|
|
413
415
|
// $doc: Stop coverage data collection
|
|
414
416
|
function coverageStop(unusedArgs, options) {
|
|
415
417
|
const globals = (options !== null ? (options.globals ?? null) : null);
|
|
@@ -428,7 +430,7 @@ function coverageStop(unusedArgs, options) {
|
|
|
428
430
|
|
|
429
431
|
|
|
430
432
|
// $function: dataAggregate
|
|
431
|
-
// $group:
|
|
433
|
+
// $group: data
|
|
432
434
|
// $doc: Aggregate a data array
|
|
433
435
|
// $arg data: The data array
|
|
434
436
|
// $arg aggregation: The [aggregation model](https://craigahobbs.github.io/bare-script/library/model.html#var.vName='Aggregation')
|
|
@@ -445,7 +447,7 @@ const dataAggregateArgs = valueArgsModel([
|
|
|
445
447
|
|
|
446
448
|
|
|
447
449
|
// $function: dataCalculatedField
|
|
448
|
-
// $group:
|
|
450
|
+
// $group: data
|
|
449
451
|
// $doc: Add a calculated field to a data array
|
|
450
452
|
// $arg data: The data array
|
|
451
453
|
// $arg fieldName: The calculated field name
|
|
@@ -466,7 +468,7 @@ const dataCalculatedFieldArgs = valueArgsModel([
|
|
|
466
468
|
|
|
467
469
|
|
|
468
470
|
// $function: dataFilter
|
|
469
|
-
// $group:
|
|
471
|
+
// $group: data
|
|
470
472
|
// $doc: Filter a data array
|
|
471
473
|
// $arg data: The data array
|
|
472
474
|
// $arg expr: The filter expression
|
|
@@ -485,7 +487,7 @@ const dataFilterArgs = valueArgsModel([
|
|
|
485
487
|
|
|
486
488
|
|
|
487
489
|
// $function: dataJoin
|
|
488
|
-
// $group:
|
|
490
|
+
// $group: data
|
|
489
491
|
// $doc: Join two data arrays
|
|
490
492
|
// $arg leftData: The left data array
|
|
491
493
|
// $arg rightData: The right data array
|
|
@@ -511,7 +513,7 @@ const dataJoinArgs = valueArgsModel([
|
|
|
511
513
|
|
|
512
514
|
|
|
513
515
|
// $function: dataParseCSV
|
|
514
|
-
// $group:
|
|
516
|
+
// $group: data
|
|
515
517
|
// $doc: Parse CSV text to a data array
|
|
516
518
|
// $arg text...: The CSV text
|
|
517
519
|
// $return: The data array
|
|
@@ -535,7 +537,7 @@ function dataParseCSV(args) {
|
|
|
535
537
|
|
|
536
538
|
|
|
537
539
|
// $function: dataSort
|
|
538
|
-
// $group:
|
|
540
|
+
// $group: data
|
|
539
541
|
// $doc: Sort a data array
|
|
540
542
|
// $arg data: The data array
|
|
541
543
|
// $arg sorts: The sort field-name/descending-sort tuples
|
|
@@ -552,7 +554,7 @@ const dataSortArgs = valueArgsModel([
|
|
|
552
554
|
|
|
553
555
|
|
|
554
556
|
// $function: dataTop
|
|
555
|
-
// $group:
|
|
557
|
+
// $group: data
|
|
556
558
|
// $doc: Keep the top rows for each category
|
|
557
559
|
// $arg data: The data array
|
|
558
560
|
// $arg count: The number of rows to keep (default is 1)
|
|
@@ -571,7 +573,7 @@ const dataTopArgs = valueArgsModel([
|
|
|
571
573
|
|
|
572
574
|
|
|
573
575
|
// $function: dataValidate
|
|
574
|
-
// $group:
|
|
576
|
+
// $group: data
|
|
575
577
|
// $doc: Validate a data array
|
|
576
578
|
// $arg data: The data array
|
|
577
579
|
// $arg csv: Optional (default is false). If true, parse value strings.
|
|
@@ -594,7 +596,7 @@ const dataValidateArgs = valueArgsModel([
|
|
|
594
596
|
|
|
595
597
|
|
|
596
598
|
// $function: datetimeDay
|
|
597
|
-
// $group:
|
|
599
|
+
// $group: datetime
|
|
598
600
|
// $doc: Get the day of the month of a datetime
|
|
599
601
|
// $arg datetime: The datetime
|
|
600
602
|
// $return: The day of the month
|
|
@@ -609,7 +611,7 @@ const datetimeDayArgs = valueArgsModel([
|
|
|
609
611
|
|
|
610
612
|
|
|
611
613
|
// $function: datetimeHour
|
|
612
|
-
// $group:
|
|
614
|
+
// $group: datetime
|
|
613
615
|
// $doc: Get the hour of a datetime
|
|
614
616
|
// $arg datetime: The datetime
|
|
615
617
|
// $return: The hour
|
|
@@ -624,7 +626,7 @@ const datetimeHourArgs = valueArgsModel([
|
|
|
624
626
|
|
|
625
627
|
|
|
626
628
|
// $function: datetimeISOFormat
|
|
627
|
-
// $group:
|
|
629
|
+
// $group: datetime
|
|
628
630
|
// $doc: Format the datetime as an ISO date/time string
|
|
629
631
|
// $arg datetime: The datetime
|
|
630
632
|
// $arg isDate: If true, format the datetime as an ISO date
|
|
@@ -649,7 +651,7 @@ const datetimeISOFormatArgs = valueArgsModel([
|
|
|
649
651
|
|
|
650
652
|
|
|
651
653
|
// $function: datetimeISOParse
|
|
652
|
-
// $group:
|
|
654
|
+
// $group: datetime
|
|
653
655
|
// $doc: Parse an ISO date/time string
|
|
654
656
|
// $arg string: The ISO date/time string
|
|
655
657
|
// $return: The datetime, or null if parsing fails
|
|
@@ -664,7 +666,7 @@ const datetimeISOParseArgs = valueArgsModel([
|
|
|
664
666
|
|
|
665
667
|
|
|
666
668
|
// $function: datetimeMillisecond
|
|
667
|
-
// $group:
|
|
669
|
+
// $group: datetime
|
|
668
670
|
// $doc: Get the millisecond of a datetime
|
|
669
671
|
// $arg datetime: The datetime
|
|
670
672
|
// $return: The millisecond
|
|
@@ -679,7 +681,7 @@ const datetimeMillisecondArgs = valueArgsModel([
|
|
|
679
681
|
|
|
680
682
|
|
|
681
683
|
// $function: datetimeMinute
|
|
682
|
-
// $group:
|
|
684
|
+
// $group: datetime
|
|
683
685
|
// $doc: Get the minute of a datetime
|
|
684
686
|
// $arg datetime: The datetime
|
|
685
687
|
// $return: The minute
|
|
@@ -694,7 +696,7 @@ const datetimeMinuteArgs = valueArgsModel([
|
|
|
694
696
|
|
|
695
697
|
|
|
696
698
|
// $function: datetimeMonth
|
|
697
|
-
// $group:
|
|
699
|
+
// $group: datetime
|
|
698
700
|
// $doc: Get the month (1-12) of a datetime
|
|
699
701
|
// $arg datetime: The datetime
|
|
700
702
|
// $return: The month
|
|
@@ -709,7 +711,7 @@ const datetimeMonthArgs = valueArgsModel([
|
|
|
709
711
|
|
|
710
712
|
|
|
711
713
|
// $function: datetimeNew
|
|
712
|
-
// $group:
|
|
714
|
+
// $group: datetime
|
|
713
715
|
// $doc: Create a new datetime
|
|
714
716
|
// $arg year: The full year
|
|
715
717
|
// $arg month: The month (1-12)
|
|
@@ -736,7 +738,7 @@ const datetimeNewArgs = valueArgsModel([
|
|
|
736
738
|
|
|
737
739
|
|
|
738
740
|
// $function: datetimeNow
|
|
739
|
-
// $group:
|
|
741
|
+
// $group: datetime
|
|
740
742
|
// $doc: Get the current datetime
|
|
741
743
|
// $return: The current datetime
|
|
742
744
|
function datetimeNow() {
|
|
@@ -745,7 +747,7 @@ function datetimeNow() {
|
|
|
745
747
|
|
|
746
748
|
|
|
747
749
|
// $function: datetimeSecond
|
|
748
|
-
// $group:
|
|
750
|
+
// $group: datetime
|
|
749
751
|
// $doc: Get the second of a datetime
|
|
750
752
|
// $arg datetime: The datetime
|
|
751
753
|
// $return: The second
|
|
@@ -760,7 +762,7 @@ const datetimeSecondArgs = valueArgsModel([
|
|
|
760
762
|
|
|
761
763
|
|
|
762
764
|
// $function: datetimeToday
|
|
763
|
-
// $group:
|
|
765
|
+
// $group: datetime
|
|
764
766
|
// $doc: Get today's datetime
|
|
765
767
|
// $return: Today's datetime
|
|
766
768
|
function datetimeToday() {
|
|
@@ -770,7 +772,7 @@ function datetimeToday() {
|
|
|
770
772
|
|
|
771
773
|
|
|
772
774
|
// $function: datetimeYear
|
|
773
|
-
// $group:
|
|
775
|
+
// $group: datetime
|
|
774
776
|
// $doc: Get the full year of a datetime
|
|
775
777
|
// $arg datetime: The datetime
|
|
776
778
|
// $return: The full year
|
|
@@ -790,7 +792,7 @@ const datetimeYearArgs = valueArgsModel([
|
|
|
790
792
|
|
|
791
793
|
|
|
792
794
|
// $function: jsonParse
|
|
793
|
-
// $group:
|
|
795
|
+
// $group: json
|
|
794
796
|
// $doc: Convert a JSON string to an object
|
|
795
797
|
// $arg string: The JSON string
|
|
796
798
|
// $return: The object
|
|
@@ -805,7 +807,7 @@ const jsonParseArgs = valueArgsModel([
|
|
|
805
807
|
|
|
806
808
|
|
|
807
809
|
// $function: jsonStringify
|
|
808
|
-
// $group:
|
|
810
|
+
// $group: json
|
|
809
811
|
// $doc: Convert an object to a JSON string
|
|
810
812
|
// $arg value: The object
|
|
811
813
|
// $arg indent: Optional (default is null). The indentation number.
|
|
@@ -827,7 +829,7 @@ const jsonStringifyArgs = valueArgsModel([
|
|
|
827
829
|
|
|
828
830
|
|
|
829
831
|
// $function: mathAbs
|
|
830
|
-
// $group:
|
|
832
|
+
// $group: math
|
|
831
833
|
// $doc: Compute the absolute value of a number
|
|
832
834
|
// $arg x: The number
|
|
833
835
|
// $return: The absolute value of the number
|
|
@@ -842,7 +844,7 @@ const mathAbsArgs = valueArgsModel([
|
|
|
842
844
|
|
|
843
845
|
|
|
844
846
|
// $function: mathAcos
|
|
845
|
-
// $group:
|
|
847
|
+
// $group: math
|
|
846
848
|
// $doc: Compute the arccosine, in radians, of a number
|
|
847
849
|
// $arg x: The number
|
|
848
850
|
// $return: The arccosine, in radians, of the number
|
|
@@ -857,7 +859,7 @@ const mathAcosArgs = valueArgsModel([
|
|
|
857
859
|
|
|
858
860
|
|
|
859
861
|
// $function: mathAsin
|
|
860
|
-
// $group:
|
|
862
|
+
// $group: math
|
|
861
863
|
// $doc: Compute the arcsine, in radians, of a number
|
|
862
864
|
// $arg x: The number
|
|
863
865
|
// $return: The arcsine, in radians, of the number
|
|
@@ -872,7 +874,7 @@ const mathAsinArgs = valueArgsModel([
|
|
|
872
874
|
|
|
873
875
|
|
|
874
876
|
// $function: mathAtan
|
|
875
|
-
// $group:
|
|
877
|
+
// $group: math
|
|
876
878
|
// $doc: Compute the arctangent, in radians, of a number
|
|
877
879
|
// $arg x: The number
|
|
878
880
|
// $return: The arctangent, in radians, of the number
|
|
@@ -887,7 +889,7 @@ const mathAtanArgs = valueArgsModel([
|
|
|
887
889
|
|
|
888
890
|
|
|
889
891
|
// $function: mathAtan2
|
|
890
|
-
// $group:
|
|
892
|
+
// $group: math
|
|
891
893
|
// $doc: Compute the angle, in radians, between (0, 0) and a point
|
|
892
894
|
// $arg y: The Y-coordinate of the point
|
|
893
895
|
// $arg x: The X-coordinate of the point
|
|
@@ -904,7 +906,7 @@ const mathAtan2Args = valueArgsModel([
|
|
|
904
906
|
|
|
905
907
|
|
|
906
908
|
// $function: mathCeil
|
|
907
|
-
// $group:
|
|
909
|
+
// $group: math
|
|
908
910
|
// $doc: Compute the ceiling of a number (round up to the next highest integer)
|
|
909
911
|
// $arg x: The number
|
|
910
912
|
// $return: The ceiling of the number
|
|
@@ -919,7 +921,7 @@ const mathCeilArgs = valueArgsModel([
|
|
|
919
921
|
|
|
920
922
|
|
|
921
923
|
// $function: mathCos
|
|
922
|
-
// $group:
|
|
924
|
+
// $group: math
|
|
923
925
|
// $doc: Compute the cosine of an angle, in radians
|
|
924
926
|
// $arg x: The angle, in radians
|
|
925
927
|
// $return: The cosine of the angle
|
|
@@ -934,7 +936,7 @@ const mathCosArgs = valueArgsModel([
|
|
|
934
936
|
|
|
935
937
|
|
|
936
938
|
// $function: mathFloor
|
|
937
|
-
// $group:
|
|
939
|
+
// $group: math
|
|
938
940
|
// $doc: Compute the floor of a number (round down to the next lowest integer)
|
|
939
941
|
// $arg x: The number
|
|
940
942
|
// $return: The floor of the number
|
|
@@ -949,7 +951,7 @@ const mathFloorArgs = valueArgsModel([
|
|
|
949
951
|
|
|
950
952
|
|
|
951
953
|
// $function: mathLn
|
|
952
|
-
// $group:
|
|
954
|
+
// $group: math
|
|
953
955
|
// $doc: Compute the natural logarithm (base e) of a number
|
|
954
956
|
// $arg x: The number
|
|
955
957
|
// $return: The natural logarithm of the number
|
|
@@ -964,7 +966,7 @@ const mathLnArgs = valueArgsModel([
|
|
|
964
966
|
|
|
965
967
|
|
|
966
968
|
// $function: mathLog
|
|
967
|
-
// $group:
|
|
969
|
+
// $group: math
|
|
968
970
|
// $doc: Compute the logarithm (base 10) of a number
|
|
969
971
|
// $arg x: The number
|
|
970
972
|
// $arg base: Optional (default is 10). The logarithm base.
|
|
@@ -985,7 +987,7 @@ const mathLogArgs = valueArgsModel([
|
|
|
985
987
|
|
|
986
988
|
|
|
987
989
|
// $function: mathMax
|
|
988
|
-
// $group:
|
|
990
|
+
// $group: math
|
|
989
991
|
// $doc: Compute the maximum value
|
|
990
992
|
// $arg values...: The values
|
|
991
993
|
// $return: The maximum value
|
|
@@ -1001,7 +1003,7 @@ function mathMax(values) {
|
|
|
1001
1003
|
|
|
1002
1004
|
|
|
1003
1005
|
// $function: mathMin
|
|
1004
|
-
// $group:
|
|
1006
|
+
// $group: math
|
|
1005
1007
|
// $doc: Compute the minimum value
|
|
1006
1008
|
// $arg values...: The values
|
|
1007
1009
|
// $return: The minimum value
|
|
@@ -1017,7 +1019,7 @@ function mathMin(values) {
|
|
|
1017
1019
|
|
|
1018
1020
|
|
|
1019
1021
|
// $function: mathPi
|
|
1020
|
-
// $group:
|
|
1022
|
+
// $group: math
|
|
1021
1023
|
// $doc: Return the number pi
|
|
1022
1024
|
// $return: The number pi
|
|
1023
1025
|
function mathPi() {
|
|
@@ -1026,7 +1028,7 @@ function mathPi() {
|
|
|
1026
1028
|
|
|
1027
1029
|
|
|
1028
1030
|
// $function: mathRandom
|
|
1029
|
-
// $group:
|
|
1031
|
+
// $group: math
|
|
1030
1032
|
// $doc: Compute a random number between 0 and 1, inclusive
|
|
1031
1033
|
// $return: A random number
|
|
1032
1034
|
function mathRandom() {
|
|
@@ -1035,7 +1037,7 @@ function mathRandom() {
|
|
|
1035
1037
|
|
|
1036
1038
|
|
|
1037
1039
|
// $function: mathRound
|
|
1038
|
-
// $group:
|
|
1040
|
+
// $group: math
|
|
1039
1041
|
// $doc: Round a number to a certain number of decimal places
|
|
1040
1042
|
// $arg x: The number
|
|
1041
1043
|
// $arg digits: Optional (default is 0). The number of decimal digits to round to.
|
|
@@ -1052,7 +1054,7 @@ const mathRoundArgs = valueArgsModel([
|
|
|
1052
1054
|
|
|
1053
1055
|
|
|
1054
1056
|
// $function: mathSign
|
|
1055
|
-
// $group:
|
|
1057
|
+
// $group: math
|
|
1056
1058
|
// $doc: Compute the sign of a number
|
|
1057
1059
|
// $arg x: The number
|
|
1058
1060
|
// $return: -1 for a negative number, 1 for a positive number, and 0 for zero
|
|
@@ -1067,7 +1069,7 @@ const mathSignArgs = valueArgsModel([
|
|
|
1067
1069
|
|
|
1068
1070
|
|
|
1069
1071
|
// $function: mathSin
|
|
1070
|
-
// $group:
|
|
1072
|
+
// $group: math
|
|
1071
1073
|
// $doc: Compute the sine of an angle, in radians
|
|
1072
1074
|
// $arg x: The angle, in radians
|
|
1073
1075
|
// $return: The sine of the angle
|
|
@@ -1082,7 +1084,7 @@ const mathSinArgs = valueArgsModel([
|
|
|
1082
1084
|
|
|
1083
1085
|
|
|
1084
1086
|
// $function: mathSqrt
|
|
1085
|
-
// $group:
|
|
1087
|
+
// $group: math
|
|
1086
1088
|
// $doc: Compute the square root of a number
|
|
1087
1089
|
// $arg x: The number
|
|
1088
1090
|
// $return: The square root of the number
|
|
@@ -1097,7 +1099,7 @@ const mathSqrtArgs = valueArgsModel([
|
|
|
1097
1099
|
|
|
1098
1100
|
|
|
1099
1101
|
// $function: mathTan
|
|
1100
|
-
// $group:
|
|
1102
|
+
// $group: math
|
|
1101
1103
|
// $doc: Compute the tangent of an angle, in radians
|
|
1102
1104
|
// $arg x: The angle, in radians
|
|
1103
1105
|
// $return: The tangent of the angle
|
|
@@ -1117,7 +1119,7 @@ const mathTanArgs = valueArgsModel([
|
|
|
1117
1119
|
|
|
1118
1120
|
|
|
1119
1121
|
// $function: numberParseFloat
|
|
1120
|
-
// $group:
|
|
1122
|
+
// $group: number
|
|
1121
1123
|
// $doc: Parse a string as a floating point number
|
|
1122
1124
|
// $arg string: The string
|
|
1123
1125
|
// $return: The number
|
|
@@ -1132,7 +1134,7 @@ const numberParseFloatArgs = valueArgsModel([
|
|
|
1132
1134
|
|
|
1133
1135
|
|
|
1134
1136
|
// $function: numberParseInt
|
|
1135
|
-
// $group:
|
|
1137
|
+
// $group: number
|
|
1136
1138
|
// $doc: Parse a string as an integer
|
|
1137
1139
|
// $arg string: The string
|
|
1138
1140
|
// $arg radix: Optional (default is 10). The number base.
|
|
@@ -1149,7 +1151,7 @@ const numberParseIntArgs = valueArgsModel([
|
|
|
1149
1151
|
|
|
1150
1152
|
|
|
1151
1153
|
// $function: numberToFixed
|
|
1152
|
-
// $group:
|
|
1154
|
+
// $group: number
|
|
1153
1155
|
// $doc: Format a number using fixed-point notation
|
|
1154
1156
|
// $arg x: The number
|
|
1155
1157
|
// $arg digits: Optional (default is 2). The number of digits to appear after the decimal point.
|
|
@@ -1179,7 +1181,7 @@ const rNumberCleanup = /\.0*$/;
|
|
|
1179
1181
|
|
|
1180
1182
|
|
|
1181
1183
|
// $function: objectAssign
|
|
1182
|
-
// $group:
|
|
1184
|
+
// $group: object
|
|
1183
1185
|
// $doc: Assign the keys/values of one object to another
|
|
1184
1186
|
// $arg object: The object to assign to
|
|
1185
1187
|
// $arg object2: The object to assign
|
|
@@ -1197,7 +1199,7 @@ const objectAssignArgs = valueArgsModel([
|
|
|
1197
1199
|
|
|
1198
1200
|
|
|
1199
1201
|
// $function: objectCopy
|
|
1200
|
-
// $group:
|
|
1202
|
+
// $group: object
|
|
1201
1203
|
// $doc: Create a copy of an object
|
|
1202
1204
|
// $arg object: The object to copy
|
|
1203
1205
|
// $return: The object copy
|
|
@@ -1212,7 +1214,7 @@ const objectCopyArgs = valueArgsModel([
|
|
|
1212
1214
|
|
|
1213
1215
|
|
|
1214
1216
|
// $function: objectDelete
|
|
1215
|
-
// $group:
|
|
1217
|
+
// $group: object
|
|
1216
1218
|
// $doc: Delete an object key
|
|
1217
1219
|
// $arg object: The object
|
|
1218
1220
|
// $arg key: The key to delete
|
|
@@ -1228,7 +1230,7 @@ const objectDeleteArgs = valueArgsModel([
|
|
|
1228
1230
|
|
|
1229
1231
|
|
|
1230
1232
|
// $function: objectGet
|
|
1231
|
-
// $group:
|
|
1233
|
+
// $group: object
|
|
1232
1234
|
// $doc: Get an object key's value
|
|
1233
1235
|
// $arg object: The object
|
|
1234
1236
|
// $arg key: The key
|
|
@@ -1248,7 +1250,7 @@ const objectGetArgs = valueArgsModel([
|
|
|
1248
1250
|
|
|
1249
1251
|
|
|
1250
1252
|
// $function: objectHas
|
|
1251
|
-
// $group:
|
|
1253
|
+
// $group: object
|
|
1252
1254
|
// $doc: Test if an object contains a key
|
|
1253
1255
|
// $arg object: The object
|
|
1254
1256
|
// $arg key: The key
|
|
@@ -1265,7 +1267,7 @@ const objectHasArgs = valueArgsModel([
|
|
|
1265
1267
|
|
|
1266
1268
|
|
|
1267
1269
|
// $function: objectKeys
|
|
1268
|
-
// $group:
|
|
1270
|
+
// $group: object
|
|
1269
1271
|
// $doc: Get an object's keys
|
|
1270
1272
|
// $arg object: The object
|
|
1271
1273
|
// $return: The array of keys
|
|
@@ -1280,7 +1282,7 @@ const objectKeysArgs = valueArgsModel([
|
|
|
1280
1282
|
|
|
1281
1283
|
|
|
1282
1284
|
// $function: objectNew
|
|
1283
|
-
// $group:
|
|
1285
|
+
// $group: object
|
|
1284
1286
|
// $doc: Create a new object
|
|
1285
1287
|
// $arg keyValues...: The object's initial key and value pairs
|
|
1286
1288
|
// $return: The new object
|
|
@@ -1299,7 +1301,7 @@ function objectNew(keyValues) {
|
|
|
1299
1301
|
|
|
1300
1302
|
|
|
1301
1303
|
// $function: objectSet
|
|
1302
|
-
// $group:
|
|
1304
|
+
// $group: object
|
|
1303
1305
|
// $doc: Set an object key's value
|
|
1304
1306
|
// $arg object: The object
|
|
1305
1307
|
// $arg key: The key
|
|
@@ -1324,7 +1326,7 @@ const objectSetArgs = valueArgsModel([
|
|
|
1324
1326
|
|
|
1325
1327
|
|
|
1326
1328
|
// $function: regexEscape
|
|
1327
|
-
// $group:
|
|
1329
|
+
// $group: regex
|
|
1328
1330
|
// $doc: Escape a string for use in a regular expression
|
|
1329
1331
|
// $arg string: The string to escape
|
|
1330
1332
|
// $return: The escaped string
|
|
@@ -1341,7 +1343,7 @@ const rRegexEscape = /[.*+?^${}()|[\]\\]/g;
|
|
|
1341
1343
|
|
|
1342
1344
|
|
|
1343
1345
|
// $function: regexMatch
|
|
1344
|
-
// $group:
|
|
1346
|
+
// $group: regex
|
|
1345
1347
|
// $doc: Find the first match of a regular expression in a string
|
|
1346
1348
|
// $arg regex: The regular expression
|
|
1347
1349
|
// $arg string: The string
|
|
@@ -1360,7 +1362,7 @@ const regexMatchArgs = valueArgsModel([
|
|
|
1360
1362
|
|
|
1361
1363
|
|
|
1362
1364
|
// $function: regexMatchAll
|
|
1363
|
-
// $group:
|
|
1365
|
+
// $group: regex
|
|
1364
1366
|
// $doc: Find all matches of regular expression in a string
|
|
1365
1367
|
// $arg regex: The regular expression
|
|
1366
1368
|
// $arg string: The string
|
|
@@ -1443,7 +1445,7 @@ struct RegexMatch
|
|
|
1443
1445
|
|
|
1444
1446
|
|
|
1445
1447
|
// $function: regexNew
|
|
1446
|
-
// $group:
|
|
1448
|
+
// $group: regex
|
|
1447
1449
|
// $doc: Create a regular expression
|
|
1448
1450
|
// eslint-disable-next-line max-len
|
|
1449
1451
|
// $arg pattern: The [regular expression pattern string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions#writing_a_regular_expression_pattern)
|
|
@@ -1474,7 +1476,7 @@ const regexNewArgs = valueArgsModel([
|
|
|
1474
1476
|
|
|
1475
1477
|
|
|
1476
1478
|
// $function: regexReplace
|
|
1477
|
-
// $group:
|
|
1479
|
+
// $group: regex
|
|
1478
1480
|
// $doc: Replace regular expression matches with a string
|
|
1479
1481
|
// $arg regex: The replacement regular expression
|
|
1480
1482
|
// $arg string: The string
|
|
@@ -1494,7 +1496,7 @@ const regexReplaceArgs = valueArgsModel([
|
|
|
1494
1496
|
|
|
1495
1497
|
|
|
1496
1498
|
// $function: regexSplit
|
|
1497
|
-
// $group:
|
|
1499
|
+
// $group: regex
|
|
1498
1500
|
// $doc: Split a string with a regular expression
|
|
1499
1501
|
// $arg regex: The regular expression
|
|
1500
1502
|
// $arg string: The string
|
|
@@ -1516,7 +1518,7 @@ const regexSplitArgs = valueArgsModel([
|
|
|
1516
1518
|
|
|
1517
1519
|
|
|
1518
1520
|
// $function: schemaParse
|
|
1519
|
-
// $group:
|
|
1521
|
+
// $group: schema
|
|
1520
1522
|
// $doc: Parse the [Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/) text
|
|
1521
1523
|
// $arg lines...: The [Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/)
|
|
1522
1524
|
// $arg lines...: text lines (may contain nested arrays of un-split lines)
|
|
@@ -1527,7 +1529,7 @@ function schemaParse(lines) {
|
|
|
1527
1529
|
|
|
1528
1530
|
|
|
1529
1531
|
// $function: schemaParseEx
|
|
1530
|
-
// $group:
|
|
1532
|
+
// $group: schema
|
|
1531
1533
|
// $doc: Parse the [Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/) text with options
|
|
1532
1534
|
// $arg lines: The array of [Schema Markdown](https://craigahobbs.github.io/schema-markdown-js/language/)
|
|
1533
1535
|
// $arg lines: text lines (may contain nested arrays of un-split lines)
|
|
@@ -1553,7 +1555,7 @@ const schemaParseExArgs = valueArgsModel([
|
|
|
1553
1555
|
|
|
1554
1556
|
|
|
1555
1557
|
// $function: schemaTypeModel
|
|
1556
|
-
// $group:
|
|
1558
|
+
// $group: schema
|
|
1557
1559
|
// $doc: Get the [Schema Markdown Type Model](https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types')
|
|
1558
1560
|
// $return: The [Schema Markdown Type Model](https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types')
|
|
1559
1561
|
function schemaTypeModel() {
|
|
@@ -1562,7 +1564,7 @@ function schemaTypeModel() {
|
|
|
1562
1564
|
|
|
1563
1565
|
|
|
1564
1566
|
// $function: schemaValidate
|
|
1565
|
-
// $group:
|
|
1567
|
+
// $group: schema
|
|
1566
1568
|
// $doc: Validate an object to a schema type
|
|
1567
1569
|
// $arg types: The [type model](https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types')
|
|
1568
1570
|
// $arg typeName: The type name
|
|
@@ -1582,7 +1584,7 @@ const schemaValidateArgs = valueArgsModel([
|
|
|
1582
1584
|
|
|
1583
1585
|
|
|
1584
1586
|
// $function: schemaValidateTypeModel
|
|
1585
|
-
// $group:
|
|
1587
|
+
// $group: schema
|
|
1586
1588
|
// $doc: Validate a [Schema Markdown Type Model](https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types')
|
|
1587
1589
|
// $arg types: The [type model](https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types') to validate
|
|
1588
1590
|
// $return: The validated [type model](https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types')
|
|
@@ -1602,7 +1604,7 @@ const schemaValidateTypeModelArgs = valueArgsModel([
|
|
|
1602
1604
|
|
|
1603
1605
|
|
|
1604
1606
|
// $function: stringCharCodeAt
|
|
1605
|
-
// $group:
|
|
1607
|
+
// $group: string
|
|
1606
1608
|
// $doc: Get a string index's character code
|
|
1607
1609
|
// $arg string: The string
|
|
1608
1610
|
// $arg index: The character index
|
|
@@ -1623,7 +1625,7 @@ const stringCharCodeAtArgs = valueArgsModel([
|
|
|
1623
1625
|
|
|
1624
1626
|
|
|
1625
1627
|
// $function: stringEndsWith
|
|
1626
|
-
// $group:
|
|
1628
|
+
// $group: string
|
|
1627
1629
|
// $doc: Determine if a string ends with a search string
|
|
1628
1630
|
// $arg string: The string
|
|
1629
1631
|
// $arg search: The search string
|
|
@@ -1640,7 +1642,7 @@ const stringEndsWithArgs = valueArgsModel([
|
|
|
1640
1642
|
|
|
1641
1643
|
|
|
1642
1644
|
// $function: stringFromCharCode
|
|
1643
|
-
// $group:
|
|
1645
|
+
// $group: string
|
|
1644
1646
|
// $doc: Create a string of characters from character codes
|
|
1645
1647
|
// $arg charCodes...: The character codes
|
|
1646
1648
|
// $return: The string of characters
|
|
@@ -1656,7 +1658,7 @@ function stringFromCharCode(charCodes) {
|
|
|
1656
1658
|
|
|
1657
1659
|
|
|
1658
1660
|
// $function: stringIndexOf
|
|
1659
|
-
// $group:
|
|
1661
|
+
// $group: string
|
|
1660
1662
|
// $doc: Find the first index of a search string in a string
|
|
1661
1663
|
// $arg string: The string
|
|
1662
1664
|
// $arg search: The search string
|
|
@@ -1679,7 +1681,7 @@ const stringIndexOfArgs = valueArgsModel([
|
|
|
1679
1681
|
|
|
1680
1682
|
|
|
1681
1683
|
// $function: stringLastIndexOf
|
|
1682
|
-
// $group:
|
|
1684
|
+
// $group: string
|
|
1683
1685
|
// $doc: Find the last index of a search string in a string
|
|
1684
1686
|
// $arg string: The string
|
|
1685
1687
|
// $arg search: The search string
|
|
@@ -1703,7 +1705,7 @@ const stringLastIndexOfArgs = valueArgsModel([
|
|
|
1703
1705
|
|
|
1704
1706
|
|
|
1705
1707
|
// $function: stringLength
|
|
1706
|
-
// $group:
|
|
1708
|
+
// $group: string
|
|
1707
1709
|
// $doc: Get the length of a string
|
|
1708
1710
|
// $arg string: The string
|
|
1709
1711
|
// $return: The string's length; zero if not a string
|
|
@@ -1718,7 +1720,7 @@ const stringLengthArgs = valueArgsModel([
|
|
|
1718
1720
|
|
|
1719
1721
|
|
|
1720
1722
|
// $function: stringLower
|
|
1721
|
-
// $group:
|
|
1723
|
+
// $group: string
|
|
1722
1724
|
// $doc: Convert a string to lower-case
|
|
1723
1725
|
// $arg string: The string
|
|
1724
1726
|
// $return: The lower-case string
|
|
@@ -1733,7 +1735,7 @@ const stringLowerArgs = valueArgsModel([
|
|
|
1733
1735
|
|
|
1734
1736
|
|
|
1735
1737
|
// $function: stringNew
|
|
1736
|
-
// $group:
|
|
1738
|
+
// $group: string
|
|
1737
1739
|
// $doc: Create a new string from a value
|
|
1738
1740
|
// $arg value: The value
|
|
1739
1741
|
// $return: The new string
|
|
@@ -1743,7 +1745,7 @@ function stringNew([value = null]) {
|
|
|
1743
1745
|
|
|
1744
1746
|
|
|
1745
1747
|
// $function: stringRepeat
|
|
1746
|
-
// $group:
|
|
1748
|
+
// $group: string
|
|
1747
1749
|
// $doc: Repeat a string
|
|
1748
1750
|
// $arg string: The string to repeat
|
|
1749
1751
|
// $arg count: The number of times to repeat the string
|
|
@@ -1760,7 +1762,7 @@ const stringRepeatArgs = valueArgsModel([
|
|
|
1760
1762
|
|
|
1761
1763
|
|
|
1762
1764
|
// $function: stringReplace
|
|
1763
|
-
// $group:
|
|
1765
|
+
// $group: string
|
|
1764
1766
|
// $doc: Replace all instances of a string with another string
|
|
1765
1767
|
// $arg string: The string to update
|
|
1766
1768
|
// $arg substr: The string to replace
|
|
@@ -1779,7 +1781,7 @@ const stringReplaceArgs = valueArgsModel([
|
|
|
1779
1781
|
|
|
1780
1782
|
|
|
1781
1783
|
// $function: stringSlice
|
|
1782
|
-
// $group:
|
|
1784
|
+
// $group: string
|
|
1783
1785
|
// $doc: Copy a portion of a string
|
|
1784
1786
|
// $arg string: The string
|
|
1785
1787
|
// $arg start: The start index of the slice
|
|
@@ -1806,7 +1808,7 @@ const stringSliceArgs = valueArgsModel([
|
|
|
1806
1808
|
|
|
1807
1809
|
|
|
1808
1810
|
// $function: stringSplit
|
|
1809
|
-
// $group:
|
|
1811
|
+
// $group: string
|
|
1810
1812
|
// $doc: Split a string
|
|
1811
1813
|
// $arg string: The string to split
|
|
1812
1814
|
// $arg separator: The separator string
|
|
@@ -1823,7 +1825,7 @@ const stringSplitArgs = valueArgsModel([
|
|
|
1823
1825
|
|
|
1824
1826
|
|
|
1825
1827
|
// $function: stringStartsWith
|
|
1826
|
-
// $group:
|
|
1828
|
+
// $group: string
|
|
1827
1829
|
// $doc: Determine if a string starts with a search string
|
|
1828
1830
|
// $arg string: The string
|
|
1829
1831
|
// $arg search: The search string
|
|
@@ -1840,7 +1842,7 @@ const stringStartsWithArgs = valueArgsModel([
|
|
|
1840
1842
|
|
|
1841
1843
|
|
|
1842
1844
|
// $function: stringTrim
|
|
1843
|
-
// $group:
|
|
1845
|
+
// $group: string
|
|
1844
1846
|
// $doc: Trim the whitespace from the beginning and end of a string
|
|
1845
1847
|
// $arg string: The string
|
|
1846
1848
|
// $return: The trimmed string
|
|
@@ -1855,7 +1857,7 @@ const stringTrimArgs = valueArgsModel([
|
|
|
1855
1857
|
|
|
1856
1858
|
|
|
1857
1859
|
// $function: stringUpper
|
|
1858
|
-
// $group:
|
|
1860
|
+
// $group: string
|
|
1859
1861
|
// $doc: Convert a string to upper-case
|
|
1860
1862
|
// $arg string: The string
|
|
1861
1863
|
// $return: The upper-case string
|
|
@@ -1875,7 +1877,7 @@ const stringUpperArgs = valueArgsModel([
|
|
|
1875
1877
|
|
|
1876
1878
|
|
|
1877
1879
|
// $function: systemBoolean
|
|
1878
|
-
// $group:
|
|
1880
|
+
// $group: system
|
|
1879
1881
|
// $doc: Interpret a value as a boolean
|
|
1880
1882
|
// $arg value: The value
|
|
1881
1883
|
// $return: true or false
|
|
@@ -1885,7 +1887,7 @@ function systemBoolean([value = null]) {
|
|
|
1885
1887
|
|
|
1886
1888
|
|
|
1887
1889
|
// $function: systemCompare
|
|
1888
|
-
// $group:
|
|
1890
|
+
// $group: system
|
|
1889
1891
|
// $doc: Compare two values
|
|
1890
1892
|
// $arg left: The left value
|
|
1891
1893
|
// $arg right: The right value
|
|
@@ -1896,7 +1898,7 @@ function systemCompare([left = null, right = null]) {
|
|
|
1896
1898
|
|
|
1897
1899
|
|
|
1898
1900
|
// $function: systemFetch
|
|
1899
|
-
// $group:
|
|
1901
|
+
// $group: system
|
|
1900
1902
|
// $doc: Retrieve a URL resource
|
|
1901
1903
|
// $arg url: The resource URL,
|
|
1902
1904
|
// $arg url: [request model](https://craigahobbs.github.io/bare-script/library/model.html#var.vName='SystemFetchRequest'),
|
|
@@ -1992,7 +1994,7 @@ export const systemGlobalIncludesName = '__bareScriptIncludes';
|
|
|
1992
1994
|
|
|
1993
1995
|
|
|
1994
1996
|
// $function: systemGlobalIncludesGet
|
|
1995
|
-
// $group:
|
|
1997
|
+
// $group: system
|
|
1996
1998
|
// $doc: Get the global system includes object
|
|
1997
1999
|
// $return: The global system includes object
|
|
1998
2000
|
function systemGlobalIncludesGet(unusedArgs, options) {
|
|
@@ -2002,7 +2004,7 @@ function systemGlobalIncludesGet(unusedArgs, options) {
|
|
|
2002
2004
|
|
|
2003
2005
|
|
|
2004
2006
|
// $function: systemGlobalIncludesName
|
|
2005
|
-
// $group:
|
|
2007
|
+
// $group: system
|
|
2006
2008
|
// $doc: Get the system includes object global variable name
|
|
2007
2009
|
// $return: The system includes object global variable name
|
|
2008
2010
|
function systemGlobalIncludesNameFn() {
|
|
@@ -2011,7 +2013,7 @@ function systemGlobalIncludesNameFn() {
|
|
|
2011
2013
|
|
|
2012
2014
|
|
|
2013
2015
|
// $function: systemGlobalGet
|
|
2014
|
-
// $group:
|
|
2016
|
+
// $group: system
|
|
2015
2017
|
// $doc: Get a global variable value
|
|
2016
2018
|
// $arg name: The global variable name
|
|
2017
2019
|
// $arg defaultValue: The default value (optional)
|
|
@@ -2029,7 +2031,7 @@ const systemGlobalGetArgs = valueArgsModel([
|
|
|
2029
2031
|
|
|
2030
2032
|
|
|
2031
2033
|
// $function: systemGlobalSet
|
|
2032
|
-
// $group:
|
|
2034
|
+
// $group: system
|
|
2033
2035
|
// $doc: Set a global variable value
|
|
2034
2036
|
// $arg name: The global variable name
|
|
2035
2037
|
// $arg value: The global variable's value
|
|
@@ -2050,7 +2052,7 @@ const systemGlobalSetArgs = valueArgsModel([
|
|
|
2050
2052
|
|
|
2051
2053
|
|
|
2052
2054
|
// $function: systemIs
|
|
2053
|
-
// $group:
|
|
2055
|
+
// $group: system
|
|
2054
2056
|
// $doc: Test if one value is the same object as another
|
|
2055
2057
|
// $arg value1: The first value
|
|
2056
2058
|
// $arg value2: The second value
|
|
@@ -2061,7 +2063,7 @@ function systemIs([value1 = null, value2 = null]) {
|
|
|
2061
2063
|
|
|
2062
2064
|
|
|
2063
2065
|
// $function: systemLog
|
|
2064
|
-
// $group:
|
|
2066
|
+
// $group: system
|
|
2065
2067
|
// $doc: Log a message to the console
|
|
2066
2068
|
// $arg message: The log message
|
|
2067
2069
|
function systemLog([message = null], options) {
|
|
@@ -2072,7 +2074,7 @@ function systemLog([message = null], options) {
|
|
|
2072
2074
|
|
|
2073
2075
|
|
|
2074
2076
|
// $function: systemLogDebug
|
|
2075
|
-
// $group:
|
|
2077
|
+
// $group: system
|
|
2076
2078
|
// $doc: Log a message to the console, if in debug mode
|
|
2077
2079
|
// $arg message: The log message
|
|
2078
2080
|
function systemLogDebug([message = null], options) {
|
|
@@ -2083,7 +2085,7 @@ function systemLogDebug([message = null], options) {
|
|
|
2083
2085
|
|
|
2084
2086
|
|
|
2085
2087
|
// $function: systemPartial
|
|
2086
|
-
// $group:
|
|
2088
|
+
// $group: system
|
|
2087
2089
|
// $doc: Return a new function which behaves like "func" called with "args".
|
|
2088
2090
|
// $doc: If additional arguments are passed to the returned function, they are appended to "args".
|
|
2089
2091
|
// $arg func: The function
|
|
@@ -2109,7 +2111,7 @@ const systemPartialArgs = valueArgsModel([
|
|
|
2109
2111
|
|
|
2110
2112
|
|
|
2111
2113
|
// $function: systemType
|
|
2112
|
-
// $group:
|
|
2114
|
+
// $group: system
|
|
2113
2115
|
// $doc: Get a value's type string
|
|
2114
2116
|
// $arg value: The value
|
|
2115
2117
|
// $return: The type string of the value.
|
|
@@ -2125,7 +2127,7 @@ function systemType([value = null]) {
|
|
|
2125
2127
|
|
|
2126
2128
|
|
|
2127
2129
|
// $function: urlEncode
|
|
2128
|
-
// $group:
|
|
2130
|
+
// $group: url
|
|
2129
2131
|
// $doc: Encode a URL
|
|
2130
2132
|
// $arg url: The URL string
|
|
2131
2133
|
// $return: The encoded URL string
|
|
@@ -2146,7 +2148,7 @@ const urlEncodeArgs = valueArgsModel([
|
|
|
2146
2148
|
|
|
2147
2149
|
|
|
2148
2150
|
// $function: urlEncodeComponent
|
|
2149
|
-
// $group:
|
|
2151
|
+
// $group: url
|
|
2150
2152
|
// $doc: Encode a URL component
|
|
2151
2153
|
// $arg url: The URL component string
|
|
2152
2154
|
// $return: The encoded URL component string
|