From 6382ec91e81f4e986384a6aadfad8cd471759388 Mon Sep 17 00:00:00 2001 From: David da Silva Date: Tue, 9 May 2017 12:54:10 +0200 Subject: [PATCH] Remove `typeof obj === 'object'` constraint in prop lookup Allows rendering properties of primitive types that are not objects, such as a string. --- mustache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mustache.js b/mustache.js index 56d6d6f..52fa354 100644 --- a/mustache.js +++ b/mustache.js @@ -42,7 +42,7 @@ * including its prototype, has a given property */ function hasProperty (obj, propName) { - return obj != null && typeof obj === 'object' && (propName in obj); + return obj != null && (propName in obj); } // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577