Skip to content

Commit

Permalink
backwards compatible update for var Traverse = require('traverse') style
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jul 21, 2010
1 parent a4128c0 commit d0f50e9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/json.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
var sys = require('sys');
var Traverse = require('traverse').Traverse;
var Traverse = require('traverse');

var id = 54;
var callbacks = {};
Expand Down
2 changes: 1 addition & 1 deletion examples/leaves.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
var sys = require('sys');
var Traverse = require('traverse').Traverse;
var Traverse = require('traverse');

var acc = [];
Traverse({
Expand Down
2 changes: 1 addition & 1 deletion examples/negative.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
var sys = require('sys');
var Traverse = require('traverse').Traverse;
var Traverse = require('traverse');

var fixed = Traverse([
5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 }
Expand Down
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.2",
"version" : "0.0.3",
"description" : "Traverse and transform objects by visiting every node on a recursive walk.",
"author" : "James Halliday",
"main" : "traverse",
Expand Down
4 changes: 3 additions & 1 deletion traverse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
exports.Traverse = Traverse;
module.exports = Traverse;
module.exports.Traverse = Traverse;

function Traverse (obj) {
if (!(this instanceof Traverse)) return new Traverse(obj);

Expand Down

0 comments on commit d0f50e9

Please sign in to comment.