Skip to content

Commit dd1a1fb

Browse files
authored
Merge pull request #2 from teslitsky/master
Fix task escaping
2 parents e5c8964 + 2cc599c commit dd1a1fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/task.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ function validDoc(doc){
265265
}
266266

267267
function isObject(obj){
268-
return obj && typeof obj === "object";
268+
return obj === Object(obj);
269269
}
270270

271271
function getModelName(model){
@@ -281,6 +281,10 @@ function handle$Token(obj, fix){
281281

282282
for(var i = 0; i < keys.length; i++){
283283
key = keys[i];
284+
285+
if(isObject(obj[key])){
286+
handle$Token(obj[key], fix);
287+
}
284288

285289
if(!fix && key[0] === "$"){
286290
obj[ESCAPE_PREFIX + key] = obj[key];

0 commit comments

Comments
 (0)