Skip to content

Commit

Permalink
Normalized require() for local files
Browse files Browse the repository at this point in the history
Should make it (more) compatible with Node.js Tools for Visual Studio
  • Loading branch information
notheotherben committed Mar 20, 2014
1 parent 210f1ce commit 34dd019
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 29 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Database = require('./lib/Database');
var Database = require('./lib/Database.js');
var Concoction = require('concoction');

Database.Concoction = Concoction;
Expand Down
4 changes: 2 additions & 2 deletions lib/Database.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var MongoClient = require('mongodb').MongoClient;
var Model = require('./Model');
var Instance = require('./Instance');
var Model = require('./Model.js');
var Instance = require('./Instance.js');
var _ = require('lodash');

(require.modules || {}).Database = module.exports = Database;
Expand Down
6 changes: 3 additions & 3 deletions lib/Instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ var ObjectID = require('mongodb').ObjectID,
EventEmitter = require('events').EventEmitter,
debug = require('debug')('iridium:Instance'),

inherit = require('./utils/Inherit'),
validate = require('./utils/validation'),
diff = require('./utils/diff');
inherit = require('./utils/Inherit.js'),
validate = require('./utils/validation.js'),
diff = require('./utils/diff.js');


(require.modules || {}).Instance = module.exports = Instance;
Expand Down
10 changes: 5 additions & 5 deletions lib/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
EventEmitter = require('events').EventEmitter,
Concoction = require('concoction'),

inherit = require('./utils/Inherit'),
Database = require('./Database'),
Instance = require('./Instance'),
validate = require('./utils/validation'),
NoOpCache = require('./caches/NoOpCache');
inherit = require('./utils/Inherit.js'),
Database = require('./Database.js'),
Instance = require('./Instance.js'),
validate = require('./utils/validation.js'),
NoOpCache = require('./caches/NoOpCache.js');

(require.modules || {}).Model = module.exports = Model;

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/validation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var _ = require('lodash');
require('./String');
require('./String.js');


(require.modules || {}).validation = module.exports = validateType;
Expand Down
6 changes: 2 additions & 4 deletions test/cache.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/// <reference path="mocha.js"/>

var config = require('./config');
var Database = require('../');
var config = require('./config.js');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
4 changes: 2 additions & 2 deletions test/findOne.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var config = require('./config');
var Database = require('../index');
var config = require('./config.js');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
4 changes: 2 additions & 2 deletions test/hooks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var should = require('should'),
Database = require('../'),
Database = require('../index.js'),
Model = Database.Model,
Instance = Database.Instance;

describe('hooks', function() {
var db = new Database(require('./config'));
var db = new Database(require('./config.js'));

before(function(done) {
db.connect(done);
Expand Down
4 changes: 2 additions & 2 deletions test/insertion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var config = require('./config');
var Database = require('../');
var config = require('./config.js');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
2 changes: 1 addition & 1 deletion test/instance_db.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Database = require('../');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
2 changes: 1 addition & 1 deletion test/instance_helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Database = require('../');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
2 changes: 1 addition & 1 deletion test/instance_setup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Database = require('../');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
4 changes: 2 additions & 2 deletions test/model.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var config = require('./config');
var Database = require('../');
var config = require('./config.js');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
2 changes: 1 addition & 1 deletion test/plugins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Database = require('../');
var Database = require('../index.js');
var Model = Database.Model;
var Instance = Database.Instance;
var should = require('should');
Expand Down
2 changes: 1 addition & 1 deletion test/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var should = require('should');
describe('utils', function () {

describe('validation', function () {
var validation = require('../lib/utils/validation');
var validation = require('../lib/utils/validation.js');
function validate(schema, value, pass, message, extra) {
var result = validation(schema, value, '', extra);
result.should.have.ownProperty('passed', pass, message);
Expand Down

0 comments on commit 34dd019

Please sign in to comment.