Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,28 @@
// Case 2: The item is Object
if (type === 'object') {

// Create a new sub-AST of type Object ($)
var ast = ['$'];

// Add each items
for (var key in item) {

if (!item.hasOwnProperty(key))
continue;
// If the item is instance of date object, convert it into timestamp and pass to case 5 for processing
if (item instanceof Date && item.getTime) {
item = item.getTime();
type = 'number';
} else {
// Create a new sub-AST of type Object ($)
var ast = ['$'];

// Add each items
for (var key in item) {

if (!item.hasOwnProperty(key))
continue;

ast.push(recursiveAstBuilder(key));
ast.push(recursiveAstBuilder(item[key]));
}

ast.push(recursiveAstBuilder(key));
ast.push(recursiveAstBuilder(item[key]));
// And return
return ast;
}

// And return
return ast;


}

// Case 3: The item empty string
Expand Down