@jaredwray/fumanchu 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +297 -250
- package/package.json +13 -20
package/dist/index.js
CHANGED
|
@@ -3,8 +3,22 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
8
22
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
23
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
24
|
};
|
|
@@ -170,26 +184,26 @@ var require_array = __commonJS({
|
|
|
170
184
|
"use strict";
|
|
171
185
|
var util = require("handlebars-utils");
|
|
172
186
|
var utils = require_utils2();
|
|
173
|
-
var
|
|
174
|
-
|
|
187
|
+
var helpers4 = module2.exports;
|
|
188
|
+
helpers4.after = function(array, n) {
|
|
175
189
|
if (util.isUndefined(array)) return "";
|
|
176
190
|
return array.slice(n);
|
|
177
191
|
};
|
|
178
|
-
|
|
192
|
+
helpers4.arrayify = function(value) {
|
|
179
193
|
return value ? Array.isArray(value) ? value : [value] : [];
|
|
180
194
|
};
|
|
181
|
-
|
|
195
|
+
helpers4.before = function(array, n) {
|
|
182
196
|
if (util.isUndefined(array)) return "";
|
|
183
197
|
return array.slice(0, -n);
|
|
184
198
|
};
|
|
185
|
-
|
|
199
|
+
helpers4.eachIndex = function(array, options) {
|
|
186
200
|
var result = "";
|
|
187
201
|
for (var i = 0; i < array.length; i++) {
|
|
188
202
|
result += options.fn({ item: array[i], index: i });
|
|
189
203
|
}
|
|
190
204
|
return result;
|
|
191
205
|
};
|
|
192
|
-
|
|
206
|
+
helpers4.filter = function(array, value, options) {
|
|
193
207
|
var content = "";
|
|
194
208
|
var results = [];
|
|
195
209
|
var prop = options.hash && (options.hash.property || options.hash.prop);
|
|
@@ -210,14 +224,14 @@ var require_array = __commonJS({
|
|
|
210
224
|
}
|
|
211
225
|
return options.inverse(this);
|
|
212
226
|
};
|
|
213
|
-
|
|
227
|
+
helpers4.first = function(array, n) {
|
|
214
228
|
if (util.isUndefined(array)) return "";
|
|
215
229
|
if (!utils.isNumber(n)) {
|
|
216
230
|
return array[0];
|
|
217
231
|
}
|
|
218
232
|
return array.slice(0, n);
|
|
219
233
|
};
|
|
220
|
-
|
|
234
|
+
helpers4.forEach = function(array, options) {
|
|
221
235
|
var data = utils.createFrame(options, options.hash);
|
|
222
236
|
var len = array.length;
|
|
223
237
|
var buffer = "";
|
|
@@ -233,13 +247,13 @@ var require_array = __commonJS({
|
|
|
233
247
|
}
|
|
234
248
|
return buffer;
|
|
235
249
|
};
|
|
236
|
-
|
|
250
|
+
helpers4.inArray = function(array, value, options) {
|
|
237
251
|
return util.value(util.indexOf(array, value) > -1, this, options);
|
|
238
252
|
};
|
|
239
|
-
|
|
253
|
+
helpers4.isArray = function(value) {
|
|
240
254
|
return Array.isArray(value);
|
|
241
255
|
};
|
|
242
|
-
|
|
256
|
+
helpers4.itemAt = function(array, idx) {
|
|
243
257
|
array = util.result(array);
|
|
244
258
|
if (Array.isArray(array)) {
|
|
245
259
|
idx = utils.isNumber(idx) ? +idx : 0;
|
|
@@ -251,13 +265,13 @@ var require_array = __commonJS({
|
|
|
251
265
|
}
|
|
252
266
|
}
|
|
253
267
|
};
|
|
254
|
-
|
|
268
|
+
helpers4.join = function(array, separator) {
|
|
255
269
|
if (typeof array === "string") return array;
|
|
256
270
|
if (!Array.isArray(array)) return "";
|
|
257
271
|
separator = util.isString(separator) ? separator : ", ";
|
|
258
272
|
return array.join(separator);
|
|
259
273
|
};
|
|
260
|
-
|
|
274
|
+
helpers4.equalsLength = function(value, length, options) {
|
|
261
275
|
if (util.isOptions(length)) {
|
|
262
276
|
options = length;
|
|
263
277
|
length = 0;
|
|
@@ -268,7 +282,7 @@ var require_array = __commonJS({
|
|
|
268
282
|
}
|
|
269
283
|
return util.value(len === length, this, options);
|
|
270
284
|
};
|
|
271
|
-
|
|
285
|
+
helpers4.last = function(value, n) {
|
|
272
286
|
if (!Array.isArray(value) && typeof value !== "string") {
|
|
273
287
|
return "";
|
|
274
288
|
}
|
|
@@ -277,7 +291,7 @@ var require_array = __commonJS({
|
|
|
277
291
|
}
|
|
278
292
|
return value.slice(-Math.abs(n));
|
|
279
293
|
};
|
|
280
|
-
|
|
294
|
+
helpers4.length = function(value) {
|
|
281
295
|
if (util.isObject(value) && !util.isOptions(value)) {
|
|
282
296
|
value = Object.keys(value);
|
|
283
297
|
}
|
|
@@ -286,8 +300,8 @@ var require_array = __commonJS({
|
|
|
286
300
|
}
|
|
287
301
|
return 0;
|
|
288
302
|
};
|
|
289
|
-
|
|
290
|
-
|
|
303
|
+
helpers4.lengthEqual = helpers4.equalsLength;
|
|
304
|
+
helpers4.map = function(array, iter) {
|
|
291
305
|
if (!Array.isArray(array)) return "";
|
|
292
306
|
var len = array.length;
|
|
293
307
|
var res = new Array(len);
|
|
@@ -300,7 +314,7 @@ var require_array = __commonJS({
|
|
|
300
314
|
}
|
|
301
315
|
return res;
|
|
302
316
|
};
|
|
303
|
-
|
|
317
|
+
helpers4.pluck = function(arr, prop) {
|
|
304
318
|
if (util.isUndefined(arr)) return "";
|
|
305
319
|
var res = [];
|
|
306
320
|
for (var i = 0; i < arr.length; i++) {
|
|
@@ -311,7 +325,7 @@ var require_array = __commonJS({
|
|
|
311
325
|
}
|
|
312
326
|
return res;
|
|
313
327
|
};
|
|
314
|
-
|
|
328
|
+
helpers4.reverse = function(val) {
|
|
315
329
|
if (Array.isArray(val)) {
|
|
316
330
|
val.reverse();
|
|
317
331
|
return val;
|
|
@@ -320,7 +334,7 @@ var require_array = __commonJS({
|
|
|
320
334
|
return val.split("").reverse().join("");
|
|
321
335
|
}
|
|
322
336
|
};
|
|
323
|
-
|
|
337
|
+
helpers4.some = function(array, iter, options) {
|
|
324
338
|
if (Array.isArray(array)) {
|
|
325
339
|
for (var i = 0; i < array.length; i++) {
|
|
326
340
|
if (iter(array[i], i, array)) {
|
|
@@ -330,14 +344,14 @@ var require_array = __commonJS({
|
|
|
330
344
|
}
|
|
331
345
|
return options.inverse(this);
|
|
332
346
|
};
|
|
333
|
-
|
|
347
|
+
helpers4.sort = function(array, options) {
|
|
334
348
|
if (!Array.isArray(array)) return "";
|
|
335
349
|
if (utils.get(options, "hash.reverse")) {
|
|
336
350
|
return array.sort().reverse();
|
|
337
351
|
}
|
|
338
352
|
return array.sort();
|
|
339
353
|
};
|
|
340
|
-
|
|
354
|
+
helpers4.sortBy = function(array, prop, options) {
|
|
341
355
|
if (!Array.isArray(array)) return "";
|
|
342
356
|
var args = [].slice.call(arguments);
|
|
343
357
|
args.pop();
|
|
@@ -346,7 +360,7 @@ var require_array = __commonJS({
|
|
|
346
360
|
}
|
|
347
361
|
return utils.sortBy.apply(null, args);
|
|
348
362
|
};
|
|
349
|
-
|
|
363
|
+
helpers4.withAfter = function(array, idx, options) {
|
|
350
364
|
if (!Array.isArray(array)) return "";
|
|
351
365
|
array = array.slice(idx);
|
|
352
366
|
var result = "";
|
|
@@ -355,7 +369,7 @@ var require_array = __commonJS({
|
|
|
355
369
|
}
|
|
356
370
|
return result;
|
|
357
371
|
};
|
|
358
|
-
|
|
372
|
+
helpers4.withBefore = function(array, idx, options) {
|
|
359
373
|
if (!Array.isArray(array)) return "";
|
|
360
374
|
array = array.slice(0, -idx);
|
|
361
375
|
var result = "";
|
|
@@ -364,7 +378,7 @@ var require_array = __commonJS({
|
|
|
364
378
|
}
|
|
365
379
|
return result;
|
|
366
380
|
};
|
|
367
|
-
|
|
381
|
+
helpers4.withFirst = function(array, idx, options) {
|
|
368
382
|
if (util.isUndefined(array)) return "";
|
|
369
383
|
array = util.result(array);
|
|
370
384
|
if (!util.isUndefined(idx)) {
|
|
@@ -381,7 +395,7 @@ var require_array = __commonJS({
|
|
|
381
395
|
}
|
|
382
396
|
return result;
|
|
383
397
|
};
|
|
384
|
-
|
|
398
|
+
helpers4.withGroup = function(array, size, options) {
|
|
385
399
|
var result = "";
|
|
386
400
|
if (Array.isArray(array) && array.length > 0) {
|
|
387
401
|
var subcontext = [];
|
|
@@ -396,7 +410,7 @@ var require_array = __commonJS({
|
|
|
396
410
|
}
|
|
397
411
|
return result;
|
|
398
412
|
};
|
|
399
|
-
|
|
413
|
+
helpers4.withLast = function(array, idx, options) {
|
|
400
414
|
if (util.isUndefined(array)) return "";
|
|
401
415
|
array = util.result(array);
|
|
402
416
|
if (!util.isUndefined(idx)) {
|
|
@@ -414,7 +428,7 @@ var require_array = __commonJS({
|
|
|
414
428
|
}
|
|
415
429
|
return result;
|
|
416
430
|
};
|
|
417
|
-
|
|
431
|
+
helpers4.withSort = function(array, prop, options) {
|
|
418
432
|
if (util.isUndefined(array)) return "";
|
|
419
433
|
var result = "";
|
|
420
434
|
if (util.isUndefined(prop)) {
|
|
@@ -442,7 +456,7 @@ var require_array = __commonJS({
|
|
|
442
456
|
}
|
|
443
457
|
return result;
|
|
444
458
|
};
|
|
445
|
-
|
|
459
|
+
helpers4.unique = function(array, options) {
|
|
446
460
|
if (util.isUndefined(array)) return "";
|
|
447
461
|
return array.filter(function(item, index, arr) {
|
|
448
462
|
return arr.indexOf(item) === index;
|
|
@@ -455,23 +469,23 @@ var require_array = __commonJS({
|
|
|
455
469
|
var require_code = __commonJS({
|
|
456
470
|
"helpers/lib/code.js"(exports2, module2) {
|
|
457
471
|
"use strict";
|
|
458
|
-
var
|
|
459
|
-
var
|
|
472
|
+
var fs2 = require("fs");
|
|
473
|
+
var path2 = require("path");
|
|
460
474
|
var utils = require_utils2();
|
|
461
|
-
var
|
|
462
|
-
|
|
463
|
-
ext = typeof ext !== "string" ?
|
|
464
|
-
var code =
|
|
475
|
+
var helpers4 = module2.exports;
|
|
476
|
+
helpers4.embed = function embed(filepath, ext) {
|
|
477
|
+
ext = typeof ext !== "string" ? path2.extname(filepath).slice(1) : ext;
|
|
478
|
+
var code = fs2.readFileSync(filepath, "utf8");
|
|
465
479
|
if (ext === "markdown" || ext === "md") {
|
|
466
480
|
ext = "markdown";
|
|
467
481
|
code = code.split("`").join("`");
|
|
468
482
|
}
|
|
469
483
|
return utils.block(code, ext).trim() + "\n";
|
|
470
484
|
};
|
|
471
|
-
|
|
485
|
+
helpers4.gist = function(id) {
|
|
472
486
|
return utils.tag("script", { src: "https://gist.github.com/" + id + ".js" });
|
|
473
487
|
};
|
|
474
|
-
|
|
488
|
+
helpers4.jsfiddle = function jsFiddle(options) {
|
|
475
489
|
var attr = Object.assign({}, options && options.hash);
|
|
476
490
|
if (typeof attr.id === "undefined") {
|
|
477
491
|
throw new Error("jsfiddle helper expects an `id`");
|
|
@@ -500,8 +514,8 @@ var require_object = __commonJS({
|
|
|
500
514
|
var util = require("handlebars-utils");
|
|
501
515
|
var array = require_array();
|
|
502
516
|
var utils = require_utils2();
|
|
503
|
-
var
|
|
504
|
-
|
|
517
|
+
var helpers4 = module2.exports;
|
|
518
|
+
helpers4.extend = function() {
|
|
505
519
|
var args = [].slice.call(arguments);
|
|
506
520
|
var opts = {};
|
|
507
521
|
if (util.isOptions(args[args.length - 1])) {
|
|
@@ -521,7 +535,7 @@ var require_object = __commonJS({
|
|
|
521
535
|
}
|
|
522
536
|
return context;
|
|
523
537
|
};
|
|
524
|
-
|
|
538
|
+
helpers4.forIn = function(obj, options) {
|
|
525
539
|
if (!util.isOptions(options)) {
|
|
526
540
|
return obj.inverse(this);
|
|
527
541
|
}
|
|
@@ -533,7 +547,7 @@ var require_object = __commonJS({
|
|
|
533
547
|
}
|
|
534
548
|
return result;
|
|
535
549
|
};
|
|
536
|
-
|
|
550
|
+
helpers4.forOwn = function(obj, options) {
|
|
537
551
|
if (!util.isOptions(options)) {
|
|
538
552
|
return obj.inverse(this);
|
|
539
553
|
}
|
|
@@ -547,7 +561,7 @@ var require_object = __commonJS({
|
|
|
547
561
|
}
|
|
548
562
|
return result;
|
|
549
563
|
};
|
|
550
|
-
|
|
564
|
+
helpers4.toPath = function() {
|
|
551
565
|
var prop = [];
|
|
552
566
|
for (var i = 0; i < arguments.length; i++) {
|
|
553
567
|
if (typeof arguments[i] === "string" || typeof arguments[i] === "number") {
|
|
@@ -556,32 +570,32 @@ var require_object = __commonJS({
|
|
|
556
570
|
}
|
|
557
571
|
return prop.join(".");
|
|
558
572
|
};
|
|
559
|
-
|
|
573
|
+
helpers4.get = function(prop, context, options) {
|
|
560
574
|
var val = utils.get(context, prop);
|
|
561
575
|
if (options && options.fn) {
|
|
562
576
|
return val ? options.fn(val) : options.inverse(context);
|
|
563
577
|
}
|
|
564
578
|
return val;
|
|
565
579
|
};
|
|
566
|
-
|
|
580
|
+
helpers4.getObject = function(prop, context) {
|
|
567
581
|
return utils.getObject(context, prop);
|
|
568
582
|
};
|
|
569
|
-
|
|
583
|
+
helpers4.hasOwn = function(context, key) {
|
|
570
584
|
return hasOwn.call(context, key);
|
|
571
585
|
};
|
|
572
|
-
|
|
586
|
+
helpers4.isObject = function(value) {
|
|
573
587
|
return utils.typeOf(value) === "object";
|
|
574
588
|
};
|
|
575
|
-
|
|
589
|
+
helpers4.JSONparse = function(str, options) {
|
|
576
590
|
return JSON.parse(str);
|
|
577
591
|
};
|
|
578
|
-
|
|
592
|
+
helpers4.JSONstringify = function(obj, indent) {
|
|
579
593
|
if (!utils.isNumber(indent)) {
|
|
580
594
|
indent = 0;
|
|
581
595
|
}
|
|
582
596
|
return JSON.stringify(obj, null, indent);
|
|
583
597
|
};
|
|
584
|
-
|
|
598
|
+
helpers4.merge = function(context) {
|
|
585
599
|
var args = [].slice.call(arguments);
|
|
586
600
|
var opts = {};
|
|
587
601
|
if (util.isOptions(args[args.length - 1])) {
|
|
@@ -590,13 +604,13 @@ var require_object = __commonJS({
|
|
|
590
604
|
}
|
|
591
605
|
return Object.assign.apply(null, args);
|
|
592
606
|
};
|
|
593
|
-
|
|
594
|
-
|
|
607
|
+
helpers4.parseJSON = helpers4.JSONparse;
|
|
608
|
+
helpers4.pick = function(props, context, options) {
|
|
595
609
|
var keys = array.arrayify(props);
|
|
596
610
|
var len = keys.length, i = -1;
|
|
597
611
|
var result = {};
|
|
598
612
|
while (++i < len) {
|
|
599
|
-
result =
|
|
613
|
+
result = helpers4.extend({}, result, utils.getObject(context, keys[i]));
|
|
600
614
|
}
|
|
601
615
|
if (options.fn) {
|
|
602
616
|
if (Object.keys(result).length) {
|
|
@@ -606,7 +620,7 @@ var require_object = __commonJS({
|
|
|
606
620
|
}
|
|
607
621
|
return result;
|
|
608
622
|
};
|
|
609
|
-
|
|
623
|
+
helpers4.stringify = helpers4.JSONstringify;
|
|
610
624
|
}
|
|
611
625
|
});
|
|
612
626
|
|
|
@@ -619,8 +633,8 @@ var require_collection = __commonJS({
|
|
|
619
633
|
var array = require_array();
|
|
620
634
|
var forEach = array.forEach;
|
|
621
635
|
var forOwn = object.forOwn;
|
|
622
|
-
var
|
|
623
|
-
|
|
636
|
+
var helpers4 = module2.exports;
|
|
637
|
+
helpers4.isEmpty = function(collection, options) {
|
|
624
638
|
if (!util.isOptions(options)) {
|
|
625
639
|
options = collection;
|
|
626
640
|
return util.fn(true, this, options);
|
|
@@ -632,7 +646,7 @@ var require_collection = __commonJS({
|
|
|
632
646
|
var isEmpty = typeof collection === "object" && !keys.length;
|
|
633
647
|
return util.value(isEmpty, this, options);
|
|
634
648
|
};
|
|
635
|
-
|
|
649
|
+
helpers4.iterate = function(collection, options) {
|
|
636
650
|
if (Array.isArray(collection)) {
|
|
637
651
|
return forEach.apply(null, arguments);
|
|
638
652
|
}
|
|
@@ -651,8 +665,8 @@ var require_comparison = __commonJS({
|
|
|
651
665
|
var has = require("has-value");
|
|
652
666
|
var util = require("handlebars-utils");
|
|
653
667
|
var utils = require_utils2();
|
|
654
|
-
var
|
|
655
|
-
|
|
668
|
+
var helpers4 = module2.exports;
|
|
669
|
+
helpers4.and = function() {
|
|
656
670
|
var len = arguments.length - 1;
|
|
657
671
|
var options = arguments[len];
|
|
658
672
|
var val = true;
|
|
@@ -664,7 +678,7 @@ var require_comparison = __commonJS({
|
|
|
664
678
|
}
|
|
665
679
|
return util.value(val, this, options);
|
|
666
680
|
};
|
|
667
|
-
|
|
681
|
+
helpers4.compare = function(a, operator, b, options) {
|
|
668
682
|
if (arguments.length < 4) {
|
|
669
683
|
throw new Error("handlebars Helper {{compare}} expects 4 arguments");
|
|
670
684
|
}
|
|
@@ -703,7 +717,7 @@ var require_comparison = __commonJS({
|
|
|
703
717
|
}
|
|
704
718
|
return util.value(result, this, options);
|
|
705
719
|
};
|
|
706
|
-
|
|
720
|
+
helpers4.contains = function(collection, value, startIndex, options) {
|
|
707
721
|
if (typeof startIndex === "object") {
|
|
708
722
|
options = startIndex;
|
|
709
723
|
startIndex = void 0;
|
|
@@ -711,34 +725,34 @@ var require_comparison = __commonJS({
|
|
|
711
725
|
var val = utils.contains(collection, value, startIndex);
|
|
712
726
|
return util.value(val, this, options);
|
|
713
727
|
};
|
|
714
|
-
|
|
728
|
+
helpers4.default = function() {
|
|
715
729
|
for (var i = 0; i < arguments.length - 1; i++) {
|
|
716
730
|
if (arguments[i] != null) return arguments[i];
|
|
717
731
|
}
|
|
718
732
|
return "";
|
|
719
733
|
};
|
|
720
|
-
|
|
734
|
+
helpers4.eq = function(a, b, options) {
|
|
721
735
|
if (arguments.length === 2) {
|
|
722
736
|
options = b;
|
|
723
737
|
b = options.hash.compare;
|
|
724
738
|
}
|
|
725
739
|
return util.value(a === b, this, options);
|
|
726
740
|
};
|
|
727
|
-
|
|
741
|
+
helpers4.gt = function(a, b, options) {
|
|
728
742
|
if (arguments.length === 2) {
|
|
729
743
|
options = b;
|
|
730
744
|
b = options.hash.compare;
|
|
731
745
|
}
|
|
732
746
|
return util.value(a > b, this, options);
|
|
733
747
|
};
|
|
734
|
-
|
|
748
|
+
helpers4.gte = function(a, b, options) {
|
|
735
749
|
if (arguments.length === 2) {
|
|
736
750
|
options = b;
|
|
737
751
|
b = options.hash.compare;
|
|
738
752
|
}
|
|
739
753
|
return util.value(a >= b, this, options);
|
|
740
754
|
};
|
|
741
|
-
|
|
755
|
+
helpers4.has = function(value, pattern, options) {
|
|
742
756
|
if (util.isOptions(value)) {
|
|
743
757
|
options = value;
|
|
744
758
|
pattern = null;
|
|
@@ -764,57 +778,57 @@ var require_comparison = __commonJS({
|
|
|
764
778
|
}
|
|
765
779
|
return util.inverse(false, this, options);
|
|
766
780
|
};
|
|
767
|
-
|
|
781
|
+
helpers4.isFalsey = function(val, options) {
|
|
768
782
|
return util.value(utils.falsey(val), this, options);
|
|
769
783
|
};
|
|
770
|
-
|
|
784
|
+
helpers4.isTruthy = function(val, options) {
|
|
771
785
|
return util.value(!utils.falsey(val), this, options);
|
|
772
786
|
};
|
|
773
|
-
|
|
787
|
+
helpers4.ifEven = function(num, options) {
|
|
774
788
|
return util.value(utils.isEven(num), this, options);
|
|
775
789
|
};
|
|
776
|
-
|
|
790
|
+
helpers4.ifNth = function(a, b, options) {
|
|
777
791
|
var isNth = utils.isNumber(a) && utils.isNumber(b) && b % a === 0;
|
|
778
792
|
return util.value(isNth, this, options);
|
|
779
793
|
};
|
|
780
|
-
|
|
794
|
+
helpers4.ifOdd = function(val, options) {
|
|
781
795
|
return util.value(!utils.isEven(val), this, options);
|
|
782
796
|
};
|
|
783
|
-
|
|
797
|
+
helpers4.is = function(a, b, options) {
|
|
784
798
|
if (arguments.length === 2) {
|
|
785
799
|
options = b;
|
|
786
800
|
b = options.hash.compare;
|
|
787
801
|
}
|
|
788
802
|
return util.value(a == b, this, options);
|
|
789
803
|
};
|
|
790
|
-
|
|
804
|
+
helpers4.isnt = function(a, b, options) {
|
|
791
805
|
if (arguments.length === 2) {
|
|
792
806
|
options = b;
|
|
793
807
|
b = options.hash.compare;
|
|
794
808
|
}
|
|
795
809
|
return util.value(a != b, this, options);
|
|
796
810
|
};
|
|
797
|
-
|
|
811
|
+
helpers4.lt = function(a, b, options) {
|
|
798
812
|
if (arguments.length === 2) {
|
|
799
813
|
options = b;
|
|
800
814
|
b = options.hash.compare;
|
|
801
815
|
}
|
|
802
816
|
return util.value(a < b, this, options);
|
|
803
817
|
};
|
|
804
|
-
|
|
818
|
+
helpers4.lte = function(a, b, options) {
|
|
805
819
|
if (arguments.length === 2) {
|
|
806
820
|
options = b;
|
|
807
821
|
b = options.hash.compare;
|
|
808
822
|
}
|
|
809
823
|
return util.value(a <= b, this, options);
|
|
810
824
|
};
|
|
811
|
-
|
|
825
|
+
helpers4.neither = function(a, b, options) {
|
|
812
826
|
return util.value(!a && !b, this, options);
|
|
813
827
|
};
|
|
814
|
-
|
|
828
|
+
helpers4.not = function(val, options) {
|
|
815
829
|
return util.value(!val, this, options);
|
|
816
830
|
};
|
|
817
|
-
|
|
831
|
+
helpers4.or = function() {
|
|
818
832
|
var len = arguments.length - 1;
|
|
819
833
|
var options = arguments[len];
|
|
820
834
|
var val = false;
|
|
@@ -826,35 +840,35 @@ var require_comparison = __commonJS({
|
|
|
826
840
|
}
|
|
827
841
|
return util.value(val, this, options);
|
|
828
842
|
};
|
|
829
|
-
|
|
843
|
+
helpers4.unlessEq = function(a, b, options) {
|
|
830
844
|
if (util.isOptions(b)) {
|
|
831
845
|
options = b;
|
|
832
846
|
b = options.hash.compare;
|
|
833
847
|
}
|
|
834
848
|
return util.value(a !== b, this, options);
|
|
835
849
|
};
|
|
836
|
-
|
|
850
|
+
helpers4.unlessGt = function(a, b, options) {
|
|
837
851
|
if (util.isOptions(b)) {
|
|
838
852
|
options = b;
|
|
839
853
|
b = options.hash.compare;
|
|
840
854
|
}
|
|
841
855
|
return util.value(a <= b, this, options);
|
|
842
856
|
};
|
|
843
|
-
|
|
857
|
+
helpers4.unlessLt = function(a, b, options) {
|
|
844
858
|
if (util.isOptions(b)) {
|
|
845
859
|
options = b;
|
|
846
860
|
b = options.hash.compare;
|
|
847
861
|
}
|
|
848
862
|
return util.value(a >= b, this, options);
|
|
849
863
|
};
|
|
850
|
-
|
|
864
|
+
helpers4.unlessGteq = function(a, b, options) {
|
|
851
865
|
if (util.isOptions(b)) {
|
|
852
866
|
options = b;
|
|
853
867
|
b = options.hash.compare;
|
|
854
868
|
}
|
|
855
869
|
return util.value(a < b, this, options);
|
|
856
870
|
};
|
|
857
|
-
|
|
871
|
+
helpers4.unlessLteq = function(a, b, options) {
|
|
858
872
|
if (util.isOptions(b)) {
|
|
859
873
|
options = b;
|
|
860
874
|
b = options.hash.compare;
|
|
@@ -868,9 +882,9 @@ var require_comparison = __commonJS({
|
|
|
868
882
|
var require_date = __commonJS({
|
|
869
883
|
"helpers/lib/date.js"(exports2, module2) {
|
|
870
884
|
"use strict";
|
|
871
|
-
var
|
|
872
|
-
|
|
873
|
-
|
|
885
|
+
var helpers4 = module2.exports;
|
|
886
|
+
helpers4.year = require("year");
|
|
887
|
+
helpers4.moment = helpers4.date = require("helper-date");
|
|
874
888
|
}
|
|
875
889
|
});
|
|
876
890
|
|
|
@@ -881,8 +895,8 @@ var require_number = __commonJS({
|
|
|
881
895
|
var isNumber = require("is-number");
|
|
882
896
|
var util = require("handlebars-utils");
|
|
883
897
|
var utils = require_utils2();
|
|
884
|
-
var
|
|
885
|
-
|
|
898
|
+
var helpers4 = module2.exports;
|
|
899
|
+
helpers4.bytes = function(number, precision, options) {
|
|
886
900
|
if (number == null) return "0 B";
|
|
887
901
|
if (!utils.isNumber(number)) {
|
|
888
902
|
number = number.length;
|
|
@@ -905,14 +919,14 @@ var require_number = __commonJS({
|
|
|
905
919
|
}
|
|
906
920
|
return number;
|
|
907
921
|
};
|
|
908
|
-
|
|
922
|
+
helpers4.addCommas = function(num) {
|
|
909
923
|
return num.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
|
|
910
924
|
};
|
|
911
|
-
|
|
925
|
+
helpers4.phoneNumber = function(num) {
|
|
912
926
|
num = num.toString();
|
|
913
927
|
return "(" + num.substr(0, 3) + ") " + num.substr(3, 3) + "-" + num.substr(6, 4);
|
|
914
928
|
};
|
|
915
|
-
|
|
929
|
+
helpers4.toAbbr = function(number, precision) {
|
|
916
930
|
if (!utils.isNumber(number)) {
|
|
917
931
|
number = 0;
|
|
918
932
|
}
|
|
@@ -934,7 +948,7 @@ var require_number = __commonJS({
|
|
|
934
948
|
}
|
|
935
949
|
return number;
|
|
936
950
|
};
|
|
937
|
-
|
|
951
|
+
helpers4.toExponential = function(number, digits) {
|
|
938
952
|
if (!utils.isNumber(number)) {
|
|
939
953
|
number = 0;
|
|
940
954
|
}
|
|
@@ -943,7 +957,7 @@ var require_number = __commonJS({
|
|
|
943
957
|
}
|
|
944
958
|
return Number(number).toExponential(digits);
|
|
945
959
|
};
|
|
946
|
-
|
|
960
|
+
helpers4.toFixed = function(number, digits) {
|
|
947
961
|
if (!utils.isNumber(number)) {
|
|
948
962
|
number = 0;
|
|
949
963
|
}
|
|
@@ -952,13 +966,13 @@ var require_number = __commonJS({
|
|
|
952
966
|
}
|
|
953
967
|
return Number(number).toFixed(digits);
|
|
954
968
|
};
|
|
955
|
-
|
|
969
|
+
helpers4.toFloat = function(number) {
|
|
956
970
|
return parseFloat(number);
|
|
957
971
|
};
|
|
958
|
-
|
|
972
|
+
helpers4.toInt = function(number) {
|
|
959
973
|
return parseInt(number, 10);
|
|
960
974
|
};
|
|
961
|
-
|
|
975
|
+
helpers4.toPrecision = function(number, precision) {
|
|
962
976
|
if (!utils.isNumber(number)) {
|
|
963
977
|
number = 0;
|
|
964
978
|
}
|
|
@@ -974,20 +988,20 @@ var require_number = __commonJS({
|
|
|
974
988
|
var require_fs = __commonJS({
|
|
975
989
|
"helpers/lib/fs.js"(exports2, module2) {
|
|
976
990
|
"use strict";
|
|
977
|
-
var
|
|
978
|
-
var
|
|
991
|
+
var fs2 = require("fs");
|
|
992
|
+
var path2 = require("path");
|
|
979
993
|
var util = require("handlebars-utils");
|
|
980
994
|
var utils = require_utils2();
|
|
981
995
|
var number = require_number();
|
|
982
|
-
var
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
return
|
|
996
|
+
var helpers4 = module2.exports;
|
|
997
|
+
helpers4.fileSize = number.bytes;
|
|
998
|
+
helpers4.read = function(filepath, options) {
|
|
999
|
+
return fs2.readFileSync(filepath, "utf8");
|
|
986
1000
|
};
|
|
987
|
-
|
|
988
|
-
var files =
|
|
1001
|
+
helpers4.readdir = function(dir, filter) {
|
|
1002
|
+
var files = fs2.readdirSync(dir);
|
|
989
1003
|
files = files.map(function(fp) {
|
|
990
|
-
return
|
|
1004
|
+
return path2.join(dir, fp);
|
|
991
1005
|
});
|
|
992
1006
|
if (util.isOptions(filter)) {
|
|
993
1007
|
return files;
|
|
@@ -1012,7 +1026,7 @@ var require_fs = __commonJS({
|
|
|
1012
1026
|
}
|
|
1013
1027
|
if (["isFile", "isDirectory"].indexOf(filter) !== -1) {
|
|
1014
1028
|
return files.filter(function(fp) {
|
|
1015
|
-
var stat =
|
|
1029
|
+
var stat = fs2.statSync(fp);
|
|
1016
1030
|
return stat[filter]();
|
|
1017
1031
|
});
|
|
1018
1032
|
}
|
|
@@ -1064,17 +1078,17 @@ var require_html = __commonJS({
|
|
|
1064
1078
|
var require_html2 = __commonJS({
|
|
1065
1079
|
"helpers/lib/html.js"(exports2, module2) {
|
|
1066
1080
|
"use strict";
|
|
1067
|
-
var
|
|
1081
|
+
var path2 = require("path");
|
|
1068
1082
|
var util = require("handlebars-utils");
|
|
1069
1083
|
var html = require_html();
|
|
1070
1084
|
var utils = require_utils2();
|
|
1071
1085
|
var parseAttr = html.parseAttributes;
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1086
|
+
var helpers4 = module2.exports;
|
|
1087
|
+
helpers4.attr = function(options) {
|
|
1074
1088
|
var val = parseAttr(options && options.hash || {});
|
|
1075
1089
|
return val.trim() ? " " + val : "";
|
|
1076
1090
|
};
|
|
1077
|
-
|
|
1091
|
+
helpers4.css = function(list, options) {
|
|
1078
1092
|
if (arguments.length < 2) {
|
|
1079
1093
|
options = list;
|
|
1080
1094
|
list = [];
|
|
@@ -1088,10 +1102,10 @@ var require_html2 = __commonJS({
|
|
|
1088
1102
|
styles = util.arrayify(options.hash.href);
|
|
1089
1103
|
}
|
|
1090
1104
|
return styles.map(function(item) {
|
|
1091
|
-
var ext =
|
|
1105
|
+
var ext = path2.extname(item);
|
|
1092
1106
|
var fp = item;
|
|
1093
1107
|
if (!/(^\/\/)|(:\/\/)/.test(item)) {
|
|
1094
|
-
fp =
|
|
1108
|
+
fp = path2.posix.join(assets, item);
|
|
1095
1109
|
}
|
|
1096
1110
|
if (ext === ".less") {
|
|
1097
1111
|
return '<link type="text/css" rel="stylesheet/less" href="' + fp + '">';
|
|
@@ -1099,7 +1113,7 @@ var require_html2 = __commonJS({
|
|
|
1099
1113
|
return '<link type="text/css" rel="stylesheet" href="' + fp + '">';
|
|
1100
1114
|
}).join("\n");
|
|
1101
1115
|
};
|
|
1102
|
-
|
|
1116
|
+
helpers4.js = function(context) {
|
|
1103
1117
|
if (utils.typeOf(context) === "object") {
|
|
1104
1118
|
var attr = parseAttr(context.hash);
|
|
1105
1119
|
return "<script" + (attr ? " " + attr : "") + "></script>";
|
|
@@ -1109,13 +1123,13 @@ var require_html2 = __commonJS({
|
|
|
1109
1123
|
}
|
|
1110
1124
|
context = util.arrayify(context);
|
|
1111
1125
|
return context.map(function(fp) {
|
|
1112
|
-
return
|
|
1126
|
+
return path2.extname(fp) === ".coffee" ? utils.tag("script", { type: "text/coffeescript", src: fp }) : utils.tag("script", { src: fp });
|
|
1113
1127
|
}).join("\n");
|
|
1114
1128
|
};
|
|
1115
|
-
|
|
1129
|
+
helpers4.sanitize = function(str) {
|
|
1116
1130
|
return html.sanitize(str);
|
|
1117
1131
|
};
|
|
1118
|
-
|
|
1132
|
+
helpers4.ul = function(context, options) {
|
|
1119
1133
|
return "<ul " + parseAttr(options.hash) + ">" + context.map(function(item) {
|
|
1120
1134
|
if (typeof item !== "string") {
|
|
1121
1135
|
item = options.fn(item);
|
|
@@ -1123,7 +1137,7 @@ var require_html2 = __commonJS({
|
|
|
1123
1137
|
return "<li>" + item + "</li>";
|
|
1124
1138
|
}).join("\n") + "</ul>";
|
|
1125
1139
|
};
|
|
1126
|
-
|
|
1140
|
+
helpers4.ol = function(context, options) {
|
|
1127
1141
|
return "<ol " + parseAttr(options.hash) + ">" + context.map(function(item) {
|
|
1128
1142
|
if (typeof item !== "string") {
|
|
1129
1143
|
item = options.fn(item);
|
|
@@ -1131,7 +1145,7 @@ var require_html2 = __commonJS({
|
|
|
1131
1145
|
return "<li>" + item + "</li>";
|
|
1132
1146
|
}).join("\n") + "</ol>";
|
|
1133
1147
|
};
|
|
1134
|
-
|
|
1148
|
+
helpers4.thumbnailImage = function(context) {
|
|
1135
1149
|
var figure = "";
|
|
1136
1150
|
var image = "";
|
|
1137
1151
|
var link = context.full || false;
|
|
@@ -1176,8 +1190,8 @@ var require_i18n = __commonJS({
|
|
|
1176
1190
|
"use strict";
|
|
1177
1191
|
var util = require("handlebars-utils");
|
|
1178
1192
|
var utils = require_utils2();
|
|
1179
|
-
var
|
|
1180
|
-
|
|
1193
|
+
var helpers4 = module2.exports;
|
|
1194
|
+
helpers4.i18n = function(prop, locals, options) {
|
|
1181
1195
|
if (util.isOptions(locals)) {
|
|
1182
1196
|
options = locals;
|
|
1183
1197
|
locals = {};
|
|
@@ -1209,8 +1223,8 @@ var require_inflection = __commonJS({
|
|
|
1209
1223
|
"helpers/lib/inflection.js"(exports2, module2) {
|
|
1210
1224
|
"use strict";
|
|
1211
1225
|
var util = require("handlebars-utils");
|
|
1212
|
-
var
|
|
1213
|
-
|
|
1226
|
+
var helpers4 = module2.exports;
|
|
1227
|
+
helpers4.inflect = function(count, singular, plural, includeCount) {
|
|
1214
1228
|
var word = count > 1 || count === 0 ? plural : singular;
|
|
1215
1229
|
if (includeCount === true) {
|
|
1216
1230
|
return String(count) + " " + word;
|
|
@@ -1218,7 +1232,7 @@ var require_inflection = __commonJS({
|
|
|
1218
1232
|
return word;
|
|
1219
1233
|
}
|
|
1220
1234
|
};
|
|
1221
|
-
|
|
1235
|
+
helpers4.ordinalize = function(val) {
|
|
1222
1236
|
var num = Math.abs(Math.round(val));
|
|
1223
1237
|
var str = String(val);
|
|
1224
1238
|
var res = num % 100;
|
|
@@ -1252,9 +1266,9 @@ var require_logging = __commonJS({
|
|
|
1252
1266
|
var require_md = __commonJS({
|
|
1253
1267
|
"helpers/lib/md.js"(exports2, module2) {
|
|
1254
1268
|
"use strict";
|
|
1255
|
-
var
|
|
1256
|
-
var
|
|
1257
|
-
var { Remarkable } = require("remarkable");
|
|
1269
|
+
var fs2 = require("fs");
|
|
1270
|
+
var path2 = require("path");
|
|
1271
|
+
var { Remarkable: Remarkable2 } = require("remarkable");
|
|
1258
1272
|
var extend = require("extend-shallow");
|
|
1259
1273
|
var exists = require("fs-exists-sync");
|
|
1260
1274
|
var ent = require("ent");
|
|
@@ -1272,12 +1286,12 @@ var require_md = __commonJS({
|
|
|
1272
1286
|
var opts = extend({ cwd: process.cwd() }, this.options, options);
|
|
1273
1287
|
opts = extend({}, opts, opts.hash);
|
|
1274
1288
|
var md = markdown(opts);
|
|
1275
|
-
var filepath =
|
|
1289
|
+
var filepath = path2.resolve(opts.cwd, name);
|
|
1276
1290
|
var view;
|
|
1277
1291
|
var str = "";
|
|
1278
1292
|
if (exists(filepath)) {
|
|
1279
1293
|
this.app.create("mdfiles");
|
|
1280
|
-
str =
|
|
1294
|
+
str = fs2.readFileSync(filepath, "utf8");
|
|
1281
1295
|
view = this.app.mdfile(filepath, { path: filepath, content: str });
|
|
1282
1296
|
} else {
|
|
1283
1297
|
view = this.app.find(name);
|
|
@@ -1298,12 +1312,12 @@ var require_md = __commonJS({
|
|
|
1298
1312
|
var opts = extend({ cwd: process.cwd() }, ctx.options, options);
|
|
1299
1313
|
opts = extend({}, opts, opts.hash);
|
|
1300
1314
|
var md = markdown(opts);
|
|
1301
|
-
var filepath =
|
|
1315
|
+
var filepath = path2.resolve(opts.cwd, name);
|
|
1302
1316
|
var view;
|
|
1303
1317
|
var html = "";
|
|
1304
1318
|
var str = "";
|
|
1305
1319
|
if (exists(filepath)) {
|
|
1306
|
-
str =
|
|
1320
|
+
str = fs2.readFileSync(filepath, "utf8");
|
|
1307
1321
|
html = ent.decode(md.render(str));
|
|
1308
1322
|
} else if (app.views) {
|
|
1309
1323
|
view = app.find(name);
|
|
@@ -1330,7 +1344,7 @@ var require_md = __commonJS({
|
|
|
1330
1344
|
optsConfig.langPrefix = "lang-";
|
|
1331
1345
|
optsConfig.typographer = false;
|
|
1332
1346
|
optsConfig.xhtmlOut = false;
|
|
1333
|
-
const md = new
|
|
1347
|
+
const md = new Remarkable2(optsConfig);
|
|
1334
1348
|
return md;
|
|
1335
1349
|
}
|
|
1336
1350
|
}
|
|
@@ -1342,10 +1356,10 @@ var require_markdown = __commonJS({
|
|
|
1342
1356
|
"use strict";
|
|
1343
1357
|
var hljs = require("highlight.js");
|
|
1344
1358
|
var utils = require("handlebars-utils");
|
|
1345
|
-
var { Remarkable } = require("remarkable");
|
|
1346
|
-
var
|
|
1359
|
+
var { Remarkable: Remarkable2 } = require("remarkable");
|
|
1360
|
+
var helpers4 = module2.exports;
|
|
1347
1361
|
var markdown;
|
|
1348
|
-
Object.defineProperty(
|
|
1362
|
+
Object.defineProperty(helpers4, "markdown", {
|
|
1349
1363
|
configurable: true,
|
|
1350
1364
|
enumerable: true,
|
|
1351
1365
|
set: function(val) {
|
|
@@ -1355,9 +1369,9 @@ var require_markdown = __commonJS({
|
|
|
1355
1369
|
return markdown || (markdown = this.helpersForMarkdown());
|
|
1356
1370
|
}
|
|
1357
1371
|
});
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
const defaults = { html: true, breaks: true, highlight:
|
|
1372
|
+
helpers4.md = require_md();
|
|
1373
|
+
helpers4.helpersForMarkdown = function(config) {
|
|
1374
|
+
const defaults = { html: true, breaks: true, highlight: helpers4.highlightFormMarkdown };
|
|
1361
1375
|
if (typeof config === "string" || utils.isOptions(config)) {
|
|
1362
1376
|
return markdown2.apply(defaults, arguments);
|
|
1363
1377
|
}
|
|
@@ -1377,13 +1391,13 @@ var require_markdown = __commonJS({
|
|
|
1377
1391
|
if (opts.hasOwnProperty("lang")) {
|
|
1378
1392
|
opts.langPrefix = opts.lang;
|
|
1379
1393
|
}
|
|
1380
|
-
const md = new
|
|
1394
|
+
const md = new Remarkable2(opts);
|
|
1381
1395
|
const val = utils.value(str, ctx, options);
|
|
1382
1396
|
return md.render(val);
|
|
1383
1397
|
}
|
|
1384
1398
|
return markdown2;
|
|
1385
1399
|
};
|
|
1386
|
-
|
|
1400
|
+
helpers4.highlightFormMarkdown = function(code, lang) {
|
|
1387
1401
|
if (lang) {
|
|
1388
1402
|
return hljs.highlight(code, { language: lang }).value;
|
|
1389
1403
|
}
|
|
@@ -1398,23 +1412,23 @@ var require_match = __commonJS({
|
|
|
1398
1412
|
"use strict";
|
|
1399
1413
|
var util = require("handlebars-utils");
|
|
1400
1414
|
var utils = require_utils2();
|
|
1401
|
-
var
|
|
1402
|
-
|
|
1415
|
+
var helpers4 = module2.exports;
|
|
1416
|
+
helpers4.match = function(files, patterns, locals, options) {
|
|
1403
1417
|
var opts = util.options(this, locals, options);
|
|
1404
1418
|
if (typeof patterns === "string") {
|
|
1405
1419
|
patterns = patterns.split(/, */);
|
|
1406
1420
|
}
|
|
1407
1421
|
return utils.mm(files, patterns, opts);
|
|
1408
1422
|
};
|
|
1409
|
-
|
|
1423
|
+
helpers4.isMatch = function(files, patterns, locals, options) {
|
|
1410
1424
|
var opts = util.options(this, locals, options);
|
|
1411
1425
|
return utils.mm.isMatch(files, patterns, opts);
|
|
1412
1426
|
};
|
|
1413
|
-
|
|
1427
|
+
helpers4.mm = function() {
|
|
1414
1428
|
console.log("the {{mm}} helper is depcrecated and will be removed");
|
|
1415
1429
|
console.log("in handlebars-helpers v1.0.0, please use the {{match}}");
|
|
1416
1430
|
console.log("helper instead.");
|
|
1417
|
-
return
|
|
1431
|
+
return helpers4.match.apply(this, arguments);
|
|
1418
1432
|
};
|
|
1419
1433
|
}
|
|
1420
1434
|
});
|
|
@@ -1425,31 +1439,31 @@ var require_math = __commonJS({
|
|
|
1425
1439
|
"use strict";
|
|
1426
1440
|
var isNumber = require("is-number");
|
|
1427
1441
|
var utils = require_utils2();
|
|
1428
|
-
var
|
|
1429
|
-
|
|
1442
|
+
var helpers4 = module2.exports;
|
|
1443
|
+
helpers4.abs = function(num) {
|
|
1430
1444
|
if (!isNumber(num)) {
|
|
1431
1445
|
throw new TypeError("expected a number");
|
|
1432
1446
|
}
|
|
1433
1447
|
return Math.abs(num);
|
|
1434
1448
|
};
|
|
1435
|
-
|
|
1449
|
+
helpers4.add = function(a, b) {
|
|
1436
1450
|
if (isNumber(a) && isNumber(b)) {
|
|
1437
1451
|
return Number(a) + Number(b);
|
|
1438
1452
|
}
|
|
1439
1453
|
return "";
|
|
1440
1454
|
};
|
|
1441
|
-
|
|
1455
|
+
helpers4.avg = function() {
|
|
1442
1456
|
var args = [].concat.apply([], arguments);
|
|
1443
1457
|
args.pop();
|
|
1444
|
-
return
|
|
1458
|
+
return helpers4.sum(args) / args.length;
|
|
1445
1459
|
};
|
|
1446
|
-
|
|
1460
|
+
helpers4.ceil = function(num) {
|
|
1447
1461
|
if (!isNumber(num)) {
|
|
1448
1462
|
throw new TypeError("expected a number");
|
|
1449
1463
|
}
|
|
1450
1464
|
return Math.ceil(num);
|
|
1451
1465
|
};
|
|
1452
|
-
|
|
1466
|
+
helpers4.divide = function(a, b) {
|
|
1453
1467
|
if (!isNumber(a)) {
|
|
1454
1468
|
throw new TypeError("expected the first argument to be a number");
|
|
1455
1469
|
}
|
|
@@ -1458,13 +1472,13 @@ var require_math = __commonJS({
|
|
|
1458
1472
|
}
|
|
1459
1473
|
return Number(a) / Number(b);
|
|
1460
1474
|
};
|
|
1461
|
-
|
|
1475
|
+
helpers4.floor = function(num) {
|
|
1462
1476
|
if (!isNumber(num)) {
|
|
1463
1477
|
throw new TypeError("expected a number");
|
|
1464
1478
|
}
|
|
1465
1479
|
return Math.floor(num);
|
|
1466
1480
|
};
|
|
1467
|
-
|
|
1481
|
+
helpers4.minus = function(a, b) {
|
|
1468
1482
|
if (!isNumber(a)) {
|
|
1469
1483
|
throw new TypeError("expected the first argument to be a number");
|
|
1470
1484
|
}
|
|
@@ -1473,7 +1487,7 @@ var require_math = __commonJS({
|
|
|
1473
1487
|
}
|
|
1474
1488
|
return Number(a) - Number(b);
|
|
1475
1489
|
};
|
|
1476
|
-
|
|
1490
|
+
helpers4.modulo = function(a, b) {
|
|
1477
1491
|
if (!isNumber(a)) {
|
|
1478
1492
|
throw new TypeError("expected the first argument to be a number");
|
|
1479
1493
|
}
|
|
@@ -1482,7 +1496,7 @@ var require_math = __commonJS({
|
|
|
1482
1496
|
}
|
|
1483
1497
|
return Number(a) % Number(b);
|
|
1484
1498
|
};
|
|
1485
|
-
|
|
1499
|
+
helpers4.multiply = function(a, b) {
|
|
1486
1500
|
if (!isNumber(a)) {
|
|
1487
1501
|
throw new TypeError("expected the first argument to be a number");
|
|
1488
1502
|
}
|
|
@@ -1491,7 +1505,7 @@ var require_math = __commonJS({
|
|
|
1491
1505
|
}
|
|
1492
1506
|
return Number(a) * Number(b);
|
|
1493
1507
|
};
|
|
1494
|
-
|
|
1508
|
+
helpers4.plus = function(a, b) {
|
|
1495
1509
|
if (!isNumber(a)) {
|
|
1496
1510
|
throw new TypeError("expected the first argument to be a number");
|
|
1497
1511
|
}
|
|
@@ -1500,7 +1514,7 @@ var require_math = __commonJS({
|
|
|
1500
1514
|
}
|
|
1501
1515
|
return Number(a) + Number(b);
|
|
1502
1516
|
};
|
|
1503
|
-
|
|
1517
|
+
helpers4.random = function(min, max) {
|
|
1504
1518
|
if (!isNumber(min)) {
|
|
1505
1519
|
throw new TypeError("expected minimum to be a number");
|
|
1506
1520
|
}
|
|
@@ -1509,16 +1523,16 @@ var require_math = __commonJS({
|
|
|
1509
1523
|
}
|
|
1510
1524
|
return utils.random(min, max);
|
|
1511
1525
|
};
|
|
1512
|
-
|
|
1526
|
+
helpers4.remainder = function(a, b) {
|
|
1513
1527
|
return a % b;
|
|
1514
1528
|
};
|
|
1515
|
-
|
|
1529
|
+
helpers4.round = function(num) {
|
|
1516
1530
|
if (!isNumber(num)) {
|
|
1517
1531
|
throw new TypeError("expected a number");
|
|
1518
1532
|
}
|
|
1519
1533
|
return Math.round(num);
|
|
1520
1534
|
};
|
|
1521
|
-
|
|
1535
|
+
helpers4.subtract = function(a, b) {
|
|
1522
1536
|
if (!isNumber(a)) {
|
|
1523
1537
|
throw new TypeError("expected the first argument to be a number");
|
|
1524
1538
|
}
|
|
@@ -1527,7 +1541,7 @@ var require_math = __commonJS({
|
|
|
1527
1541
|
}
|
|
1528
1542
|
return Number(a) - Number(b);
|
|
1529
1543
|
};
|
|
1530
|
-
|
|
1544
|
+
helpers4.sum = function() {
|
|
1531
1545
|
var args = [].concat.apply([], arguments);
|
|
1532
1546
|
var len = args.length;
|
|
1533
1547
|
var sum = 0;
|
|
@@ -1538,8 +1552,8 @@ var require_math = __commonJS({
|
|
|
1538
1552
|
}
|
|
1539
1553
|
return sum;
|
|
1540
1554
|
};
|
|
1541
|
-
|
|
1542
|
-
return
|
|
1555
|
+
helpers4.times = function() {
|
|
1556
|
+
return helpers4.multiply.apply(this, arguments);
|
|
1543
1557
|
};
|
|
1544
1558
|
}
|
|
1545
1559
|
});
|
|
@@ -1550,16 +1564,16 @@ var require_misc = __commonJS({
|
|
|
1550
1564
|
"use strict";
|
|
1551
1565
|
var util = require("handlebars-utils");
|
|
1552
1566
|
var utils = require_utils2();
|
|
1553
|
-
var
|
|
1554
|
-
|
|
1555
|
-
|
|
1567
|
+
var helpers4 = module2.exports;
|
|
1568
|
+
helpers4.frame = require("handlebars-helper-create-frame");
|
|
1569
|
+
helpers4.option = function(prop, locals, options) {
|
|
1556
1570
|
return utils.get(util.options(this, locals, options), prop);
|
|
1557
1571
|
};
|
|
1558
|
-
|
|
1572
|
+
helpers4.noop = function(options) {
|
|
1559
1573
|
return options.fn(this);
|
|
1560
1574
|
};
|
|
1561
|
-
|
|
1562
|
-
|
|
1575
|
+
helpers4.typeOf = require("kind-of");
|
|
1576
|
+
helpers4.withHash = function(options) {
|
|
1563
1577
|
if (options.hash && Object.keys(options.hash).length) {
|
|
1564
1578
|
return options.fn(options.hash);
|
|
1565
1579
|
} else {
|
|
@@ -1574,29 +1588,29 @@ var require_path = __commonJS({
|
|
|
1574
1588
|
"helpers/lib/path.js"(exports2, module2) {
|
|
1575
1589
|
"use strict";
|
|
1576
1590
|
var util = require("handlebars-utils");
|
|
1577
|
-
var
|
|
1591
|
+
var path2 = require("path");
|
|
1578
1592
|
var utils = require_utils2();
|
|
1579
|
-
var
|
|
1593
|
+
var helpers4 = module2.exports;
|
|
1580
1594
|
utils.expectedType = (variableName, expectedType, variableValue) => {
|
|
1581
1595
|
const actualType = Object.prototype.toString.call(variableValue).slice(8, -1).toLowerCase();
|
|
1582
1596
|
if (actualType !== expectedType) {
|
|
1583
1597
|
throw new TypeError(`Expected ${variableName} to be of type ${expectedType}, but got ${actualType}`);
|
|
1584
1598
|
}
|
|
1585
1599
|
};
|
|
1586
|
-
|
|
1600
|
+
helpers4.absolute = function(filepath, options) {
|
|
1587
1601
|
options = options || { data: {} };
|
|
1588
1602
|
var context = util.options(this, options);
|
|
1589
1603
|
var ctx = Object.assign({}, options.data.root, context);
|
|
1590
1604
|
var cwd = ctx.cwd || process.cwd();
|
|
1591
|
-
return
|
|
1605
|
+
return path2.resolve(cwd, filepath);
|
|
1592
1606
|
};
|
|
1593
|
-
|
|
1607
|
+
helpers4.dirname = function(filepath, options) {
|
|
1594
1608
|
if (typeof filepath !== "string") {
|
|
1595
1609
|
throw new TypeError(utils.expectedType("filepath", "string", filepath));
|
|
1596
1610
|
}
|
|
1597
|
-
return
|
|
1611
|
+
return path2.dirname(filepath);
|
|
1598
1612
|
};
|
|
1599
|
-
|
|
1613
|
+
helpers4.relative = function(a, b) {
|
|
1600
1614
|
if (typeof a !== "string") {
|
|
1601
1615
|
throw new TypeError(utils.expectedType("first path", "string", a));
|
|
1602
1616
|
}
|
|
@@ -1605,32 +1619,32 @@ var require_path = __commonJS({
|
|
|
1605
1619
|
}
|
|
1606
1620
|
return utils.relative(a, b);
|
|
1607
1621
|
};
|
|
1608
|
-
|
|
1622
|
+
helpers4.basename = function(filepath) {
|
|
1609
1623
|
if (typeof filepath !== "string") {
|
|
1610
1624
|
throw new TypeError(utils.expectedType("filepath", "string", filepath));
|
|
1611
1625
|
}
|
|
1612
|
-
return
|
|
1626
|
+
return path2.basename(filepath);
|
|
1613
1627
|
};
|
|
1614
|
-
|
|
1628
|
+
helpers4.stem = function(filepath) {
|
|
1615
1629
|
if (typeof filepath !== "string") {
|
|
1616
1630
|
throw new TypeError(utils.expectedType("filepath", "string", filepath));
|
|
1617
1631
|
}
|
|
1618
|
-
return
|
|
1632
|
+
return path2.basename(filepath, path2.extname(filepath));
|
|
1619
1633
|
};
|
|
1620
|
-
|
|
1634
|
+
helpers4.extname = function(filepath) {
|
|
1621
1635
|
if (typeof filepath !== "string") {
|
|
1622
1636
|
throw new TypeError(utils.expectedType("filepath", "string", filepath));
|
|
1623
1637
|
}
|
|
1624
|
-
return
|
|
1638
|
+
return path2.extname(filepath);
|
|
1625
1639
|
};
|
|
1626
|
-
|
|
1640
|
+
helpers4.resolve = function(filepath) {
|
|
1627
1641
|
var args = [].slice.call(arguments);
|
|
1628
1642
|
var opts = util.options(this, args.pop());
|
|
1629
|
-
var cwd =
|
|
1643
|
+
var cwd = path2.resolve(opts.cwd || process.cwd());
|
|
1630
1644
|
args.unshift(cwd);
|
|
1631
|
-
return
|
|
1645
|
+
return path2.resolve.apply(path2, args);
|
|
1632
1646
|
};
|
|
1633
|
-
|
|
1647
|
+
helpers4.segments = function(filepath, a, b) {
|
|
1634
1648
|
if (typeof filepath !== "string") {
|
|
1635
1649
|
throw new TypeError(utils.expectedType("filepath", "string", filepath));
|
|
1636
1650
|
}
|
|
@@ -1646,12 +1660,12 @@ var require_regex = __commonJS({
|
|
|
1646
1660
|
"use strict";
|
|
1647
1661
|
var util = require("handlebars-utils");
|
|
1648
1662
|
var utils = require_utils2();
|
|
1649
|
-
var
|
|
1650
|
-
|
|
1663
|
+
var helpers4 = module2.exports;
|
|
1664
|
+
helpers4.toRegex = function(str, locals, options) {
|
|
1651
1665
|
var opts = util.options({}, locals, options);
|
|
1652
1666
|
return new RegExp(str, opts.flags);
|
|
1653
1667
|
};
|
|
1654
|
-
|
|
1668
|
+
helpers4.test = function(str, regex) {
|
|
1655
1669
|
if (!util.isString(str)) {
|
|
1656
1670
|
return false;
|
|
1657
1671
|
}
|
|
@@ -1670,32 +1684,32 @@ var require_string = __commonJS({
|
|
|
1670
1684
|
var isNumber = require("is-number");
|
|
1671
1685
|
var util = require("handlebars-utils");
|
|
1672
1686
|
var utils = require_utils2();
|
|
1673
|
-
var
|
|
1674
|
-
|
|
1687
|
+
var helpers4 = module2.exports;
|
|
1688
|
+
helpers4.append = function(str, suffix) {
|
|
1675
1689
|
if (typeof str === "string" && typeof suffix === "string") {
|
|
1676
1690
|
return str + suffix;
|
|
1677
1691
|
}
|
|
1678
1692
|
return str;
|
|
1679
1693
|
};
|
|
1680
|
-
|
|
1694
|
+
helpers4.camelcase = function(str) {
|
|
1681
1695
|
if (!util.isString(str)) return "";
|
|
1682
1696
|
return utils.changecase(str, function(ch) {
|
|
1683
1697
|
return ch.toUpperCase();
|
|
1684
1698
|
});
|
|
1685
1699
|
};
|
|
1686
|
-
|
|
1700
|
+
helpers4.capitalize = function(str) {
|
|
1687
1701
|
if (!util.isString(str)) return "";
|
|
1688
1702
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1689
1703
|
};
|
|
1690
|
-
|
|
1704
|
+
helpers4.capitalizeAll = function(str) {
|
|
1691
1705
|
if (!util.isString(str)) return "";
|
|
1692
1706
|
if (util.isString(str)) {
|
|
1693
1707
|
return str.replace(/\w\S*/g, function(word) {
|
|
1694
|
-
return
|
|
1708
|
+
return helpers4.capitalize(word);
|
|
1695
1709
|
});
|
|
1696
1710
|
}
|
|
1697
1711
|
};
|
|
1698
|
-
|
|
1712
|
+
helpers4.center = function(str, spaces) {
|
|
1699
1713
|
if (!util.isString(str)) return "";
|
|
1700
1714
|
var space = "";
|
|
1701
1715
|
var i = 0;
|
|
@@ -1705,48 +1719,48 @@ var require_string = __commonJS({
|
|
|
1705
1719
|
}
|
|
1706
1720
|
return space + str + space;
|
|
1707
1721
|
};
|
|
1708
|
-
|
|
1722
|
+
helpers4.chop = function(str) {
|
|
1709
1723
|
if (!util.isString(str)) return "";
|
|
1710
1724
|
return utils.chop(str);
|
|
1711
1725
|
};
|
|
1712
|
-
|
|
1726
|
+
helpers4.dashcase = function(str) {
|
|
1713
1727
|
if (!util.isString(str)) return "";
|
|
1714
1728
|
return utils.changecase(str, function(ch) {
|
|
1715
1729
|
return "-" + ch;
|
|
1716
1730
|
});
|
|
1717
1731
|
};
|
|
1718
|
-
|
|
1732
|
+
helpers4.dotcase = function(str) {
|
|
1719
1733
|
if (!util.isString(str)) return "";
|
|
1720
1734
|
return utils.changecase(str, function(ch) {
|
|
1721
1735
|
return "." + ch;
|
|
1722
1736
|
});
|
|
1723
1737
|
};
|
|
1724
|
-
|
|
1725
|
-
return
|
|
1738
|
+
helpers4.downcase = function() {
|
|
1739
|
+
return helpers4.lowercase.apply(this, arguments);
|
|
1726
1740
|
};
|
|
1727
|
-
|
|
1741
|
+
helpers4.ellipsis = function(str, limit) {
|
|
1728
1742
|
if (util.isString(str)) {
|
|
1729
1743
|
if (str.length <= limit) {
|
|
1730
1744
|
return str;
|
|
1731
1745
|
}
|
|
1732
|
-
return
|
|
1746
|
+
return helpers4.truncate(str, limit) + "\u2026";
|
|
1733
1747
|
}
|
|
1734
1748
|
};
|
|
1735
|
-
|
|
1749
|
+
helpers4.hyphenate = function(str) {
|
|
1736
1750
|
if (!util.isString(str)) return "";
|
|
1737
1751
|
return str.split(" ").join("-");
|
|
1738
1752
|
};
|
|
1739
|
-
|
|
1753
|
+
helpers4.isString = function(value) {
|
|
1740
1754
|
return typeof value === "string";
|
|
1741
1755
|
};
|
|
1742
|
-
|
|
1756
|
+
helpers4.lowercase = function(str) {
|
|
1743
1757
|
if (util.isObject(str) && str.fn) {
|
|
1744
1758
|
return str.fn(this).toLowerCase();
|
|
1745
1759
|
}
|
|
1746
1760
|
if (!util.isString(str)) return "";
|
|
1747
1761
|
return str.toLowerCase();
|
|
1748
1762
|
};
|
|
1749
|
-
|
|
1763
|
+
helpers4.occurrences = function(str, substring) {
|
|
1750
1764
|
if (!util.isString(str)) return "";
|
|
1751
1765
|
var len = substring.length;
|
|
1752
1766
|
var pos = 0;
|
|
@@ -1757,28 +1771,28 @@ var require_string = __commonJS({
|
|
|
1757
1771
|
}
|
|
1758
1772
|
return n;
|
|
1759
1773
|
};
|
|
1760
|
-
|
|
1774
|
+
helpers4.pascalcase = function(str) {
|
|
1761
1775
|
if (!util.isString(str)) return "";
|
|
1762
1776
|
str = utils.changecase(str, function(ch) {
|
|
1763
1777
|
return ch.toUpperCase();
|
|
1764
1778
|
});
|
|
1765
1779
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
1766
1780
|
};
|
|
1767
|
-
|
|
1781
|
+
helpers4.pathcase = function(str) {
|
|
1768
1782
|
if (!util.isString(str)) return "";
|
|
1769
1783
|
return utils.changecase(str, function(ch) {
|
|
1770
1784
|
return "/" + ch;
|
|
1771
1785
|
});
|
|
1772
1786
|
};
|
|
1773
|
-
|
|
1787
|
+
helpers4.plusify = function(str, ch) {
|
|
1774
1788
|
if (!util.isString(str)) return "";
|
|
1775
1789
|
if (!util.isString(ch)) ch = " ";
|
|
1776
1790
|
return str.split(ch).join("+");
|
|
1777
1791
|
};
|
|
1778
|
-
|
|
1792
|
+
helpers4.prepend = function(str, prefix) {
|
|
1779
1793
|
return typeof str === "string" && typeof prefix === "string" ? prefix + str : str;
|
|
1780
1794
|
};
|
|
1781
|
-
|
|
1795
|
+
helpers4.raw = function(options) {
|
|
1782
1796
|
var str = options.fn();
|
|
1783
1797
|
var opts = util.options(this, options);
|
|
1784
1798
|
if (opts.escape !== false) {
|
|
@@ -1792,50 +1806,50 @@ var require_string = __commonJS({
|
|
|
1792
1806
|
}
|
|
1793
1807
|
return str;
|
|
1794
1808
|
};
|
|
1795
|
-
|
|
1809
|
+
helpers4.remove = function(str, ch) {
|
|
1796
1810
|
if (!util.isString(str)) return "";
|
|
1797
1811
|
if (!util.isString(ch)) return str;
|
|
1798
1812
|
return str.split(ch).join("");
|
|
1799
1813
|
};
|
|
1800
|
-
|
|
1814
|
+
helpers4.removeFirst = function(str, ch) {
|
|
1801
1815
|
if (!util.isString(str)) return "";
|
|
1802
1816
|
if (!util.isString(ch)) return str;
|
|
1803
1817
|
return str.replace(ch, "");
|
|
1804
1818
|
};
|
|
1805
|
-
|
|
1819
|
+
helpers4.replace = function(str, a, b) {
|
|
1806
1820
|
if (!util.isString(str)) return "";
|
|
1807
1821
|
if (!util.isString(a)) return str;
|
|
1808
1822
|
if (!util.isString(b)) b = "";
|
|
1809
1823
|
return str.split(a).join(b);
|
|
1810
1824
|
};
|
|
1811
|
-
|
|
1825
|
+
helpers4.replaceFirst = function(str, a, b) {
|
|
1812
1826
|
if (!util.isString(str)) return "";
|
|
1813
1827
|
if (!util.isString(a)) return str;
|
|
1814
1828
|
if (!util.isString(b)) b = "";
|
|
1815
1829
|
return str.replace(a, b);
|
|
1816
1830
|
};
|
|
1817
|
-
|
|
1831
|
+
helpers4.reverse = function(str) {
|
|
1818
1832
|
if (!util.isString(str)) return "";
|
|
1819
1833
|
return str.split("").reverse().join("");
|
|
1820
1834
|
};
|
|
1821
|
-
|
|
1835
|
+
helpers4.sentence = function(str) {
|
|
1822
1836
|
if (!util.isString(str)) return "";
|
|
1823
1837
|
return str.replace(/((?:\S[^\.\?\!]*)[\.\?\!]*)/g, function(txt) {
|
|
1824
1838
|
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
|
1825
1839
|
});
|
|
1826
1840
|
};
|
|
1827
|
-
|
|
1841
|
+
helpers4.snakecase = function(str) {
|
|
1828
1842
|
if (!util.isString(str)) return "";
|
|
1829
1843
|
return utils.changecase(str, function(ch) {
|
|
1830
1844
|
return "_" + ch;
|
|
1831
1845
|
});
|
|
1832
1846
|
};
|
|
1833
|
-
|
|
1847
|
+
helpers4.split = function(str, ch) {
|
|
1834
1848
|
if (!util.isString(str)) return "";
|
|
1835
1849
|
if (!util.isString(ch)) ch = ",";
|
|
1836
1850
|
return str.split(ch);
|
|
1837
1851
|
};
|
|
1838
|
-
|
|
1852
|
+
helpers4.startsWith = function(prefix, str, options) {
|
|
1839
1853
|
var args = [].slice.call(arguments);
|
|
1840
1854
|
options = args.pop();
|
|
1841
1855
|
if (util.isString(str) && str.indexOf(prefix) === 0) {
|
|
@@ -1846,7 +1860,7 @@ var require_string = __commonJS({
|
|
|
1846
1860
|
}
|
|
1847
1861
|
return "";
|
|
1848
1862
|
};
|
|
1849
|
-
|
|
1863
|
+
helpers4.titleize = function(str) {
|
|
1850
1864
|
if (!util.isString(str)) return "";
|
|
1851
1865
|
var title = str.replace(/[- _]+/g, " ");
|
|
1852
1866
|
var words = title.split(" ");
|
|
@@ -1859,20 +1873,20 @@ var require_string = __commonJS({
|
|
|
1859
1873
|
}
|
|
1860
1874
|
return res.join(" ");
|
|
1861
1875
|
};
|
|
1862
|
-
|
|
1876
|
+
helpers4.trim = function(str) {
|
|
1863
1877
|
return typeof str === "string" ? str.trim() : "";
|
|
1864
1878
|
};
|
|
1865
|
-
|
|
1879
|
+
helpers4.trimLeft = function(str) {
|
|
1866
1880
|
if (util.isString(str)) {
|
|
1867
1881
|
return str.replace(/^\s+/, "");
|
|
1868
1882
|
}
|
|
1869
1883
|
};
|
|
1870
|
-
|
|
1884
|
+
helpers4.trimRight = function(str) {
|
|
1871
1885
|
if (util.isString(str)) {
|
|
1872
1886
|
return str.replace(/\s+$/, "");
|
|
1873
1887
|
}
|
|
1874
1888
|
};
|
|
1875
|
-
|
|
1889
|
+
helpers4.truncate = function(str, limit, suffix) {
|
|
1876
1890
|
if (util.isString(str)) {
|
|
1877
1891
|
if (typeof suffix !== "string") {
|
|
1878
1892
|
suffix = "";
|
|
@@ -1883,7 +1897,7 @@ var require_string = __commonJS({
|
|
|
1883
1897
|
return str;
|
|
1884
1898
|
}
|
|
1885
1899
|
};
|
|
1886
|
-
|
|
1900
|
+
helpers4.truncateWords = function(str, count, suffix) {
|
|
1887
1901
|
if (util.isString(str) && isNumber(count)) {
|
|
1888
1902
|
if (typeof suffix !== "string") {
|
|
1889
1903
|
suffix = "...";
|
|
@@ -1897,10 +1911,10 @@ var require_string = __commonJS({
|
|
|
1897
1911
|
return val + suffix;
|
|
1898
1912
|
}
|
|
1899
1913
|
};
|
|
1900
|
-
|
|
1901
|
-
return
|
|
1914
|
+
helpers4.upcase = function() {
|
|
1915
|
+
return helpers4.uppercase.apply(this, arguments);
|
|
1902
1916
|
};
|
|
1903
|
-
|
|
1917
|
+
helpers4.uppercase = function(str) {
|
|
1904
1918
|
if (util.isObject(str) && str.fn) {
|
|
1905
1919
|
return str.fn(this).toUpperCase();
|
|
1906
1920
|
}
|
|
@@ -1917,40 +1931,40 @@ var require_url = __commonJS({
|
|
|
1917
1931
|
var url = require("url");
|
|
1918
1932
|
var util = require("handlebars-utils");
|
|
1919
1933
|
var querystring = require("querystring");
|
|
1920
|
-
var
|
|
1921
|
-
|
|
1934
|
+
var helpers4 = module2.exports;
|
|
1935
|
+
helpers4.encodeURI = function(str) {
|
|
1922
1936
|
if (util.isString(str)) {
|
|
1923
1937
|
return encodeURIComponent(str);
|
|
1924
1938
|
}
|
|
1925
1939
|
};
|
|
1926
|
-
|
|
1940
|
+
helpers4.escape = function(str) {
|
|
1927
1941
|
if (util.isString(str)) {
|
|
1928
1942
|
return querystring.escape(str);
|
|
1929
1943
|
}
|
|
1930
1944
|
};
|
|
1931
|
-
|
|
1945
|
+
helpers4.decodeURI = function(str) {
|
|
1932
1946
|
if (util.isString(str)) {
|
|
1933
1947
|
return decodeURIComponent(str);
|
|
1934
1948
|
}
|
|
1935
1949
|
};
|
|
1936
|
-
|
|
1937
|
-
return
|
|
1950
|
+
helpers4.url_encode = function() {
|
|
1951
|
+
return helpers4.encodeURI.apply(this, arguments);
|
|
1938
1952
|
};
|
|
1939
|
-
|
|
1940
|
-
return
|
|
1953
|
+
helpers4.url_decode = function(val) {
|
|
1954
|
+
return helpers4.decodeURI.apply(this, arguments);
|
|
1941
1955
|
};
|
|
1942
|
-
|
|
1956
|
+
helpers4.urlResolve = function(base, href) {
|
|
1943
1957
|
return url.resolve(base, href);
|
|
1944
1958
|
};
|
|
1945
|
-
|
|
1959
|
+
helpers4.urlParse = function(str) {
|
|
1946
1960
|
return url.parse(str);
|
|
1947
1961
|
};
|
|
1948
|
-
|
|
1962
|
+
helpers4.stripQuerystring = function(str) {
|
|
1949
1963
|
if (util.isString(str)) {
|
|
1950
1964
|
return str.split("?")[0];
|
|
1951
1965
|
}
|
|
1952
1966
|
};
|
|
1953
|
-
|
|
1967
|
+
helpers4.stripProtocol = function(str) {
|
|
1954
1968
|
if (util.isString(str)) {
|
|
1955
1969
|
var parsed = url.parse(str);
|
|
1956
1970
|
parsed.protocol = "";
|
|
@@ -1996,7 +2010,7 @@ var require_helpers = __commonJS({
|
|
|
1996
2010
|
var forIn = require("for-in");
|
|
1997
2011
|
var define = require("define-property");
|
|
1998
2012
|
var lib = require_lib();
|
|
1999
|
-
module2.exports = function
|
|
2013
|
+
module2.exports = function helpers4(groups, options) {
|
|
2000
2014
|
if (typeof groups === "string") {
|
|
2001
2015
|
groups = [groups];
|
|
2002
2016
|
} else if (!Array.isArray(groups)) {
|
|
@@ -2033,15 +2047,16 @@ var require_helpers = __commonJS({
|
|
|
2033
2047
|
// src/index.ts
|
|
2034
2048
|
var index_exports = {};
|
|
2035
2049
|
__export(index_exports, {
|
|
2036
|
-
Handlebars: () =>
|
|
2050
|
+
Handlebars: () => Handlebars2,
|
|
2037
2051
|
HelperRegistry: () => HelperRegistry,
|
|
2038
2052
|
createHandlebars: () => createHandlebars,
|
|
2039
2053
|
fumanchu: () => fumanchu,
|
|
2040
2054
|
handlebars: () => handlebars,
|
|
2041
|
-
helpers: () =>
|
|
2055
|
+
helpers: () => helpers3
|
|
2042
2056
|
});
|
|
2043
2057
|
module.exports = __toCommonJS(index_exports);
|
|
2044
2058
|
var HandlebarsLib = __toESM(require("handlebars"));
|
|
2059
|
+
var import_helpers = __toESM(require_helpers());
|
|
2045
2060
|
|
|
2046
2061
|
// src/helpers/date.ts
|
|
2047
2062
|
var import_chrono_node = require("chrono-node");
|
|
@@ -2073,6 +2088,36 @@ var helpers = [
|
|
|
2073
2088
|
}
|
|
2074
2089
|
];
|
|
2075
2090
|
|
|
2091
|
+
// src/helpers/md.ts
|
|
2092
|
+
var import_node_fs = __toESM(require("fs"));
|
|
2093
|
+
var import_node_path = __toESM(require("path"));
|
|
2094
|
+
var import_node_process = __toESM(require("process"));
|
|
2095
|
+
var import_handlebars = __toESM(require("handlebars"));
|
|
2096
|
+
var import_remarkable = require("remarkable");
|
|
2097
|
+
var renderMarkdown = (input, options = {}) => {
|
|
2098
|
+
const options_ = __spreadValues({ cwd: import_node_process.default.cwd() }, options);
|
|
2099
|
+
const md = new import_remarkable.Remarkable({
|
|
2100
|
+
breaks: true,
|
|
2101
|
+
html: true,
|
|
2102
|
+
langPrefix: "lang-",
|
|
2103
|
+
typographer: false,
|
|
2104
|
+
xhtmlOut: false
|
|
2105
|
+
});
|
|
2106
|
+
const filepath = import_node_path.default.resolve(options_.cwd, input);
|
|
2107
|
+
let string_ = input;
|
|
2108
|
+
if (import_node_fs.default.existsSync(filepath)) {
|
|
2109
|
+
string_ = import_node_fs.default.readFileSync(filepath, "utf8");
|
|
2110
|
+
}
|
|
2111
|
+
return new import_handlebars.default.SafeString(md.render(string_));
|
|
2112
|
+
};
|
|
2113
|
+
var helpers2 = [
|
|
2114
|
+
{
|
|
2115
|
+
name: "md",
|
|
2116
|
+
category: "markdown",
|
|
2117
|
+
fn: renderMarkdown
|
|
2118
|
+
}
|
|
2119
|
+
];
|
|
2120
|
+
|
|
2076
2121
|
// src/helper-registry.ts
|
|
2077
2122
|
var HelperRegistry = class {
|
|
2078
2123
|
constructor() {
|
|
@@ -2081,6 +2126,7 @@ var HelperRegistry = class {
|
|
|
2081
2126
|
}
|
|
2082
2127
|
init() {
|
|
2083
2128
|
this.registerHelpers(helpers);
|
|
2129
|
+
this.registerHelpers(helpers2);
|
|
2084
2130
|
}
|
|
2085
2131
|
register(helper) {
|
|
2086
2132
|
const result = false;
|
|
@@ -2089,8 +2135,8 @@ var HelperRegistry = class {
|
|
|
2089
2135
|
}
|
|
2090
2136
|
return result;
|
|
2091
2137
|
}
|
|
2092
|
-
registerHelpers(
|
|
2093
|
-
for (const helper of
|
|
2138
|
+
registerHelpers(helpers4) {
|
|
2139
|
+
for (const helper of helpers4) {
|
|
2094
2140
|
this.register(helper);
|
|
2095
2141
|
}
|
|
2096
2142
|
}
|
|
@@ -2098,7 +2144,9 @@ var HelperRegistry = class {
|
|
|
2098
2144
|
return this._helpers.some((helper) => helper.name === name);
|
|
2099
2145
|
}
|
|
2100
2146
|
filter(filter) {
|
|
2101
|
-
return this._helpers.filter(
|
|
2147
|
+
return this._helpers.filter(
|
|
2148
|
+
(helper) => (!filter.name || helper.name === filter.name) && (!filter.category || helper.category === filter.category) && (!filter.compatibility || helper.compatibility === filter.compatibility)
|
|
2149
|
+
);
|
|
2102
2150
|
}
|
|
2103
2151
|
loadHandlebars(handlebars2) {
|
|
2104
2152
|
for (const helper of this._helpers) {
|
|
@@ -2114,10 +2162,9 @@ var HelperRegistry = class {
|
|
|
2114
2162
|
};
|
|
2115
2163
|
|
|
2116
2164
|
// src/index.ts
|
|
2117
|
-
var
|
|
2118
|
-
var Handlebars = HandlebarsLib;
|
|
2165
|
+
var Handlebars2 = HandlebarsLib;
|
|
2119
2166
|
var handlebars = HandlebarsLib.create();
|
|
2120
|
-
var
|
|
2167
|
+
var helpers3 = import_helpers.default;
|
|
2121
2168
|
function createHandlebars() {
|
|
2122
2169
|
return __async(this, null, function* () {
|
|
2123
2170
|
const registry = new HelperRegistry();
|