summaryrefslogtreecommitdiff
path: root/node_modules/handlebars/lib/handlebars/helpers/lookup.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/handlebars/lib/handlebars/helpers/lookup.js')
-rw-r--r--node_modules/handlebars/lib/handlebars/helpers/lookup.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/node_modules/handlebars/lib/handlebars/helpers/lookup.js b/node_modules/handlebars/lib/handlebars/helpers/lookup.js
new file mode 100644
index 0000000..5620aba
--- /dev/null
+++ b/node_modules/handlebars/lib/handlebars/helpers/lookup.js
@@ -0,0 +1,9 @@
+export default function(instance) {
+ instance.registerHelper('lookup', function(obj, field, options) {
+ if (!obj) {
+ // Note for 5.0: Change to "obj == null" in 5.0
+ return obj;
+ }
+ return options.lookupProperty(obj, field);
+ });
+}