Skip to content

Commit

Permalink
less annoying constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Apr 7, 2012
1 parent aeebf14 commit 2c5f693
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = Traverse;
module.exports = function (obj) {
return new Traverse(obj);
};

function Traverse (obj) {
if (!(this instanceof Traverse)) return new Traverse(obj);
this.value = obj;
}

Expand Down

0 comments on commit 2c5f693

Please sign in to comment.