不要怂,就是干,撸起袖子干!

Commit 00f371c7 by Felix Becker Committed by Sushant

ES6 import v3 (#7049)

* Support ES6 imports

* Remove semicolon
1 parent 082dcaba
...@@ -24,3 +24,5 @@ Association.prototype.inspect = function() { ...@@ -24,3 +24,5 @@ Association.prototype.inspect = function() {
}; };
module.exports = Association; module.exports = Association;
module.exports.Association = Association;
module.exports.default = Association;
...@@ -784,3 +784,5 @@ BelongsToMany.prototype.injectCreator = function(obj) { ...@@ -784,3 +784,5 @@ BelongsToMany.prototype.injectCreator = function(obj) {
}; };
module.exports = BelongsToMany; module.exports = BelongsToMany;
module.exports.BelongsToMany = BelongsToMany;
module.exports.default = BelongsToMany;
...@@ -257,3 +257,5 @@ BelongsTo.prototype.injectCreator = function(instancePrototype) { ...@@ -257,3 +257,5 @@ BelongsTo.prototype.injectCreator = function(instancePrototype) {
}; };
module.exports = BelongsTo; module.exports = BelongsTo;
module.exports.BelongsTo = BelongsTo;
module.exports.default = BelongsTo;
...@@ -535,3 +535,5 @@ HasMany.prototype.create = function(sourceInstance, values, options) { ...@@ -535,3 +535,5 @@ HasMany.prototype.create = function(sourceInstance, values, options) {
}; };
module.exports = HasMany; module.exports = HasMany;
module.exports.HasMany = HasMany;
module.exports.default = HasMany;
...@@ -272,3 +272,5 @@ HasOne.prototype.injectCreator = function(instancePrototype) { ...@@ -272,3 +272,5 @@ HasOne.prototype.injectCreator = function(instancePrototype) {
}; };
module.exports = HasOne; module.exports = HasOne;
module.exports.HasOne = HasOne;
module.exports.default = HasOne;
...@@ -15,7 +15,7 @@ var validator = require('./utils/validator-extras').validator ...@@ -15,7 +15,7 @@ var validator = require('./utils/validator-extras').validator
* @param {Object} options A dict with options. * @param {Object} options A dict with options.
* @constructor * @constructor
*/ */
var InstanceValidator = module.exports = function(modelInstance, options) { function InstanceValidator(modelInstance, options) {
options = _.clone(options) || {}; options = _.clone(options) || {};
if (options.fields && !options.skip) { if (options.fields && !options.skip) {
...@@ -47,7 +47,7 @@ var InstanceValidator = module.exports = function(modelInstance, options) { ...@@ -47,7 +47,7 @@ var InstanceValidator = module.exports = function(modelInstance, options) {
this.inProgress = false; this.inProgress = false;
extendModelValidations(modelInstance); extendModelValidations(modelInstance);
}; }
/** @define {string} The error key for arguments as passed by custom validators */ /** @define {string} The error key for arguments as passed by custom validators */
InstanceValidator.RAW_KEY_NAME = '__raw'; InstanceValidator.RAW_KEY_NAME = '__raw';
...@@ -354,3 +354,7 @@ InstanceValidator.prototype._pushError = function(isBuiltin, errorKey, rawError) ...@@ -354,3 +354,7 @@ InstanceValidator.prototype._pushError = function(isBuiltin, errorKey, rawError)
this.errors.push(error); this.errors.push(error);
}; };
module.exports = InstanceValidator;
module.exports.InstanceValidator = InstanceValidator;
module.exports.default = InstanceValidator;
...@@ -1082,3 +1082,5 @@ Instance.prototype.toJSON = function() { ...@@ -1082,3 +1082,5 @@ Instance.prototype.toJSON = function() {
}; };
module.exports = Instance; module.exports = Instance;
module.exports.Instance = Instance;
module.exports.default = Instance;
...@@ -99,3 +99,5 @@ ModelManager.prototype.forEachModel = function(iterator, options) { ...@@ -99,3 +99,5 @@ ModelManager.prototype.forEachModel = function(iterator, options) {
}; };
module.exports = ModelManager; module.exports = ModelManager;
module.exports.ModelManager = ModelManager;
module.exports.default = ModelManager;
...@@ -2702,3 +2702,5 @@ Utils._.extend(Model.prototype, associationsMixin); ...@@ -2702,3 +2702,5 @@ Utils._.extend(Model.prototype, associationsMixin);
Hooks.applyTo(Model); Hooks.applyTo(Model);
module.exports = Model; module.exports = Model;
module.exports.Model = Model;
module.exports.default = Model;
...@@ -6,3 +6,5 @@ var Attribute = function(options) { ...@@ -6,3 +6,5 @@ var Attribute = function(options) {
}; };
module.exports = Attribute; module.exports = Attribute;
module.exports.Attribute = Attribute;
module.exports.default = Attribute;
...@@ -1405,3 +1405,5 @@ Sequelize.prototype.normalizeAttribute = function(attribute) { ...@@ -1405,3 +1405,5 @@ Sequelize.prototype.normalizeAttribute = function(attribute) {
// Allows the promise to access cls namespaces // Allows the promise to access cls namespaces
module.exports = Promise.Sequelize = Sequelize; module.exports = Promise.Sequelize = Sequelize;
module.exports.Sequelize = Sequelize;
module.exports.default = Sequelize;
...@@ -16,7 +16,7 @@ var Utils = require('./utils'); ...@@ -16,7 +16,7 @@ var Utils = require('./utils');
* @param {String} options.isolationLevel=true Sets the isolation level of the transaction. * @param {String} options.isolationLevel=true Sets the isolation level of the transaction.
* @param {String} options.deferrable Sets the constraints to be deferred or immediately checked. * @param {String} options.deferrable Sets the constraints to be deferred or immediately checked.
*/ */
var Transaction = module.exports = function(sequelize, options) { function Transaction(sequelize, options) {
this.sequelize = sequelize; this.sequelize = sequelize;
this.savepoints = []; this.savepoints = [];
var generateTransactionId = this.sequelize.dialect.QueryGenerator.generateTransactionId; var generateTransactionId = this.sequelize.dialect.QueryGenerator.generateTransactionId;
...@@ -39,7 +39,7 @@ var Transaction = module.exports = function(sequelize, options) { ...@@ -39,7 +39,7 @@ var Transaction = module.exports = function(sequelize, options) {
} }
delete this.options.transaction; delete this.options.transaction;
}; }
/** /**
* Types can be set per-transaction by passing `options.type` to `sequelize.transaction`. * Types can be set per-transaction by passing `options.type` to `sequelize.transaction`.
...@@ -292,3 +292,7 @@ Transaction.prototype.$clearCls = function () { ...@@ -292,3 +292,7 @@ Transaction.prototype.$clearCls = function () {
} }
} }
}; };
module.exports = Transaction;
module.exports.Transaction = Transaction;
module.exports.default = Transaction;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!