Support dates
This commit is contained in:
parent
aecfdcec99
commit
d1473483b2
7
index.js
7
index.js
|
@ -30,6 +30,9 @@
|
||||||
// the literal `true`, we always wrap strings in quotes
|
// the literal `true`, we always wrap strings in quotes
|
||||||
return JSON.stringify(x);
|
return JSON.stringify(x);
|
||||||
}
|
}
|
||||||
|
, "date": function(x) {
|
||||||
|
return x.toJSON();
|
||||||
|
}
|
||||||
, "array": function (x) {
|
, "array": function (x) {
|
||||||
var output = ''
|
var output = ''
|
||||||
;
|
;
|
||||||
|
@ -50,10 +53,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
output += '\n' + indentLevel + '- ' + handler(y);
|
output += '\n' + indentLevel + '- ' + handler(y);
|
||||||
|
|
||||||
});
|
});
|
||||||
indentLevel = indentLevel.replace(/ /, '');
|
indentLevel = indentLevel.replace(/ /, '');
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
, "object": function (x) {
|
, "object": function (x) {
|
||||||
|
|
Loading…
Reference in New Issue