summaryrefslogtreecommitdiff
path: root/ext/bg/js/template-renderer.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-16 15:29:42 -0500
committerGitHub <noreply@github.com>2021-01-16 15:29:42 -0500
commitb2342945403c27e346446bbe316f075ed2b13eff (patch)
tree690a065de66ece5e0b395dbc2811d3d9fdbe13f9 /ext/bg/js/template-renderer.js
parent0ac35771192adb87d76809aff171d60a5d0018c3 (diff)
Stroke count marker (#1251)
* Add stroke-count definition * Update options * Update documentation * Add helper
Diffstat (limited to 'ext/bg/js/template-renderer.js')
-rw-r--r--ext/bg/js/template-renderer.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/bg/js/template-renderer.js b/ext/bg/js/template-renderer.js
index 4bf9448e..ae39e478 100644
--- a/ext/bg/js/template-renderer.js
+++ b/ext/bg/js/template-renderer.js
@@ -107,7 +107,8 @@ class TemplateRenderer {
['property', this._property.bind(this)],
['noop', this._noop.bind(this)],
['isMoraPitchHigh', this._isMoraPitchHigh.bind(this)],
- ['getKanaMorae', this._getKanaMorae.bind(this)]
+ ['getKanaMorae', this._getKanaMorae.bind(this)],
+ ['typeof', this._getTypeof.bind(this)]
];
for (const [name, helper] of helpers) {
@@ -406,4 +407,10 @@ class TemplateRenderer {
_getKanaMorae(context, text) {
return this._japaneseUtil.getKanaMorae(`${text}`);
}
+
+ _getTypeof(context, ...args) {
+ const ii = args.length - 1;
+ const value = (ii > 0 ? args[0] : args[ii].fn(context));
+ return typeof value;
+ }
}