@budibase/string-templates 3.2.5 → 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
package/src/manifest.json DELETED
@@ -1,1364 +0,0 @@
1
- {
2
- "math": {
3
- "abs": {
4
- "args": [
5
- "a"
6
- ],
7
- "numArgs": 1,
8
- "example": "{{ abs 12012.1000 }} -> 12012.1",
9
- "description": "<p>Return the magnitude of <code>a</code>.</p>\n",
10
- "requiresBlock": false
11
- },
12
- "add": {
13
- "args": [
14
- "a",
15
- "b"
16
- ],
17
- "numArgs": 2,
18
- "example": "{{ add 1 2 }} -> 3",
19
- "description": "<p>Return the sum of <code>a</code> plus <code>b</code>.</p>\n",
20
- "requiresBlock": false
21
- },
22
- "avg": {
23
- "args": [
24
- "array"
25
- ],
26
- "numArgs": 1,
27
- "example": "{{ avg 1 2 3 4 5 }} -> 3",
28
- "description": "<p>Returns the average of all numbers in the given array.</p>\n",
29
- "requiresBlock": false
30
- },
31
- "ceil": {
32
- "args": [
33
- "value"
34
- ],
35
- "numArgs": 1,
36
- "example": "{{ ceil 1.2 }} -> 2",
37
- "description": "<p>Get the <code>Math.ceil()</code> of the given value.</p>\n",
38
- "requiresBlock": false
39
- },
40
- "divide": {
41
- "args": [
42
- "a",
43
- "b"
44
- ],
45
- "numArgs": 2,
46
- "example": "{{ divide 10 5 }} -> 2",
47
- "description": "<p>Divide <code>a</code> by <code>b</code></p>\n",
48
- "requiresBlock": false
49
- },
50
- "floor": {
51
- "args": [
52
- "value"
53
- ],
54
- "numArgs": 1,
55
- "example": "{{ floor 1.2 }} -> 1",
56
- "description": "<p>Get the <code>Math.floor()</code> of the given value.</p>\n",
57
- "requiresBlock": false
58
- },
59
- "minus": {
60
- "args": [
61
- "a",
62
- "b"
63
- ],
64
- "numArgs": 2,
65
- "example": "{{ subtract 10 5 }} -> 5",
66
- "description": "<p>Return the product of <code>a</code> minus <code>b</code>.</p>\n",
67
- "requiresBlock": false
68
- },
69
- "modulo": {
70
- "args": [
71
- "a",
72
- "b"
73
- ],
74
- "numArgs": 2,
75
- "example": "{{ modulo 10 5 }} -> 0",
76
- "description": "<p>Get the remainder of a division operation.</p>\n",
77
- "requiresBlock": false
78
- },
79
- "multiply": {
80
- "args": [
81
- "a",
82
- "b"
83
- ],
84
- "numArgs": 2,
85
- "example": "{{ multiply 10 5 }} -> 50",
86
- "description": "<p>Multiply number <code>a</code> by number <code>b</code>.</p>\n",
87
- "requiresBlock": false
88
- },
89
- "plus": {
90
- "args": [
91
- "a",
92
- "b"
93
- ],
94
- "numArgs": 2,
95
- "example": "{{ plus 10 5 }} -> 15",
96
- "description": "<p>Add <code>a</code> by <code>b</code>.</p>\n",
97
- "requiresBlock": false
98
- },
99
- "random": {
100
- "args": [
101
- "min",
102
- "max"
103
- ],
104
- "numArgs": 2,
105
- "example": "{{ random 0 20 }} -> 10",
106
- "description": "<p>Generate a random number between two values</p>\n",
107
- "requiresBlock": false
108
- },
109
- "remainder": {
110
- "args": [
111
- "a",
112
- "b"
113
- ],
114
- "numArgs": 2,
115
- "example": "{{ remainder 10 6 }} -> 4",
116
- "description": "<p>Get the remainder when <code>a</code> is divided by <code>b</code>.</p>\n",
117
- "requiresBlock": false
118
- },
119
- "round": {
120
- "args": [
121
- "number"
122
- ],
123
- "numArgs": 1,
124
- "example": "{{ round 10.3 }} -> 10",
125
- "description": "<p>Round the given number.</p>\n",
126
- "requiresBlock": false
127
- },
128
- "subtract": {
129
- "args": [
130
- "a",
131
- "b"
132
- ],
133
- "numArgs": 2,
134
- "example": "{{ subtract 10 5 }} -> 5",
135
- "description": "<p>Return the product of <code>a</code> minus <code>b</code>.</p>\n",
136
- "requiresBlock": false
137
- },
138
- "sum": {
139
- "args": [
140
- "array"
141
- ],
142
- "numArgs": 1,
143
- "example": "{{ sum [1, 2, 3] }} -> 6",
144
- "description": "<p>Returns the sum of all numbers in the given array.</p>\n",
145
- "requiresBlock": false
146
- }
147
- },
148
- "array": {
149
- "after": {
150
- "args": [
151
- "array",
152
- "n"
153
- ],
154
- "numArgs": 2,
155
- "example": "{{ after ['a', 'b', 'c', 'd'] 2}} -> ['c', 'd']",
156
- "description": "<p>Returns all of the items in an array after the specified index. Opposite of <a href=\"#before\">before</a>.</p>\n",
157
- "requiresBlock": false
158
- },
159
- "arrayify": {
160
- "args": [
161
- "value"
162
- ],
163
- "numArgs": 1,
164
- "example": "{{ arrayify 'foo' }} -> ['foo']",
165
- "description": "<p>Cast the given <code>value</code> to an array.</p>\n",
166
- "requiresBlock": false
167
- },
168
- "before": {
169
- "args": [
170
- "array",
171
- "n"
172
- ],
173
- "numArgs": 2,
174
- "example": "{{ before ['a', 'b', 'c', 'd'] 3}} -> ['a', 'b']",
175
- "description": "<p>Return all of the items in the collection before the specified count. Opposite of <a href=\"#after\">after</a>.</p>\n",
176
- "requiresBlock": false
177
- },
178
- "eachIndex": {
179
- "args": [
180
- "array",
181
- "options"
182
- ],
183
- "numArgs": 2,
184
- "example": "{{#eachIndex [1, 2, 3]}} {{item}} is {{index}} {{/eachIndex}} -> ' 1 is 0 2 is 1 3 is 2 '",
185
- "description": "<p>Iterates the array, listing an item and the index of it.</p>\n",
186
- "requiresBlock": true
187
- },
188
- "filter": {
189
- "args": [
190
- "array",
191
- "value",
192
- "options"
193
- ],
194
- "numArgs": 3,
195
- "example": "{{#filter [1, 2, 3] 2}}2 Found{{else}}2 not found{{/filter}} -> 2 Found",
196
- "description": "<p>Block helper that filters the given array and renders the block for values that evaluate to <code>true</code>, otherwise the inverse block is returned.</p>\n",
197
- "requiresBlock": true
198
- },
199
- "first": {
200
- "args": [
201
- "array",
202
- "n"
203
- ],
204
- "numArgs": 2,
205
- "example": "{{first [1, 2, 3, 4] 2}} -> 1,2",
206
- "description": "<p>Returns the first item, or first <code>n</code> items of an array.</p>\n",
207
- "requiresBlock": false
208
- },
209
- "forEach": {
210
- "args": [
211
- "array",
212
- "options"
213
- ],
214
- "numArgs": 2,
215
- "example": "{{#forEach [{ 'name': 'John' }] }} {{ name }} {{/forEach}} -> ' John '",
216
- "description": "<p>Iterates over each item in an array and exposes the current item in the array as context to the inner block. In addition to the current array item, the helper exposes the following variables to the inner block: - <code>index</code> - <code>total</code> - <code>isFirst</code> - <code>isLast</code> Also, <code>@index</code> is exposed as a private variable, and additional private variables may be defined as hash arguments.</p>\n",
217
- "requiresBlock": true
218
- },
219
- "inArray": {
220
- "args": [
221
- "array",
222
- "value",
223
- "options"
224
- ],
225
- "numArgs": 3,
226
- "example": "{{#inArray [1, 2, 3] 2}} 2 exists {{else}} 2 does not exist {{/inArray}} -> ' 2 exists '",
227
- "description": "<p>Block helper that renders the block if an array has the given <code>value</code>. Optionally specify an inverse block to render when the array does not have the given value.</p>\n",
228
- "requiresBlock": true
229
- },
230
- "isArray": {
231
- "args": [
232
- "value"
233
- ],
234
- "numArgs": 1,
235
- "example": "{{isArray [1, 2]}} -> true",
236
- "description": "<p>Returns true if <code>value</code> is an es5 array.</p>\n",
237
- "requiresBlock": false
238
- },
239
- "itemAt": {
240
- "args": [
241
- "array",
242
- "idx"
243
- ],
244
- "numArgs": 2,
245
- "example": "{{itemAt [1, 2, 3] 1}} -> 2",
246
- "description": "<p>Returns the item from <code>array</code> at index <code>idx</code>.</p>\n",
247
- "requiresBlock": false
248
- },
249
- "join": {
250
- "args": [
251
- "array",
252
- "separator"
253
- ],
254
- "numArgs": 2,
255
- "example": "{{join [1, 2, 3]}} -> 1, 2, 3",
256
- "description": "<p>Join all elements of array into a string, optionally using a given separator.</p>\n",
257
- "requiresBlock": false
258
- },
259
- "equalsLength": {
260
- "args": [
261
- "value",
262
- "length"
263
- ],
264
- "numArgs": 2,
265
- "example": "{{equalsLength [1, 2, 3] 3}} -> true",
266
- "description": "<p>Returns true if the the length of the given <code>value</code> is equal to the given <code>length</code>. Can be used as a block or inline helper.</p>\n",
267
- "requiresBlock": false
268
- },
269
- "last": {
270
- "args": [
271
- "value",
272
- "n"
273
- ],
274
- "numArgs": 2,
275
- "example": "{{last [1, 2, 3]}} -> 3",
276
- "description": "<p>Returns the last item, or last <code>n</code> items of an array or string. Opposite of <a href=\"#first\">first</a>.</p>\n",
277
- "requiresBlock": false
278
- },
279
- "length": {
280
- "args": [
281
- "value"
282
- ],
283
- "numArgs": 1,
284
- "example": "{{length [1, 2, 3]}} -> 3",
285
- "description": "<p>Returns the length of the given string or array.</p>\n",
286
- "requiresBlock": false
287
- },
288
- "lengthEqual": {
289
- "args": [
290
- "value",
291
- "length"
292
- ],
293
- "numArgs": 2,
294
- "example": "{{equalsLength [1, 2, 3] 3}} -> true",
295
- "description": "<p>Returns true if the the length of the given <code>value</code> is equal to the given <code>length</code>. Can be used as a block or inline helper.</p>\n",
296
- "requiresBlock": false
297
- },
298
- "map": {
299
- "args": [
300
- "array",
301
- "fn"
302
- ],
303
- "numArgs": 2,
304
- "example": "{{map [1, 2, 3] double}} -> [2, 4, 6]",
305
- "description": "<p>Returns a new array, created by calling <code>function</code> on each element of the given <code>array</code>. For example,</p>\n",
306
- "requiresBlock": false
307
- },
308
- "pluck": {
309
- "args": [
310
- "collection",
311
- "prop"
312
- ],
313
- "numArgs": 2,
314
- "example": "{{pluck [{ 'name': 'Bob' }] 'name' }} -> ['Bob']",
315
- "description": "<p>Map over the given object or array or objects and create an array of values from the given <code>prop</code>. Dot-notation may be used (as a string) to get nested properties.</p>\n",
316
- "requiresBlock": false
317
- },
318
- "reverse": {
319
- "args": [
320
- "value"
321
- ],
322
- "numArgs": 1,
323
- "example": "{{reverse [1, 2, 3]}} -> [3, 2, 1]",
324
- "description": "<p>Reverse the elements in an array, or the characters in a string.</p>\n",
325
- "requiresBlock": false
326
- },
327
- "some": {
328
- "args": [
329
- "array",
330
- "iter",
331
- "provided"
332
- ],
333
- "numArgs": 3,
334
- "example": "{{#some [1, \"b\", 3] isString}} string found {{else}} No string found {{/some}} -> ' string found '",
335
- "description": "<p>Block helper that returns the block if the callback returns true for some value in the given array.</p>\n",
336
- "requiresBlock": true
337
- },
338
- "sort": {
339
- "args": [
340
- "array",
341
- "key"
342
- ],
343
- "numArgs": 2,
344
- "example": "{{ sort ['b', 'a', 'c'] }} -> ['a', 'b', 'c']",
345
- "description": "<p>Sort the given <code>array</code>. If an array of objects is passed, you may optionally pass a <code>key</code> to sort on as the second argument. You may alternatively pass a sorting function as the second argument.</p>\n",
346
- "requiresBlock": false
347
- },
348
- "sortBy": {
349
- "args": [
350
- "array",
351
- "props"
352
- ],
353
- "numArgs": 2,
354
- "example": "{{ sortBy [{'a': 'zzz'}, {'a': 'aaa'}] 'a' }} -> [{'a':'aaa'},{'a':'zzz'}]",
355
- "description": "<p>Sort an <code>array</code>. If an array of objects is passed, you may optionally pass a <code>key</code> to sort on as the second argument. You may alternatively pass a sorting function as the second argument.</p>\n",
356
- "requiresBlock": false
357
- },
358
- "withAfter": {
359
- "args": [
360
- "array",
361
- "idx",
362
- "options"
363
- ],
364
- "numArgs": 3,
365
- "example": "{{#withAfter [1, 2, 3] 1 }} {{this}} {{/withAfter}} -> ' 2 3 '",
366
- "description": "<p>Use the items in the array <em>after</em> the specified index as context inside a block. Opposite of <a href=\"#withBefore\">withBefore</a>.</p>\n",
367
- "requiresBlock": true
368
- },
369
- "withBefore": {
370
- "args": [
371
- "array",
372
- "idx",
373
- "options"
374
- ],
375
- "numArgs": 3,
376
- "example": "{{#withBefore [1, 2, 3] 2 }} {{this}} {{/withBefore}} -> ' 1 '",
377
- "description": "<p>Use the items in the array <em>before</em> the specified index as context inside a block. Opposite of <a href=\"#withAfter\">withAfter</a>.</p>\n",
378
- "requiresBlock": true
379
- },
380
- "withFirst": {
381
- "args": [
382
- "array",
383
- "idx",
384
- "options"
385
- ],
386
- "numArgs": 3,
387
- "example": "{{#withFirst [1, 2, 3] }}{{this}}{{/withFirst}} -> 1",
388
- "description": "<p>Use the first item in a collection inside a handlebars block expression. Opposite of <a href=\"#withLast\">withLast</a>.</p>\n",
389
- "requiresBlock": true
390
- },
391
- "withGroup": {
392
- "args": [
393
- "array",
394
- "size",
395
- "options"
396
- ],
397
- "numArgs": 3,
398
- "example": "{{#withGroup [1, 2, 3, 4] 2}}{{#each this}}{{.}}{{/each}}<br>{{/withGroup}} -> 12<br>34<br>",
399
- "description": "<p>Block helper that groups array elements by given group <code>size</code>.</p>\n",
400
- "requiresBlock": true
401
- },
402
- "withLast": {
403
- "args": [
404
- "array",
405
- "idx",
406
- "options"
407
- ],
408
- "numArgs": 3,
409
- "example": "{{#withLast [1, 2, 3, 4]}}{{this}}{{/withLast}} -> 4",
410
- "description": "<p>Use the last item or <code>n</code> items in an array as context inside a block. Opposite of <a href=\"#withFirst\">withFirst</a>.</p>\n",
411
- "requiresBlock": true
412
- },
413
- "withSort": {
414
- "args": [
415
- "array",
416
- "prop",
417
- "options"
418
- ],
419
- "numArgs": 3,
420
- "example": "{{#withSort ['b', 'a', 'c']}}{{this}}{{/withSort}} -> abc",
421
- "description": "<p>Block helper that sorts a collection and exposes the sorted collection as context inside the block.</p>\n",
422
- "requiresBlock": true
423
- },
424
- "unique": {
425
- "args": [
426
- "array",
427
- "options"
428
- ],
429
- "numArgs": 2,
430
- "example": "{{#each (unique ['a', 'a', 'c', 'b', 'e', 'e']) }}{{.}}{{/each}} -> acbe",
431
- "description": "<p>Block helper that return an array with all duplicate values removed. Best used along with a <a href=\"#each\">each</a> helper.</p>\n",
432
- "requiresBlock": true
433
- }
434
- },
435
- "number": {
436
- "bytes": {
437
- "args": [
438
- "number"
439
- ],
440
- "numArgs": 1,
441
- "example": "{{ bytes 1386 1 }} -> 1.4 kB",
442
- "description": "<p>Format a number to it&#39;s equivalent in bytes. If a string is passed, it&#39;s length will be formatted and returned. <strong>Examples:</strong> - <code>&#39;foo&#39; =&gt; 3 B</code> - <code>13661855 =&gt; 13.66 MB</code> - <code>825399 =&gt; 825.39 kB</code> - <code>1396 =&gt; 1.4 kB</code></p>\n",
443
- "requiresBlock": false
444
- },
445
- "addCommas": {
446
- "args": [
447
- "num"
448
- ],
449
- "numArgs": 1,
450
- "example": "{{ addCommas 1000000 }} -> 1,000,000",
451
- "description": "<p>Add commas to numbers</p>\n",
452
- "requiresBlock": false
453
- },
454
- "phoneNumber": {
455
- "args": [
456
- "num"
457
- ],
458
- "numArgs": 1,
459
- "example": "{{ phoneNumber 8005551212 }} -> (800) 555-1212",
460
- "description": "<p>Convert a string or number to a formatted phone number.</p>\n",
461
- "requiresBlock": false
462
- },
463
- "toAbbr": {
464
- "args": [
465
- "number",
466
- "precision"
467
- ],
468
- "numArgs": 2,
469
- "example": "{{ toAbbr 10123 2 }} -> 10.12k",
470
- "description": "<p>Abbreviate numbers to the given number of <code>precision</code>. This for general numbers, not size in bytes.</p>\n",
471
- "requiresBlock": false
472
- },
473
- "toExponential": {
474
- "args": [
475
- "number",
476
- "fractionDigits"
477
- ],
478
- "numArgs": 2,
479
- "example": "{{ toExponential 10123 2 }} -> 1.01e+4",
480
- "description": "<p>Returns a string representing the given number in exponential notation.</p>\n",
481
- "requiresBlock": false
482
- },
483
- "toFixed": {
484
- "args": [
485
- "number",
486
- "digits"
487
- ],
488
- "numArgs": 2,
489
- "example": "{{ toFixed 1.1234 2 }} -> 1.12",
490
- "description": "<p>Formats the given number using fixed-point notation.</p>\n",
491
- "requiresBlock": false
492
- },
493
- "toFloat": {
494
- "args": [
495
- "number"
496
- ],
497
- "numArgs": 1,
498
- "description": "<p>Convert input to a float.</p>\n",
499
- "requiresBlock": false
500
- },
501
- "toInt": {
502
- "args": [
503
- "number"
504
- ],
505
- "numArgs": 1,
506
- "description": "<p>Convert input to an integer.</p>\n",
507
- "requiresBlock": false
508
- },
509
- "toPrecision": {
510
- "args": [
511
- "number",
512
- "precision"
513
- ],
514
- "numArgs": 2,
515
- "example": "{{toPrecision '1.1234' 2}} -> 1.1",
516
- "description": "<p>Returns a string representing the <code>Number</code> object to the specified precision.</p>\n",
517
- "requiresBlock": false
518
- }
519
- },
520
- "url": {
521
- "encodeURI": {
522
- "args": [
523
- "str"
524
- ],
525
- "numArgs": 1,
526
- "example": "{{ encodeURI 'https://myurl?Hello There' }} -> https%3A%2F%2Fmyurl%3FHello%20There",
527
- "description": "<p>Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.</p>\n",
528
- "requiresBlock": false
529
- },
530
- "escape": {
531
- "args": [
532
- "str"
533
- ],
534
- "numArgs": 1,
535
- "example": "{{ escape 'https://myurl?Hello+There' }} -> https%3A%2F%2Fmyurl%3FHello%2BThere",
536
- "description": "<p>Escape the given string by replacing characters with escape sequences. Useful for allowing the string to be used in a URL, etc.</p>\n",
537
- "requiresBlock": false
538
- },
539
- "decodeURI": {
540
- "args": [
541
- "str"
542
- ],
543
- "numArgs": 1,
544
- "example": "{{ decodeURI 'https://myurl?Hello%20There' }} -> https://myurl?Hello There",
545
- "description": "<p>Decode a Uniform Resource Identifier (URI) component.</p>\n",
546
- "requiresBlock": false
547
- },
548
- "urlResolve": {
549
- "args": [
550
- "base",
551
- "href"
552
- ],
553
- "numArgs": 2,
554
- "example": "{{ urlResolve 'https://myurl' '/api/test' }} -> https://myurl/api/test",
555
- "description": "<p>Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.</p>\n",
556
- "requiresBlock": false
557
- },
558
- "urlParse": {
559
- "args": [
560
- "str"
561
- ],
562
- "numArgs": 1,
563
- "example": "{{ urlParse 'https://myurl/api/test' }}",
564
- "description": "<p>Parses a <code>url</code> string into an object.</p>\n",
565
- "requiresBlock": false
566
- },
567
- "stripQuerystring": {
568
- "args": [
569
- "url"
570
- ],
571
- "numArgs": 1,
572
- "example": "{{ stripQuerystring 'https://myurl/api/test?foo=bar' }} -> 'https://myurl/api/test'",
573
- "description": "<p>Strip the query string from the given <code>url</code>.</p>\n",
574
- "requiresBlock": false
575
- },
576
- "stripProtocol": {
577
- "args": [
578
- "str"
579
- ],
580
- "numArgs": 1,
581
- "example": "{{ stripProtocol 'https://myurl/api/test' }} -> '//myurl/api/test'",
582
- "description": "<p>Strip protocol from a <code>url</code>. Useful for displaying media that may have an &#39;http&#39; protocol on secure connections.</p>\n",
583
- "requiresBlock": false
584
- }
585
- },
586
- "string": {
587
- "append": {
588
- "args": [
589
- "str",
590
- "suffix"
591
- ],
592
- "numArgs": 2,
593
- "example": "{{append 'index' '.html'}} -> index.html",
594
- "description": "<p>Append the specified <code>suffix</code> to the given string.</p>\n",
595
- "requiresBlock": false
596
- },
597
- "camelcase": {
598
- "args": [
599
- "string"
600
- ],
601
- "numArgs": 1,
602
- "example": "{{camelcase 'foo bar baz'}} -> fooBarBaz",
603
- "description": "<p>camelCase the characters in the given <code>string</code>.</p>\n",
604
- "requiresBlock": false
605
- },
606
- "capitalize": {
607
- "args": [
608
- "str"
609
- ],
610
- "numArgs": 1,
611
- "example": "{{capitalize 'foo bar baz'}} -> Foo bar baz",
612
- "description": "<p>Capitalize the first word in a sentence.</p>\n",
613
- "requiresBlock": false
614
- },
615
- "capitalizeAll": {
616
- "args": [
617
- "str"
618
- ],
619
- "numArgs": 1,
620
- "example": "{{ capitalizeAll 'foo bar baz'}} -> Foo Bar Baz",
621
- "description": "<p>Capitalize all words in a string.</p>\n",
622
- "requiresBlock": false
623
- },
624
- "center": {
625
- "args": [
626
- "str",
627
- "spaces"
628
- ],
629
- "numArgs": 2,
630
- "example": "{{ center 'test' 1}} -> ' test '",
631
- "description": "<p>Center a string using non-breaking spaces</p>\n",
632
- "requiresBlock": false
633
- },
634
- "chop": {
635
- "args": [
636
- "string"
637
- ],
638
- "numArgs": 1,
639
- "example": "{{ chop ' ABC '}} -> ABC",
640
- "description": "<p>Like trim, but removes both extraneous whitespace <strong>and non-word characters</strong> from the beginning and end of a string.</p>\n",
641
- "requiresBlock": false
642
- },
643
- "dashcase": {
644
- "args": [
645
- "string"
646
- ],
647
- "numArgs": 1,
648
- "example": "{{dashcase 'a-b-c d_e'}} -> a-b-c-d-e",
649
- "description": "<p>dash-case the characters in <code>string</code>. Replaces non-word characters and periods with hyphens.</p>\n",
650
- "requiresBlock": false
651
- },
652
- "dotcase": {
653
- "args": [
654
- "string"
655
- ],
656
- "numArgs": 1,
657
- "example": "{{dotcase 'a-b-c d_e'}} -> a.b.c.d.e",
658
- "description": "<p>dot.case the characters in <code>string</code>.</p>\n",
659
- "requiresBlock": false
660
- },
661
- "downcase": {
662
- "args": [
663
- "string"
664
- ],
665
- "numArgs": 1,
666
- "example": "{{downcase 'aBcDeF'}} -> abcdef",
667
- "description": "<p>Lowercase all of the characters in the given string. Alias for <a href=\"#lowercase\">lowercase</a>.</p>\n",
668
- "requiresBlock": false
669
- },
670
- "ellipsis": {
671
- "args": [
672
- "str",
673
- "length"
674
- ],
675
- "numArgs": 2,
676
- "example": "{{ellipsis 'foo bar baz' 7}} -> foo bar…",
677
- "description": "<p>Truncates a string to the specified <code>length</code>, and appends it with an elipsis, <code>…</code>.</p>\n",
678
- "requiresBlock": false
679
- },
680
- "hyphenate": {
681
- "args": [
682
- "str"
683
- ],
684
- "numArgs": 1,
685
- "example": "{{hyphenate 'foo bar baz qux'}} -> foo-bar-baz-qux",
686
- "description": "<p>Replace spaces in a string with hyphens.</p>\n",
687
- "requiresBlock": false
688
- },
689
- "isString": {
690
- "args": [
691
- "value"
692
- ],
693
- "numArgs": 1,
694
- "example": "{{isString 'foo'}} -> true",
695
- "description": "<p>Return true if <code>value</code> is a string.</p>\n",
696
- "requiresBlock": false
697
- },
698
- "lowercase": {
699
- "args": [
700
- "str"
701
- ],
702
- "numArgs": 1,
703
- "example": "{{lowercase 'Foo BAR baZ'}} -> foo bar baz",
704
- "description": "<p>Lowercase all characters in the given string.</p>\n",
705
- "requiresBlock": false
706
- },
707
- "occurrences": {
708
- "args": [
709
- "str",
710
- "substring"
711
- ],
712
- "numArgs": 2,
713
- "example": "{{occurrences 'foo bar foo bar baz' 'foo'}} -> 2",
714
- "description": "<p>Return the number of occurrences of <code>substring</code> within the given <code>string</code>.</p>\n",
715
- "requiresBlock": false
716
- },
717
- "pascalcase": {
718
- "args": [
719
- "string"
720
- ],
721
- "numArgs": 1,
722
- "example": "{{pascalcase 'foo bar baz'}} -> FooBarBaz",
723
- "description": "<p>PascalCase the characters in <code>string</code>.</p>\n",
724
- "requiresBlock": false
725
- },
726
- "pathcase": {
727
- "args": [
728
- "string"
729
- ],
730
- "numArgs": 1,
731
- "example": "{{pathcase 'a-b-c d_e'}} -> a/b/c/d/e",
732
- "description": "<p>path/case the characters in <code>string</code>.</p>\n",
733
- "requiresBlock": false
734
- },
735
- "plusify": {
736
- "args": [
737
- "str"
738
- ],
739
- "numArgs": 1,
740
- "example": "{{plusify 'foo bar baz'}} -> foo+bar+baz",
741
- "description": "<p>Replace spaces in the given string with pluses.</p>\n",
742
- "requiresBlock": false
743
- },
744
- "prepend": {
745
- "args": [
746
- "str",
747
- "prefix"
748
- ],
749
- "numArgs": 2,
750
- "example": "{{prepend 'bar' 'foo-'}} -> foo-bar",
751
- "description": "<p>Prepends the given <code>string</code> with the specified <code>prefix</code>.</p>\n",
752
- "requiresBlock": false
753
- },
754
- "remove": {
755
- "args": [
756
- "str",
757
- "substring"
758
- ],
759
- "numArgs": 2,
760
- "example": "{{remove 'a b a b a b' 'a '}} -> b b b",
761
- "description": "<p>Remove all occurrences of <code>substring</code> from the given <code>str</code>.</p>\n",
762
- "requiresBlock": false
763
- },
764
- "removeFirst": {
765
- "args": [
766
- "str",
767
- "substring"
768
- ],
769
- "numArgs": 2,
770
- "example": "{{removeFirst 'a b a b a b' 'a'}} -> ' b a b a b'",
771
- "description": "<p>Remove the first occurrence of <code>substring</code> from the given <code>str</code>.</p>\n",
772
- "requiresBlock": false
773
- },
774
- "replace": {
775
- "args": [
776
- "str",
777
- "a",
778
- "b"
779
- ],
780
- "numArgs": 3,
781
- "example": "{{replace 'a b a b a b' 'a' 'z'}} -> z b z b z b",
782
- "description": "<p>Replace all occurrences of substring <code>a</code> with substring <code>b</code>.</p>\n",
783
- "requiresBlock": false
784
- },
785
- "replaceFirst": {
786
- "args": [
787
- "str",
788
- "a",
789
- "b"
790
- ],
791
- "numArgs": 3,
792
- "example": "{{replaceFirst 'a b a b a b' 'a' 'z'}} -> z b a b a b",
793
- "description": "<p>Replace the first occurrence of substring <code>a</code> with substring <code>b</code>.</p>\n",
794
- "requiresBlock": false
795
- },
796
- "sentence": {
797
- "args": [
798
- "str"
799
- ],
800
- "numArgs": 1,
801
- "example": "{{sentence 'hello world. goodbye world.'}} -> Hello world. Goodbye world.",
802
- "description": "<p>Sentence case the given string</p>\n",
803
- "requiresBlock": false
804
- },
805
- "snakecase": {
806
- "args": [
807
- "string"
808
- ],
809
- "numArgs": 1,
810
- "example": "{{snakecase 'a-b-c d_e'}} -> a_b_c_d_e",
811
- "description": "<p>snake_case the characters in the given <code>string</code>.</p>\n",
812
- "requiresBlock": false
813
- },
814
- "split": {
815
- "args": [
816
- "string"
817
- ],
818
- "numArgs": 1,
819
- "example": "{{split 'a,b,c'}} -> ['a', 'b', 'c']",
820
- "description": "<p>Split <code>string</code> by the given <code>character</code>.</p>\n",
821
- "requiresBlock": false
822
- },
823
- "startsWith": {
824
- "args": [
825
- "prefix",
826
- "testString",
827
- "options"
828
- ],
829
- "numArgs": 3,
830
- "example": "{{#startsWith 'Goodbye' 'Hello, world!'}}Yep{{else}}Nope{{/startsWith}} -> Nope",
831
- "description": "<p>Tests whether a string begins with the given prefix.</p>\n",
832
- "requiresBlock": true
833
- },
834
- "titleize": {
835
- "args": [
836
- "str"
837
- ],
838
- "numArgs": 1,
839
- "example": "{{titleize 'this is title case' }} -> This Is Title Case",
840
- "description": "<p>Title case the given string.</p>\n",
841
- "requiresBlock": false
842
- },
843
- "trim": {
844
- "args": [
845
- "string"
846
- ],
847
- "numArgs": 1,
848
- "example": "{{trim ' ABC ' }} -> ABC",
849
- "description": "<p>Removes extraneous whitespace from the beginning and end of a string.</p>\n",
850
- "requiresBlock": false
851
- },
852
- "trimLeft": {
853
- "args": [
854
- "string"
855
- ],
856
- "numArgs": 1,
857
- "example": "{{trimLeft ' ABC ' }} -> 'ABC '",
858
- "description": "<p>Removes extraneous whitespace from the beginning of a string.</p>\n",
859
- "requiresBlock": false
860
- },
861
- "trimRight": {
862
- "args": [
863
- "string"
864
- ],
865
- "numArgs": 1,
866
- "example": "{{trimRight ' ABC ' }} -> ' ABC'",
867
- "description": "<p>Removes extraneous whitespace from the end of a string.</p>\n",
868
- "requiresBlock": false
869
- },
870
- "truncate": {
871
- "args": [
872
- "str",
873
- "limit",
874
- "suffix"
875
- ],
876
- "numArgs": 3,
877
- "example": "{{truncate 'foo bar baz' 7 }} -> foo bar",
878
- "description": "<p>Truncate a string to the specified <code>length</code>. Also see <a href=\"#ellipsis\">ellipsis</a>.</p>\n",
879
- "requiresBlock": false
880
- },
881
- "truncateWords": {
882
- "args": [
883
- "str",
884
- "limit",
885
- "suffix"
886
- ],
887
- "numArgs": 3,
888
- "example": "{{truncateWords 'foo bar baz' 1 }} -> foo…",
889
- "description": "<p>Truncate a string to have the specified number of words. Also see <a href=\"#truncate\">truncate</a>.</p>\n",
890
- "requiresBlock": false
891
- },
892
- "upcase": {
893
- "args": [
894
- "string"
895
- ],
896
- "numArgs": 1,
897
- "example": "{{upcase 'aBcDef'}} -> ABCDEF",
898
- "description": "<p>Uppercase all of the characters in the given string. Alias for <a href=\"#uppercase\">uppercase</a>.</p>\n",
899
- "requiresBlock": false
900
- },
901
- "uppercase": {
902
- "args": [
903
- "str",
904
- "options"
905
- ],
906
- "numArgs": 2,
907
- "example": "{{uppercase 'aBcDef'}} -> ABCDEF",
908
- "description": "<p>Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.</p>\n",
909
- "requiresBlock": false
910
- },
911
- "lorem": {
912
- "args": [
913
- "num"
914
- ],
915
- "numArgs": 1,
916
- "example": "{{lorem 11}} -> Lorem ipsum",
917
- "description": "<p>Takes a number and returns that many charaters of Lorem Ipsum</p>\n",
918
- "requiresBlock": false
919
- }
920
- },
921
- "comparison": {
922
- "and": {
923
- "args": [
924
- "a",
925
- "b",
926
- "options"
927
- ],
928
- "numArgs": 3,
929
- "example": "{{#and great magnificent}}both{{else}}no{{/and}} -> no",
930
- "description": "<p>Helper that renders the block if <strong>both</strong> of the given values are truthy. If an inverse block is specified it will be rendered when falsy. Works as a block helper, inline helper or subexpression.</p>\n",
931
- "requiresBlock": true
932
- },
933
- "compare": {
934
- "args": [
935
- "a",
936
- "operator",
937
- "b",
938
- "options"
939
- ],
940
- "numArgs": 4,
941
- "example": "{{compare 10 '<' 5 }} -> false",
942
- "description": "<p>Render a block when a comparison of the first and third arguments returns true. The second argument is the [arithemetic operator][operators] to use. You may also optionally specify an inverse block to render when falsy.</p>\n",
943
- "requiresBlock": false
944
- },
945
- "contains": {
946
- "args": [
947
- "collection",
948
- "value",
949
- "[startIndex=0]",
950
- "options"
951
- ],
952
- "numArgs": 4,
953
- "example": "{{#contains ['a', 'b', 'c'] 'd'}} This will not be rendered. {{else}} This will be rendered. {{/contains}} -> ' This will be rendered. '",
954
- "description": "<p>Block helper that renders the block if <code>collection</code> has the given <code>value</code>, using strict equality (<code>===</code>) for comparison, otherwise the inverse block is rendered (if specified). If a <code>startIndex</code> is specified and is negative, it is used as the offset from the end of the collection.</p>\n",
955
- "requiresBlock": true
956
- },
957
- "default": {
958
- "args": [
959
- "value",
960
- "defaultValue"
961
- ],
962
- "numArgs": 2,
963
- "example": "{{default null null 'default'}} -> default",
964
- "description": "<p>Returns the first value that is not undefined, otherwise the &#39;default&#39; value is returned.</p>\n",
965
- "requiresBlock": false
966
- },
967
- "eq": {
968
- "args": [
969
- "a",
970
- "b",
971
- "options"
972
- ],
973
- "numArgs": 3,
974
- "example": "{{#eq 3 3}}equal{{else}}not equal{{/eq}} -> equal",
975
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>equal to</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. You may optionally use the <code>compare=&#39;&#39;</code> hash argument for the second value.</p>\n",
976
- "requiresBlock": true
977
- },
978
- "gt": {
979
- "args": [
980
- "a",
981
- "b",
982
- "options"
983
- ],
984
- "numArgs": 3,
985
- "example": "{{#gt 4 3}} greater than{{else}} not greater than{{/gt}} -> ' greater than'",
986
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>greater than</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. You may optionally use the <code>compare=&#39;&#39;</code> hash argument for the second value.</p>\n",
987
- "requiresBlock": true
988
- },
989
- "gte": {
990
- "args": [
991
- "a",
992
- "b",
993
- "options"
994
- ],
995
- "numArgs": 3,
996
- "example": "{{#gte 4 3}} greater than or equal{{else}} not greater than{{/gte}} -> ' greater than or equal'",
997
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>greater than or equal to</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. You may optionally use the <code>compare=&#39;&#39;</code> hash argument for the second value.</p>\n",
998
- "requiresBlock": true
999
- },
1000
- "has": {
1001
- "args": [
1002
- "val",
1003
- "pattern",
1004
- "options"
1005
- ],
1006
- "numArgs": 3,
1007
- "example": "{{#has 'foobar' 'foo'}}has it{{else}}doesn't{{/has}} -> has it",
1008
- "description": "<p>Block helper that renders a block if <code>value</code> has <code>pattern</code>. If an inverse block is specified it will be rendered when falsy.</p>\n",
1009
- "requiresBlock": true
1010
- },
1011
- "isFalsey": {
1012
- "args": [
1013
- "val",
1014
- "options"
1015
- ],
1016
- "numArgs": 2,
1017
- "example": "{{isFalsey '' }} -> true",
1018
- "description": "<p>Returns true if the given <code>value</code> is falsey. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.</p>\n",
1019
- "requiresBlock": false
1020
- },
1021
- "isTruthy": {
1022
- "args": [
1023
- "val",
1024
- "options"
1025
- ],
1026
- "numArgs": 2,
1027
- "example": "{{isTruthy '12' }} -> true",
1028
- "description": "<p>Returns true if the given <code>value</code> is truthy. Uses the [falsey][] library for comparisons. Please see that library for more information or to report bugs with this helper.</p>\n",
1029
- "requiresBlock": false
1030
- },
1031
- "ifEven": {
1032
- "args": [
1033
- "number",
1034
- "options"
1035
- ],
1036
- "numArgs": 2,
1037
- "example": "{{#ifEven 2}} even {{else}} odd {{/ifEven}} -> ' even '",
1038
- "description": "<p>Return true if the given value is an even number.</p>\n",
1039
- "requiresBlock": true
1040
- },
1041
- "ifNth": {
1042
- "args": [
1043
- "a",
1044
- "b",
1045
- "options"
1046
- ],
1047
- "numArgs": 3,
1048
- "example": "{{#ifNth 2 10}}remainder{{else}}no remainder{{/ifNth}} -> remainder",
1049
- "description": "<p>Conditionally renders a block if the remainder is zero when <code>b</code> operand is divided by <code>a</code>. If an inverse block is specified it will be rendered when the remainder is <strong>not zero</strong>.</p>\n",
1050
- "requiresBlock": true
1051
- },
1052
- "ifOdd": {
1053
- "args": [
1054
- "value",
1055
- "options"
1056
- ],
1057
- "numArgs": 2,
1058
- "example": "{{#ifOdd 3}}odd{{else}}even{{/ifOdd}} -> odd",
1059
- "description": "<p>Block helper that renders a block if <code>value</code> is <strong>an odd number</strong>. If an inverse block is specified it will be rendered when falsy.</p>\n",
1060
- "requiresBlock": true
1061
- },
1062
- "is": {
1063
- "args": [
1064
- "a",
1065
- "b",
1066
- "options"
1067
- ],
1068
- "numArgs": 3,
1069
- "example": "{{#is 3 3}} is {{else}} is not {{/is}} -> ' is '",
1070
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>equal to</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. Similar to <a href=\"#eq\">eq</a> but does not do strict equality.</p>\n",
1071
- "requiresBlock": true
1072
- },
1073
- "isnt": {
1074
- "args": [
1075
- "a",
1076
- "b",
1077
- "options"
1078
- ],
1079
- "numArgs": 3,
1080
- "example": "{{#isnt 3 3}} isnt {{else}} is {{/isnt}} -> ' is '",
1081
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>not equal to</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. Similar to <a href=\"#unlesseq\">unlessEq</a> but does not use strict equality for comparisons.</p>\n",
1082
- "requiresBlock": true
1083
- },
1084
- "lt": {
1085
- "args": [
1086
- "context",
1087
- "options"
1088
- ],
1089
- "numArgs": 2,
1090
- "example": "{{#lt 2 3}} less than {{else}} more than or equal {{/lt}} -> ' less than '",
1091
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>less than</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. You may optionally use the <code>compare=&#39;&#39;</code> hash argument for the second value.</p>\n",
1092
- "requiresBlock": true
1093
- },
1094
- "lte": {
1095
- "args": [
1096
- "a",
1097
- "b",
1098
- "options"
1099
- ],
1100
- "numArgs": 3,
1101
- "example": "{{#lte 2 3}} less than or equal {{else}} more than {{/lte}} -> ' less than or equal '",
1102
- "description": "<p>Block helper that renders a block if <code>a</code> is <strong>less than or equal to</strong> <code>b</code>. If an inverse block is specified it will be rendered when falsy. You may optionally use the <code>compare=&#39;&#39;</code> hash argument for the second value.</p>\n",
1103
- "requiresBlock": true
1104
- },
1105
- "neither": {
1106
- "args": [
1107
- "a",
1108
- "b",
1109
- "options"
1110
- ],
1111
- "numArgs": 3,
1112
- "example": "{{#neither null null}}both falsey{{else}}both not falsey{{/neither}} -> both falsey",
1113
- "description": "<p>Block helper that renders a block if <strong>neither of</strong> the given values are truthy. If an inverse block is specified it will be rendered when falsy.</p>\n",
1114
- "requiresBlock": true
1115
- },
1116
- "not": {
1117
- "args": [
1118
- "val",
1119
- "options"
1120
- ],
1121
- "numArgs": 2,
1122
- "example": "{{#not undefined }}falsey{{else}}not falsey{{/not}} -> falsey",
1123
- "description": "<p>Returns true if <code>val</code> is falsey. Works as a block or inline helper.</p>\n",
1124
- "requiresBlock": true
1125
- },
1126
- "or": {
1127
- "args": [
1128
- "arguments",
1129
- "options"
1130
- ],
1131
- "numArgs": 2,
1132
- "example": "{{#or 1 2 undefined }} at least one truthy {{else}} all falsey {{/or}} -> ' at least one truthy '",
1133
- "description": "<p>Block helper that renders a block if <strong>any of</strong> the given values is truthy. If an inverse block is specified it will be rendered when falsy.</p>\n",
1134
- "requiresBlock": true
1135
- },
1136
- "unlessEq": {
1137
- "args": [
1138
- "a",
1139
- "b",
1140
- "options"
1141
- ],
1142
- "numArgs": 3,
1143
- "example": "{{#unlessEq 2 1 }} not equal {{else}} equal {{/unlessEq}} -> ' not equal '",
1144
- "description": "<p>Block helper that always renders the inverse block <strong>unless <code>a</code> is equal to <code>b</code></strong>.</p>\n",
1145
- "requiresBlock": true
1146
- },
1147
- "unlessGt": {
1148
- "args": [
1149
- "a",
1150
- "b",
1151
- "options"
1152
- ],
1153
- "numArgs": 3,
1154
- "example": "{{#unlessGt 20 1 }} not greater than {{else}} greater than {{/unlessGt}} -> ' greater than '",
1155
- "description": "<p>Block helper that always renders the inverse block <strong>unless <code>a</code> is greater than <code>b</code></strong>.</p>\n",
1156
- "requiresBlock": true
1157
- },
1158
- "unlessLt": {
1159
- "args": [
1160
- "a",
1161
- "b",
1162
- "options"
1163
- ],
1164
- "numArgs": 3,
1165
- "example": "{{#unlessLt 20 1 }}greater than or equal{{else}}less than{{/unlessLt}} -> greater than or equal",
1166
- "description": "<p>Block helper that always renders the inverse block <strong>unless <code>a</code> is less than <code>b</code></strong>.</p>\n",
1167
- "requiresBlock": true
1168
- },
1169
- "unlessGteq": {
1170
- "args": [
1171
- "a",
1172
- "b",
1173
- "options"
1174
- ],
1175
- "numArgs": 3,
1176
- "example": "{{#unlessGteq 20 1 }} less than {{else}}greater than or equal to{{/unlessGteq}} -> greater than or equal to",
1177
- "description": "<p>Block helper that always renders the inverse block <strong>unless <code>a</code> is greater than or equal to <code>b</code></strong>.</p>\n",
1178
- "requiresBlock": true
1179
- },
1180
- "unlessLteq": {
1181
- "args": [
1182
- "a",
1183
- "b",
1184
- "options"
1185
- ],
1186
- "numArgs": 3,
1187
- "example": "{{#unlessLteq 20 1 }} greater than {{else}} less than or equal to {{/unlessLteq}} -> ' greater than '",
1188
- "description": "<p>Block helper that always renders the inverse block <strong>unless <code>a</code> is less than or equal to <code>b</code></strong>.</p>\n",
1189
- "requiresBlock": true
1190
- }
1191
- },
1192
- "object": {
1193
- "extend": {
1194
- "args": [
1195
- "objects"
1196
- ],
1197
- "numArgs": 1,
1198
- "description": "<p>Extend the context with the properties of other objects. A shallow merge is performed to avoid mutating the context.</p>\n",
1199
- "requiresBlock": false
1200
- },
1201
- "forIn": {
1202
- "args": [
1203
- "context",
1204
- "options"
1205
- ],
1206
- "numArgs": 2,
1207
- "description": "<p>Block helper that iterates over the properties of an object, exposing each key and value on the context.</p>\n",
1208
- "requiresBlock": true
1209
- },
1210
- "forOwn": {
1211
- "args": [
1212
- "obj",
1213
- "options"
1214
- ],
1215
- "numArgs": 2,
1216
- "description": "<p>Block helper that iterates over the <strong>own</strong> properties of an object, exposing each key and value on the context.</p>\n",
1217
- "requiresBlock": true
1218
- },
1219
- "toPath": {
1220
- "args": [
1221
- "prop"
1222
- ],
1223
- "numArgs": 1,
1224
- "description": "<p>Take arguments and, if they are string or number, convert them to a dot-delineated object property path.</p>\n",
1225
- "requiresBlock": false
1226
- },
1227
- "get": {
1228
- "args": [
1229
- "prop",
1230
- "context",
1231
- "options"
1232
- ],
1233
- "numArgs": 3,
1234
- "description": "<p>Use property paths (<code>a.b.c</code>) to get a value or nested value from the context. Works as a regular helper or block helper.</p>\n",
1235
- "requiresBlock": true
1236
- },
1237
- "getObject": {
1238
- "args": [
1239
- "prop",
1240
- "context"
1241
- ],
1242
- "numArgs": 2,
1243
- "description": "<p>Use property paths (<code>a.b.c</code>) to get an object from the context. Differs from the <code>get</code> helper in that this helper will return the actual object, including the given property key. Also, this helper does not work as a block helper.</p>\n",
1244
- "requiresBlock": false
1245
- },
1246
- "hasOwn": {
1247
- "args": [
1248
- "key",
1249
- "context"
1250
- ],
1251
- "numArgs": 2,
1252
- "description": "<p>Return true if <code>key</code> is an own, enumerable property of the given <code>context</code> object.</p>\n",
1253
- "requiresBlock": false
1254
- },
1255
- "isObject": {
1256
- "args": [
1257
- "value"
1258
- ],
1259
- "numArgs": 1,
1260
- "description": "<p>Return true if <code>value</code> is an object.</p>\n",
1261
- "requiresBlock": false
1262
- },
1263
- "JSONparse": {
1264
- "args": [
1265
- "string"
1266
- ],
1267
- "numArgs": 1,
1268
- "description": "<p>Parses the given string using <code>JSON.parse</code>.</p>\n",
1269
- "requiresBlock": true
1270
- },
1271
- "JSONstringify": {
1272
- "args": [
1273
- "obj"
1274
- ],
1275
- "numArgs": 1,
1276
- "description": "<p>Stringify an object using <code>JSON.stringify</code>.</p>\n",
1277
- "requiresBlock": false
1278
- },
1279
- "merge": {
1280
- "args": [
1281
- "object",
1282
- "objects"
1283
- ],
1284
- "numArgs": 2,
1285
- "description": "<p>Deeply merge the properties of the given <code>objects</code> with the context object.</p>\n",
1286
- "requiresBlock": false
1287
- },
1288
- "parseJSON": {
1289
- "args": [
1290
- "string"
1291
- ],
1292
- "numArgs": 1,
1293
- "description": "<p>Parses the given string using <code>JSON.parse</code>.</p>\n",
1294
- "requiresBlock": true
1295
- },
1296
- "pick": {
1297
- "args": [
1298
- "properties",
1299
- "context",
1300
- "options"
1301
- ],
1302
- "numArgs": 3,
1303
- "description": "<p>Pick properties from the context object.</p>\n",
1304
- "requiresBlock": true
1305
- },
1306
- "stringify": {
1307
- "args": [
1308
- "obj"
1309
- ],
1310
- "numArgs": 1,
1311
- "description": "<p>Stringify an object using <code>JSON.stringify</code>.</p>\n",
1312
- "requiresBlock": false
1313
- }
1314
- },
1315
- "regex": {
1316
- "toRegex": {
1317
- "args": [
1318
- "str"
1319
- ],
1320
- "numArgs": 1,
1321
- "example": "{{toRegex 'foo'}} -> /foo/",
1322
- "description": "<p>Convert the given string to a regular expression.</p>\n",
1323
- "requiresBlock": false
1324
- },
1325
- "test": {
1326
- "args": [
1327
- "str"
1328
- ],
1329
- "numArgs": 1,
1330
- "example": "{{test 'foobar' (toRegex 'foo')}} -> true",
1331
- "description": "<p>Returns true if the given <code>str</code> matches the given regex. A regex can be passed on the context, or using the <a href=\"#toregex\">toRegex</a> helper as a subexpression.</p>\n",
1332
- "requiresBlock": false
1333
- }
1334
- },
1335
- "uuid": {
1336
- "uuid": {
1337
- "args": [],
1338
- "numArgs": 0,
1339
- "example": "{{ uuid }} -> f34ebc66-93bd-4f7c-b79b-92b5569138bc",
1340
- "description": "<p>Generates a UUID, using the V4 method (identical to the browser crypto.randomUUID function).</p>\n",
1341
- "requiresBlock": false
1342
- }
1343
- },
1344
- "date": {
1345
- "date": {
1346
- "args": [
1347
- "datetime",
1348
- "format"
1349
- ],
1350
- "numArgs": 2,
1351
- "example": "{{date now \"DD-MM-YYYY\" \"America/New_York\" }} -> 21-01-2021",
1352
- "description": "<p>Format a date using moment.js date formatting - the timezone is optional and uses the tz database.</p>\n"
1353
- },
1354
- "duration": {
1355
- "args": [
1356
- "time",
1357
- "durationType"
1358
- ],
1359
- "numArgs": 2,
1360
- "example": "{{duration 8 \"seconds\"}} -> a few seconds",
1361
- "description": "<p>Produce a humanized duration left/until given an amount of time and the type of time measurement.</p>\n"
1362
- }
1363
- }
1364
- }