Skip to content

Commit

Permalink
stupid traversal bug, version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jul 28, 2010
1 parent 6b9d85d commit 4cf36f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "traverse",
"version" : "0.0.4",
"version" : "0.0.5",
"description" : "Traverse and transform objects by visiting every node on a recursive walk.",
"author" : "James Halliday",
"main" : "traverse",
Expand Down
2 changes: 1 addition & 1 deletion traverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function Traverse (refObj) {
// clone refObj for a properly immutable interface:
function clone(ref) {
if (typeof ref == 'object' && ref !== null) {
var node = ref.constructor();
var node = ref instanceof Array ? [] : {};
Object.keys(ref).forEach(function (key) {
node[key] = clone(ref[key]);
});
Expand Down

0 comments on commit 4cf36f3

Please sign in to comment.