-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
76 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "presets": ["es2015"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ docs/man | |
npm-debug.log | ||
.idea | ||
.coveralls.yml | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
'use strict'; | ||
|
||
var Schema = exports.Schema = require('./lib/schema').Schema; | ||
exports.AbstractClass = require('./lib/model.js'); | ||
const { Schema } = require('./lib/schema'); | ||
const AbstractClass = require('./lib/model.js'); | ||
|
||
var baseSQL = './lib/sql'; | ||
module.exports = { | ||
|
||
exports.__defineGetter__('BaseSQL', function () { | ||
return require(baseSQL); | ||
}); | ||
Schema, | ||
|
||
exports.loadSchema = function(filename, settings, compound) { | ||
return require('./legacy-compound-schema-loader')(filename, settings, compound); | ||
}; | ||
AbstractClass, | ||
|
||
exports.init = function (compound) { | ||
return require('./legacy-compound-init')(compound); | ||
}; | ||
// deprecated api | ||
loadSchema: function(filename, settings, compound) { | ||
return require('./legacy-compound-schema-loader')(Schema, filename, settings, compound); | ||
}, | ||
|
||
init: function init(compound) { | ||
return require('./legacy-compound-init')(compound, Schema, AbstractClass); | ||
}, | ||
|
||
get BaseSQL() { | ||
return require('./lib/sql'); | ||
}, | ||
|
||
exports.__defineGetter__('version', function () { | ||
return JSON.parse(fs.readFileSync(__dirname + '/package.json')).version; | ||
}); | ||
get version() { | ||
return require( | ||
process.versions.node >= '6' | ||
? './package.json' | ||
: '../package.json' | ||
).version; | ||
}, | ||
|
||
get test() { | ||
return require('./test/common_test'); | ||
} | ||
|
||
}; | ||
|
||
var commonTest = './test/common_test'; | ||
exports.__defineGetter__('test', function () { | ||
return require(commonTest); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var isNodeSix = process.versions.node >= '6'; | ||
|
||
if (!isNodeSix) { | ||
global.Promise = require('when').Promise; | ||
} | ||
|
||
module.exports = isNodeSix | ||
? require('./index') | ||
: require('./build/index'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters