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

Commit 33ff3ad5 by Ruben Bridgewater

Remove unnecessary indentation

1 parent 073f1777
var Association = function() { var Association = function () {};
};
module.exports = Association; module.exports = Association;
\ No newline at end of file
...@@ -7,8 +7,7 @@ var Utils = require('./../utils') ...@@ -7,8 +7,7 @@ var Utils = require('./../utils')
, CounterCache = require('../plugins/counter-cache') , CounterCache = require('../plugins/counter-cache')
, util = require('util'); , util = require('util');
module.exports = (function() { var BelongsToMany = function(source, target, options) {
var BelongsToMany = function(source, target, options) {
Association.call(this); Association.call(this);
this.associationType = 'BelongsToMany'; this.associationType = 'BelongsToMany';
...@@ -176,13 +175,13 @@ module.exports = (function() { ...@@ -176,13 +175,13 @@ module.exports = (function() {
if (this.options.counterCache) { if (this.options.counterCache) {
new CounterCache(this, this.options.counterCache !== true ? this.options.counterCache : {}); new CounterCache(this, this.options.counterCache !== true ? this.options.counterCache : {});
} }
}; };
util.inherits(BelongsToMany, Association); util.inherits(BelongsToMany, Association);
// the id is in the target table // the id is in the target table
// or in an extra table which connects two tables // or in an extra table which connects two tables
BelongsToMany.prototype.injectAttributes = function() { BelongsToMany.prototype.injectAttributes = function() {
var self = this; var self = this;
this.identifier = this.foreignKey; this.identifier = this.foreignKey;
...@@ -263,9 +262,9 @@ module.exports = (function() { ...@@ -263,9 +262,9 @@ module.exports = (function() {
Helpers.checkNamingCollision(this); Helpers.checkNamingCollision(this);
return this; return this;
}; };
BelongsToMany.prototype.injectGetter = function(obj) { BelongsToMany.prototype.injectGetter = function(obj) {
var association = this; var association = this;
obj[this.accessors.get] = function(options) { obj[this.accessors.get] = function(options) {
...@@ -364,9 +363,9 @@ module.exports = (function() { ...@@ -364,9 +363,9 @@ module.exports = (function() {
}; };
return this; return this;
}; };
BelongsToMany.prototype.injectSetter = function(obj) { BelongsToMany.prototype.injectSetter = function(obj) {
var association = this var association = this
, primaryKeyAttribute = association.target.primaryKeyAttribute; , primaryKeyAttribute = association.target.primaryKeyAttribute;
...@@ -668,9 +667,9 @@ module.exports = (function() { ...@@ -668,9 +667,9 @@ module.exports = (function() {
}; };
return this; return this;
}; };
BelongsToMany.prototype.injectCreator = function(obj) { BelongsToMany.prototype.injectCreator = function(obj) {
var association = this; var association = this;
obj[this.accessors.create] = function(values, options) { obj[this.accessors.create] = function(values, options) {
...@@ -701,7 +700,6 @@ module.exports = (function() { ...@@ -701,7 +700,6 @@ module.exports = (function() {
}; };
return this; return this;
}; };
return BelongsToMany; module.exports = BelongsToMany;
})();
...@@ -6,8 +6,7 @@ var Utils = require('./../utils') ...@@ -6,8 +6,7 @@ var Utils = require('./../utils')
, Association = require('./base') , Association = require('./base')
, util = require('util'); , util = require('util');
module.exports = (function() { var BelongsTo = function(source, target, options) {
var BelongsTo = function(source, target, options) {
Association.call(this); Association.call(this);
this.associationType = 'BelongsTo'; this.associationType = 'BelongsTo';
...@@ -67,12 +66,12 @@ module.exports = (function() { ...@@ -67,12 +66,12 @@ module.exports = (function() {
set: 'set' + singular, set: 'set' + singular,
create: 'create' + singular create: 'create' + singular
}; };
}; };
util.inherits(BelongsTo, Association); util.inherits(BelongsTo, Association);
// the id is in the source table // the id is in the source table
BelongsTo.prototype.injectAttributes = function() { BelongsTo.prototype.injectAttributes = function() {
var newAttributes = {}; var newAttributes = {};
newAttributes[this.identifier] = Utils._.defaults(this.foreignKeyAttribute, { type: this.options.keyType || this.target.rawAttributes[this.targetIdentifier].type }); newAttributes[this.identifier] = Utils._.defaults(this.foreignKeyAttribute, { type: this.options.keyType || this.target.rawAttributes[this.targetIdentifier].type });
...@@ -90,10 +89,10 @@ module.exports = (function() { ...@@ -90,10 +89,10 @@ module.exports = (function() {
Helpers.checkNamingCollision(this); Helpers.checkNamingCollision(this);
return this; return this;
}; };
// Add getAssociation method to the prototype of the model instance // Add getAssociation method to the prototype of the model instance
BelongsTo.prototype.injectGetter = function(instancePrototype) { BelongsTo.prototype.injectGetter = function(instancePrototype) {
var association = this; var association = this;
instancePrototype[this.accessors.get] = function(options) { instancePrototype[this.accessors.get] = function(options) {
...@@ -124,10 +123,10 @@ module.exports = (function() { ...@@ -124,10 +123,10 @@ module.exports = (function() {
}; };
return this; return this;
}; };
// Add setAssociaton method to the prototype of the model instance // Add setAssociaton method to the prototype of the model instance
BelongsTo.prototype.injectSetter = function(instancePrototype) { BelongsTo.prototype.injectSetter = function(instancePrototype) {
var association = this; var association = this;
instancePrototype[this.accessors.set] = function(associatedInstance, options) { instancePrototype[this.accessors.set] = function(associatedInstance, options) {
...@@ -154,10 +153,10 @@ module.exports = (function() { ...@@ -154,10 +153,10 @@ module.exports = (function() {
}; };
return this; return this;
}; };
// Add createAssociation method to the prototype of the model instance // Add createAssociation method to the prototype of the model instance
BelongsTo.prototype.injectCreator = function(instancePrototype) { BelongsTo.prototype.injectCreator = function(instancePrototype) {
var association = this; var association = this;
instancePrototype[this.accessors.create] = function(values, fieldsOrOptions) { instancePrototype[this.accessors.create] = function(values, fieldsOrOptions) {
...@@ -175,7 +174,6 @@ module.exports = (function() { ...@@ -175,7 +174,6 @@ module.exports = (function() {
}; };
return this; return this;
}; };
return BelongsTo; module.exports = BelongsTo;
})();
...@@ -3,15 +3,14 @@ ...@@ -3,15 +3,14 @@
var Utils = require('./../utils') var Utils = require('./../utils')
, _ = require('lodash'); , _ = require('lodash');
module.exports = (function() { var HasManySingleLinked = function(association, instance) {
var HasManySingleLinked = function(association, instance) {
this.association = association; this.association = association;
this.instance = instance; this.instance = instance;
this.target = this.association.target; this.target = this.association.target;
this.source = this.association.source; this.source = this.association.source;
}; };
HasManySingleLinked.prototype.injectGetter = function(options) { HasManySingleLinked.prototype.injectGetter = function(options) {
var scopeWhere = this.association.scope ? {} : null; var scopeWhere = this.association.scope ? {} : null;
if (this.association.scope) { if (this.association.scope) {
Object.keys(this.association.scope).forEach(function (attribute) { Object.keys(this.association.scope).forEach(function (attribute) {
...@@ -40,9 +39,9 @@ module.exports = (function() { ...@@ -40,9 +39,9 @@ module.exports = (function() {
} }
return model.all(options); return model.all(options);
}; };
HasManySingleLinked.prototype.injectSetter = function(oldAssociations, newAssociations, defaultAttributes) { HasManySingleLinked.prototype.injectSetter = function(oldAssociations, newAssociations, defaultAttributes) {
var self = this var self = this
, primaryKeys , primaryKeys
, primaryKey , primaryKey
...@@ -120,9 +119,9 @@ module.exports = (function() { ...@@ -120,9 +119,9 @@ module.exports = (function() {
} }
return Utils.Promise.all(promises); return Utils.Promise.all(promises);
}; };
HasManySingleLinked.prototype.injectAdder = function(newAssociation, options) { HasManySingleLinked.prototype.injectAdder = function(newAssociation, options) {
newAssociation.set(this.association.identifier, this.instance.get(this.instance.Model.primaryKeyAttribute)); newAssociation.set(this.association.identifier, this.instance.get(this.instance.Model.primaryKeyAttribute));
if (this.association.scope) { if (this.association.scope) {
Object.keys(this.association.scope).forEach(function (attribute) { Object.keys(this.association.scope).forEach(function (attribute) {
...@@ -131,7 +130,6 @@ module.exports = (function() { ...@@ -131,7 +130,6 @@ module.exports = (function() {
} }
return newAssociation.save(options); return newAssociation.save(options);
}; };
return HasManySingleLinked; module.exports = HasManySingleLinked;
})();
...@@ -8,8 +8,7 @@ var Utils = require('./../utils') ...@@ -8,8 +8,7 @@ var Utils = require('./../utils')
, util = require('util') , util = require('util')
, HasManySingleLinked = require('./has-many-single-linked'); , HasManySingleLinked = require('./has-many-single-linked');
module.exports = (function() { var HasMany = function(source, target, options) {
var HasMany = function(source, target, options) {
Association.call(this); Association.call(this);
this.associationType = 'HasMany'; this.associationType = 'HasMany';
...@@ -81,13 +80,13 @@ module.exports = (function() { ...@@ -81,13 +80,13 @@ module.exports = (function() {
if (this.options.counterCache) { if (this.options.counterCache) {
new CounterCache(this, this.options.counterCache !== true ? this.options.counterCache : {}); new CounterCache(this, this.options.counterCache !== true ? this.options.counterCache : {});
} }
}; };
util.inherits(HasMany, Association); util.inherits(HasMany, Association);
// the id is in the target table // the id is in the target table
// or in an extra table which connects two tables // or in an extra table which connects two tables
HasMany.prototype.injectAttributes = function() { HasMany.prototype.injectAttributes = function() {
this.identifier = this.foreignKey || Utils._.camelizeIf( this.identifier = this.foreignKey || Utils._.camelizeIf(
[ [
Utils._.underscoredIf(this.source.options.name.singular, this.source.options.underscored), Utils._.underscoredIf(this.source.options.name.singular, this.source.options.underscored),
...@@ -115,9 +114,9 @@ module.exports = (function() { ...@@ -115,9 +114,9 @@ module.exports = (function() {
Helpers.checkNamingCollision(this); Helpers.checkNamingCollision(this);
return this; return this;
}; };
HasMany.prototype.injectGetter = function(obj) { HasMany.prototype.injectGetter = function(obj) {
var association = this; var association = this;
obj[this.accessors.get] = function(options) { obj[this.accessors.get] = function(options) {
...@@ -188,9 +187,9 @@ module.exports = (function() { ...@@ -188,9 +187,9 @@ module.exports = (function() {
}; };
return this; return this;
}; };
HasMany.prototype.injectSetter = function(obj) { HasMany.prototype.injectSetter = function(obj) {
var association = this var association = this
, primaryKeyAttribute = association.target.primaryKeyAttribute; , primaryKeyAttribute = association.target.primaryKeyAttribute;
...@@ -340,9 +339,9 @@ module.exports = (function() { ...@@ -340,9 +339,9 @@ module.exports = (function() {
}; };
return this; return this;
}; };
HasMany.prototype.injectCreator = function(obj) { HasMany.prototype.injectCreator = function(obj) {
var association = this; var association = this;
obj[this.accessors.create] = function(values, options) { obj[this.accessors.create] = function(values, options) {
...@@ -372,7 +371,6 @@ module.exports = (function() { ...@@ -372,7 +371,6 @@ module.exports = (function() {
}; };
return this; return this;
}; };
return HasMany; module.exports = HasMany;
})();
...@@ -5,8 +5,7 @@ var Utils = require('./../utils') ...@@ -5,8 +5,7 @@ var Utils = require('./../utils')
, Association = require('./base') , Association = require('./base')
, util = require('util'); , util = require('util');
module.exports = (function() { var HasOne = function(srcModel, targetModel, options) {
var HasOne = function(srcModel, targetModel, options) {
Association.call(this); Association.call(this);
this.associationType = 'HasOne'; this.associationType = 'HasOne';
...@@ -65,12 +64,12 @@ module.exports = (function() { ...@@ -65,12 +64,12 @@ module.exports = (function() {
set: 'set' + singular, set: 'set' + singular,
create: 'create' + singular create: 'create' + singular
}; };
}; };
util.inherits(HasOne, Association); util.inherits(HasOne, Association);
// the id is in the target table // the id is in the target table
HasOne.prototype.injectAttributes = function() { HasOne.prototype.injectAttributes = function() {
var newAttributes = {} var newAttributes = {}
, keyType = this.source.rawAttributes[this.sourceIdentifier].type; , keyType = this.source.rawAttributes[this.sourceIdentifier].type;
...@@ -91,9 +90,9 @@ module.exports = (function() { ...@@ -91,9 +90,9 @@ module.exports = (function() {
Helpers.checkNamingCollision(this); Helpers.checkNamingCollision(this);
return this; return this;
}; };
HasOne.prototype.injectGetter = function(instancePrototype) { HasOne.prototype.injectGetter = function(instancePrototype) {
var association = this; var association = this;
instancePrototype[this.accessors.get] = function(options) { instancePrototype[this.accessors.get] = function(options) {
...@@ -124,9 +123,9 @@ module.exports = (function() { ...@@ -124,9 +123,9 @@ module.exports = (function() {
}; };
return this; return this;
}; };
HasOne.prototype.injectSetter = function(instancePrototype) { HasOne.prototype.injectSetter = function(instancePrototype) {
var association = this; var association = this;
instancePrototype[this.accessors.set] = function(associatedInstance, options) { instancePrototype[this.accessors.set] = function(associatedInstance, options) {
...@@ -160,9 +159,9 @@ module.exports = (function() { ...@@ -160,9 +159,9 @@ module.exports = (function() {
}; };
return this; return this;
}; };
HasOne.prototype.injectCreator = function(instancePrototype) { HasOne.prototype.injectCreator = function(instancePrototype) {
var association = this; var association = this;
instancePrototype[this.accessors.create] = function(values, options) { instancePrototype[this.accessors.create] = function(values, options) {
...@@ -176,7 +175,6 @@ module.exports = (function() { ...@@ -176,7 +175,6 @@ module.exports = (function() {
}; };
return this; return this;
}; };
return HasOne; module.exports = HasOne;
})();
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
var Utils = require('./../utils'); var Utils = require('./../utils');
module.exports = { function checkNamingCollision (association) {
checkNamingCollision: function (association) {
if (association.source.rawAttributes.hasOwnProperty(association.as)) { if (association.source.rawAttributes.hasOwnProperty(association.as)) {
throw new Error( throw new Error(
'Naming collision between attribute \'' + association.as + 'Naming collision between attribute \'' + association.as +
...@@ -11,9 +10,9 @@ module.exports = { ...@@ -11,9 +10,9 @@ module.exports = {
'. To remedy this, change either foreignKey or as in your association definition' '. To remedy this, change either foreignKey or as in your association definition'
); );
} }
}, }
addForeignKeyConstraints: function(newAttribute, source, target, options) { function addForeignKeyConstraints (newAttribute, source, target, options) {
// FK constraints are opt-in: users must either set `foreignKeyConstraints` // FK constraints are opt-in: users must either set `foreignKeyConstraints`
// on the association, or request an `onDelete` or `onUpdate` behaviour // on the association, or request an `onDelete` or `onUpdate` behaviour
...@@ -44,6 +43,9 @@ module.exports = { ...@@ -44,6 +43,9 @@ module.exports = {
newAttribute.onUpdate = options.onUpdate; newAttribute.onUpdate = options.onUpdate;
} }
} }
} }
module.exports = {
checkNamingCollision: checkNamingCollision,
addForeignKeyConstraints: addForeignKeyConstraints
}; };
...@@ -9,8 +9,12 @@ var Utils = require('../../utils') ...@@ -9,8 +9,12 @@ var Utils = require('../../utils')
, Dottie = require('dottie') , Dottie = require('dottie')
, uuid = require('node-uuid'); , uuid = require('node-uuid');
module.exports = (function() { /* istanbul ignore next */
var QueryGenerator = { var throwMethodUndefined = function(methodName) {
throw new Error('The method "' + methodName + '" is not defined! Please add it to your sql dialect.');
};
var QueryGenerator = {
options: {}, options: {},
addSchema: function(param) { addSchema: function(param) {
...@@ -2061,12 +2065,6 @@ module.exports = (function() { ...@@ -2061,12 +2065,6 @@ module.exports = (function() {
booleanValue: function(value) { booleanValue: function(value) {
return value; return value;
} }
}; };
/* istanbul ignore next */
var throwMethodUndefined = function(methodName) {
throw new Error('The method "' + methodName + '" is not defined! Please add it to your sql dialect.');
};
return QueryGenerator; module.exports = QueryGenerator;
})();
...@@ -6,8 +6,12 @@ var Utils = require('../../utils') ...@@ -6,8 +6,12 @@ var Utils = require('../../utils')
, Model = require('../../model') , Model = require('../../model')
, AbstractQueryGenerator = require('../abstract/query-generator'); , AbstractQueryGenerator = require('../abstract/query-generator');
module.exports = (function() { /* istanbul ignore next */
var QueryGenerator = { var throwMethodUndefined = function(methodName) {
throw new Error('The method "' + methodName + '" is not defined! Please add it to your sql dialect.');
};
var QueryGenerator = {
options: {}, options: {},
dialect: 'mssql', dialect: 'mssql',
...@@ -595,17 +599,11 @@ module.exports = (function() { ...@@ -595,17 +599,11 @@ module.exports = (function() {
booleanValue: function(value) { booleanValue: function(value) {
return !!value ? 1 : 0; return !!value ? 1 : 0;
} }
}; };
// private methods // private methods
function wrapSingleQuote(identifier){ function wrapSingleQuote(identifier){
return Utils.addTicks(identifier, "'"); return Utils.addTicks(identifier, "'");
} }
/* istanbul ignore next */
var throwMethodUndefined = function(methodName) {
throw new Error('The method "' + methodName + '" is not defined! Please add it to your sql dialect.');
};
return Utils._.extend(Utils._.clone(AbstractQueryGenerator), QueryGenerator); module.exports = Utils._.extend(Utils._.clone(AbstractQueryGenerator), QueryGenerator);
})();
...@@ -4,8 +4,7 @@ var Utils = require('../../utils') ...@@ -4,8 +4,7 @@ var Utils = require('../../utils')
, AbstractQuery = require('../abstract/query') , AbstractQuery = require('../abstract/query')
, sequelizeErrors = require('../../errors.js'); , sequelizeErrors = require('../../errors.js');
module.exports = (function() { var Query = function(connection, sequelize, options) {
var Query = function(connection, sequelize, options) {
this.connection = connection; this.connection = connection;
this.instance = options.instance; this.instance = options.instance;
this.model = options.model; this.model = options.model;
...@@ -17,15 +16,15 @@ module.exports = (function() { ...@@ -17,15 +16,15 @@ module.exports = (function() {
}, options || {}); }, options || {});
this.checkLoggingOption(); this.checkLoggingOption();
}; };
Utils.inherit(Query, AbstractQuery); Utils.inherit(Query, AbstractQuery);
Query.prototype.getInsertIdField = function() { Query.prototype.getInsertIdField = function() {
return 'id'; return 'id';
}; };
Query.prototype.run = function(sql) { Query.prototype.run = function(sql) {
var self = this; var self = this;
this.sql = sql; this.sql = sql;
...@@ -84,9 +83,9 @@ module.exports = (function() { ...@@ -84,9 +83,9 @@ module.exports = (function() {
}); });
return promise; return promise;
}; };
/** /**
* High level function that handles the results of a query execution. * High level function that handles the results of a query execution.
* *
* *
...@@ -102,7 +101,7 @@ module.exports = (function() { ...@@ -102,7 +101,7 @@ module.exports = (function() {
* *
* @param {Array} data - The result of the query execution. * @param {Array} data - The result of the query execution.
*/ */
Query.prototype.formatResults = function(data) { Query.prototype.formatResults = function(data) {
var result = this.instance; var result = this.instance;
if (this.isInsertQuery(data)) { if (this.isInsertQuery(data)) {
this.handleInsertQuery(data); this.handleInsertQuery(data);
...@@ -155,18 +154,18 @@ module.exports = (function() { ...@@ -155,18 +154,18 @@ module.exports = (function() {
} }
return result; return result;
}; };
Query.prototype.handleShowTablesQuery = function(results) { Query.prototype.handleShowTablesQuery = function(results) {
return results.map(function(resultSet) { return results.map(function(resultSet) {
return { return {
tableName: resultSet.TABLE_NAME, tableName: resultSet.TABLE_NAME,
schema: resultSet.TABLE_SCHEMA schema: resultSet.TABLE_SCHEMA
}; };
}); });
}; };
Query.prototype.formatError = function (err) { Query.prototype.formatError = function (err) {
var match; var match;
match = err.message.match(/Violation of UNIQUE KEY constraint '((.|\s)*)'. Cannot insert duplicate key in object '.*'. The duplicate key value is \((.*)\)./); match = err.message.match(/Violation of UNIQUE KEY constraint '((.|\s)*)'. Cannot insert duplicate key in object '.*'. The duplicate key value is \((.*)\)./);
match = match || err.message.match(/Cannot insert duplicate key row in object .* with unique index '(.*)'/); match = match || err.message.match(/Cannot insert duplicate key row in object .* with unique index '(.*)'/);
...@@ -210,9 +209,9 @@ module.exports = (function() { ...@@ -210,9 +209,9 @@ module.exports = (function() {
} }
return new sequelizeErrors.DatabaseError(err); return new sequelizeErrors.DatabaseError(err);
}; };
Query.prototype.isShowOrDescribeQuery = function() { Query.prototype.isShowOrDescribeQuery = function() {
var result = false; var result = false;
result = result || (this.sql.toLowerCase().indexOf("select c.column_name as 'name', c.data_type as 'type', c.is_nullable as 'isnull'") === 0); /* jshint ignore: line */ result = result || (this.sql.toLowerCase().indexOf("select c.column_name as 'name', c.data_type as 'type', c.is_nullable as 'isnull'") === 0); /* jshint ignore: line */
...@@ -220,13 +219,13 @@ module.exports = (function() { ...@@ -220,13 +219,13 @@ module.exports = (function() {
result = result || (this.sql.toLowerCase().indexOf('exec sys.sp_helpindex @objname') === 0); result = result || (this.sql.toLowerCase().indexOf('exec sys.sp_helpindex @objname') === 0);
return result; return result;
}; };
Query.prototype.isShowIndexesQuery = function () { Query.prototype.isShowIndexesQuery = function () {
return this.sql.toLowerCase().indexOf('exec sys.sp_helpindex @objname') === 0; return this.sql.toLowerCase().indexOf('exec sys.sp_helpindex @objname') === 0;
}; };
Query.prototype.handleShowIndexesQuery = function (data) { Query.prototype.handleShowIndexesQuery = function (data) {
// Group by index name, and collect all fields // Group by index name, and collect all fields
data = Utils._.foldl(data, function (acc, item) { data = Utils._.foldl(data, function (acc, item) {
if (!(item.index_name in acc)) { if (!(item.index_name in acc)) {
...@@ -261,9 +260,9 @@ module.exports = (function() { ...@@ -261,9 +260,9 @@ module.exports = (function() {
type: undefined, type: undefined,
}; };
}); });
}; };
Query.prototype.handleInsertQuery = function(results, metaData) { Query.prototype.handleInsertQuery = function(results, metaData) {
if (this.instance) { if (this.instance) {
// add the inserted row id to the instance // add the inserted row id to the instance
var autoIncrementField = this.model.autoIncrementField var autoIncrementField = this.model.autoIncrementField
...@@ -281,7 +280,6 @@ module.exports = (function() { ...@@ -281,7 +280,6 @@ module.exports = (function() {
this.instance[autoIncrementField] = id; this.instance[autoIncrementField] = id;
} }
}; };
return Query; module.exports = Query;
})();
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
var Utils = require('../../utils') var Utils = require('../../utils')
, DataTypes = require('../../data-types'); , DataTypes = require('../../data-types');
module.exports = (function() { var QueryGenerator = {
var QueryGenerator = {
dialect: 'mysql', dialect: 'mysql',
createSchema: function() { createSchema: function() {
...@@ -372,7 +371,6 @@ module.exports = (function() { ...@@ -372,7 +371,6 @@ module.exports = (function() {
dropForeignKeyQuery: function(tableName, foreignKey) { dropForeignKeyQuery: function(tableName, foreignKey) {
return 'ALTER TABLE ' + this.quoteTable(tableName) + ' DROP FOREIGN KEY ' + this.quoteIdentifier(foreignKey) + ';'; return 'ALTER TABLE ' + this.quoteTable(tableName) + ' DROP FOREIGN KEY ' + this.quoteIdentifier(foreignKey) + ';';
} }
}; };
return Utils._.extend(Utils._.clone(require('../abstract/query-generator')), QueryGenerator); module.exports = Utils._.extend(Utils._.clone(require('../abstract/query-generator')), QueryGenerator);
})();
...@@ -5,8 +5,7 @@ var Utils = require('../../utils') ...@@ -5,8 +5,7 @@ var Utils = require('../../utils')
, uuid = require('node-uuid') , uuid = require('node-uuid')
, sequelizeErrors = require('../../errors.js'); , sequelizeErrors = require('../../errors.js');
module.exports = (function() { var Query = function(connection, sequelize, options) {
var Query = function(connection, sequelize, options) {
this.connection = connection; this.connection = connection;
this.instance = options.instance; this.instance = options.instance;
this.model = options.model; this.model = options.model;
...@@ -19,10 +18,10 @@ module.exports = (function() { ...@@ -19,10 +18,10 @@ module.exports = (function() {
}, options || {}); }, options || {});
this.checkLoggingOption(); this.checkLoggingOption();
}; };
Utils.inherit(Query, AbstractQuery); Utils.inherit(Query, AbstractQuery);
Query.prototype.run = function(sql) { Query.prototype.run = function(sql) {
var self = this; var self = this;
this.sql = sql; this.sql = sql;
...@@ -41,7 +40,7 @@ module.exports = (function() { ...@@ -41,7 +40,7 @@ module.exports = (function() {
}); });
return promise; return promise;
}; };
/** /**
* High level function that handles the results of a query execution. * High level function that handles the results of a query execution.
...@@ -59,7 +58,7 @@ module.exports = (function() { ...@@ -59,7 +58,7 @@ module.exports = (function() {
* *
* @param {Array} data - The result of the query execution. * @param {Array} data - The result of the query execution.
*/ */
Query.prototype.formatResults = function(data) { Query.prototype.formatResults = function(data) {
var result = this.instance; var result = this.instance;
if (this.isInsertQuery(data)) { if (this.isInsertQuery(data)) {
...@@ -101,10 +100,10 @@ module.exports = (function() { ...@@ -101,10 +100,10 @@ module.exports = (function() {
} }
return result; return result;
}; };
Query.prototype.formatError = function (err) { Query.prototype.formatError = function (err) {
var match; var match;
switch (err.errno || err.code) { switch (err.errno || err.code) {
...@@ -157,9 +156,9 @@ module.exports = (function() { ...@@ -157,9 +156,9 @@ module.exports = (function() {
default: default:
return new sequelizeErrors.DatabaseError(err); return new sequelizeErrors.DatabaseError(err);
} }
}; };
Query.prototype.handleShowIndexesQuery = function (data) { Query.prototype.handleShowIndexesQuery = function (data) {
// Group by index name, and collect all fields // Group by index name, and collect all fields
data = Utils._.foldl(data, function (acc, item) { data = Utils._.foldl(data, function (acc, item) {
if (!(item.Key_name in acc)) { if (!(item.Key_name in acc)) {
...@@ -187,7 +186,6 @@ module.exports = (function() { ...@@ -187,7 +186,6 @@ module.exports = (function() {
type: item.Index_type, type: item.Index_type,
}; };
}); });
}; };
return Query; module.exports = Query;
})();
...@@ -2,15 +2,17 @@ ...@@ -2,15 +2,17 @@
var hstore = require('pg-hstore')({sanitize : true}); var hstore = require('pg-hstore')({sanitize : true});
module.exports = { function stringify (data) {
stringify: function(data) { if (data === null) return null;
if(data === null) return null;
return hstore.stringify(data); return hstore.stringify(data);
}, }
parse: function(value) {
if(value === null) return null;
function parse (value) {
if (value === null) return null;
return hstore.parse(value); return hstore.parse(value);
} }
module.exports = {
stringify: stringify,
parse: parse
}; };
...@@ -10,8 +10,7 @@ var Utils = require('../../utils') ...@@ -10,8 +10,7 @@ var Utils = require('../../utils')
, AbstractQueryGenerator = require('../abstract/query-generator') , AbstractQueryGenerator = require('../abstract/query-generator')
, primaryKeys = {}; , primaryKeys = {};
module.exports = (function() { var QueryGenerator = {
var QueryGenerator = {
options: {}, options: {},
dialect: 'postgres', dialect: 'postgres',
...@@ -938,7 +937,6 @@ module.exports = (function() { ...@@ -938,7 +937,6 @@ module.exports = (function() {
return AbstractQueryGenerator.setAutocommitQuery.call(this, value, options); return AbstractQueryGenerator.setAutocommitQuery.call(this, value, options);
} }
}; };
return Utils._.extend(Utils._.clone(AbstractQueryGenerator), QueryGenerator); module.exports = Utils._.extend(Utils._.clone(AbstractQueryGenerator), QueryGenerator);
})();
...@@ -66,8 +66,7 @@ function dialectSpecificFieldDatatypeMap (options, prefix) { ...@@ -66,8 +66,7 @@ function dialectSpecificFieldDatatypeMap (options, prefix) {
return fields; return fields;
} }
module.exports = (function() { var Query = function(client, sequelize, options) {
var Query = function(client, sequelize, options) {
this.client = client; this.client = client;
this.sequelize = sequelize; this.sequelize = sequelize;
this.instance = options.instance; this.instance = options.instance;
...@@ -79,12 +78,12 @@ module.exports = (function() { ...@@ -79,12 +78,12 @@ module.exports = (function() {
}, options || {}); }, options || {});
this.checkLoggingOption(); this.checkLoggingOption();
}; };
Utils.inherit(Query, AbstractQuery); Utils.inherit(Query, AbstractQuery);
Query.prototype.parseDialectSpecificFields = parseDialectSpecificFields; Query.prototype.parseDialectSpecificFields = parseDialectSpecificFields;
Query.prototype.run = function(sql) { Query.prototype.run = function(sql) {
this.sql = sql; this.sql = sql;
var self = this var self = this
...@@ -336,9 +335,9 @@ module.exports = (function() { ...@@ -336,9 +335,9 @@ module.exports = (function() {
}); });
return promise; return promise;
}; };
Query.prototype.formatError = function (err) { Query.prototype.formatError = function (err) {
var match var match
, table , table
, index , index
...@@ -420,15 +419,14 @@ module.exports = (function() { ...@@ -420,15 +419,14 @@ module.exports = (function() {
default: default:
return new sequelizeErrors.DatabaseError(err); return new sequelizeErrors.DatabaseError(err);
} }
}; };
Query.prototype.isForeignKeysQuery = function() { Query.prototype.isForeignKeysQuery = function() {
return /SELECT conname as constraint_name, pg_catalog\.pg_get_constraintdef\(r\.oid, true\) as condef FROM pg_catalog\.pg_constraint r WHERE r\.conrelid = \(SELECT oid FROM pg_class WHERE relname = '.*' LIMIT 1\) AND r\.contype = 'f' ORDER BY 1;/.test(this.sql); return /SELECT conname as constraint_name, pg_catalog\.pg_get_constraintdef\(r\.oid, true\) as condef FROM pg_catalog\.pg_constraint r WHERE r\.conrelid = \(SELECT oid FROM pg_class WHERE relname = '.*' LIMIT 1\) AND r\.contype = 'f' ORDER BY 1;/.test(this.sql);
}; };
Query.prototype.getInsertIdField = function() { Query.prototype.getInsertIdField = function() {
return 'id'; return 'id';
}; };
return Query; module.exports = Query;
})();
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
var Utils = require('../../utils'), var Utils = require('../../utils'),
moment = require('moment'); moment = require('moment');
module.exports = { function stringify (data) {
stringify: function (data) {
if (data === null) return null; if (data === null) return null;
if (!Utils._.isArray(data) || data.length !== 2) return ''; if (!Utils._.isArray(data) || data.length !== 2) return '';
...@@ -26,8 +25,9 @@ module.exports = { ...@@ -26,8 +25,9 @@ module.exports = {
}); });
return (data.inclusive[0] ? '[' : '(') + JSON.stringify(data[0]) + ',' + JSON.stringify(data[1]) + (data.inclusive[1] ? ']' : ')'); return (data.inclusive[0] ? '[' : '(') + JSON.stringify(data[0]) + ',' + JSON.stringify(data[1]) + (data.inclusive[1] ? ']' : ')');
}, }
parse: function (value, AttributeType) {
function parse (value, AttributeType) {
if (value === null) return null; if (value === null) return null;
if(typeof AttributeType === 'function') AttributeType = new AttributeType(); if(typeof AttributeType === 'function') AttributeType = new AttributeType();
...@@ -58,5 +58,9 @@ module.exports = { ...@@ -58,5 +58,9 @@ module.exports = {
result.inclusive = [(value[0] === '['), (value[value.length - 1] === ']')]; result.inclusive = [(value[0] === '['), (value[value.length - 1] === ']')];
return result; return result;
} }
module.exports = {
stringify: stringify,
parse: parse
}; };
...@@ -11,8 +11,7 @@ var MySqlQueryGenerator = Utils._.extend( ...@@ -11,8 +11,7 @@ var MySqlQueryGenerator = Utils._.extend(
Utils._.clone(require('../mysql/query-generator')) Utils._.clone(require('../mysql/query-generator'))
); );
module.exports = (function() { var QueryGenerator = {
var QueryGenerator = {
options: {}, options: {},
dialect: 'sqlite', dialect: 'sqlite',
...@@ -437,7 +436,6 @@ module.exports = (function() { ...@@ -437,7 +436,6 @@ module.exports = (function() {
var sql = 'PRAGMA foreign_key_list(<%= tableName %>)'; var sql = 'PRAGMA foreign_key_list(<%= tableName %>)';
return Utils._.template(sql)({ tableName: tableName }); return Utils._.template(sql)({ tableName: tableName });
} }
}; };
return Utils._.extend({}, MySqlQueryGenerator, QueryGenerator); module.exports = Utils._.extend({}, MySqlQueryGenerator, QueryGenerator);
})();
...@@ -9,8 +9,8 @@ var Utils = require('../../utils') ...@@ -9,8 +9,8 @@ var Utils = require('../../utils')
@class QueryInterface @class QueryInterface
@static @static
*/ */
module.exports = {
/** /**
A wrapper that fixes SQLite's inability to remove columns from existing tables. A wrapper that fixes SQLite's inability to remove columns from existing tables.
It will create a backup of the table, drop the table afterwards and create a It will create a backup of the table, drop the table afterwards and create a
new table with the same name but without the obsolete column. new table with the same name but without the obsolete column.
...@@ -27,7 +27,7 @@ module.exports = { ...@@ -27,7 +27,7 @@ module.exports = {
@since 1.6.0 @since 1.6.0
*/ */
removeColumn: function(tableName, attributeName, options) { var removeColumn = function(tableName, attributeName, options) {
var self = this; var self = this;
options = options || {}; options = options || {};
...@@ -41,9 +41,9 @@ module.exports = { ...@@ -41,9 +41,9 @@ module.exports = {
return self.sequelize.query(subQuery + ';', { raw: true, logging: options.logging }); return self.sequelize.query(subQuery + ';', { raw: true, logging: options.logging });
}); });
}); });
}, };
/** /**
A wrapper that fixes SQLite's inability to change columns from existing tables. A wrapper that fixes SQLite's inability to change columns from existing tables.
It will create a backup of the table, drop the table afterwards and create a It will create a backup of the table, drop the table afterwards and create a
new table with the same name but with a modified version of the respective column. new table with the same name but with a modified version of the respective column.
...@@ -60,7 +60,7 @@ module.exports = { ...@@ -60,7 +60,7 @@ module.exports = {
@since 1.6.0 @since 1.6.0
*/ */
changeColumn: function(tableName, attributes, options) { var changeColumn = function(tableName, attributes, options) {
var attributeName = Utils._.keys(attributes)[0] var attributeName = Utils._.keys(attributes)[0]
, self = this; , self = this;
options = options || {}; options = options || {};
...@@ -75,9 +75,9 @@ module.exports = { ...@@ -75,9 +75,9 @@ module.exports = {
return self.sequelize.query(subQuery + ';', { raw: true, logging: options.logging }); return self.sequelize.query(subQuery + ';', { raw: true, logging: options.logging });
}); });
}); });
}, };
/** /**
A wrapper that fixes SQLite's inability to rename columns from existing tables. A wrapper that fixes SQLite's inability to rename columns from existing tables.
It will create a backup of the table, drop the table afterwards and create a It will create a backup of the table, drop the table afterwards and create a
new table with the same name but with a renamed version of the respective column. new table with the same name but with a renamed version of the respective column.
...@@ -95,7 +95,7 @@ module.exports = { ...@@ -95,7 +95,7 @@ module.exports = {
@since 1.6.0 @since 1.6.0
*/ */
renameColumn: function(tableName, attrNameBefore, attrNameAfter, options) { var renameColumn = function(tableName, attrNameBefore, attrNameAfter, options) {
var self = this; var self = this;
options = options || {}; options = options || {};
...@@ -110,5 +110,10 @@ module.exports = { ...@@ -110,5 +110,10 @@ module.exports = {
return self.sequelize.query(subQuery + ';', { raw: true, logging: options.logging }); return self.sequelize.query(subQuery + ';', { raw: true, logging: options.logging });
}); });
}); });
} };
module.exports = {
removeColumn: removeColumn,
changeColumn: changeColumn,
renameColumn: renameColumn
}; };
\ No newline at end of file
...@@ -5,8 +5,7 @@ var Utils = require('../../utils') ...@@ -5,8 +5,7 @@ var Utils = require('../../utils')
, QueryTypes = require('../../query-types') , QueryTypes = require('../../query-types')
, sequelizeErrors = require('../../errors.js'); , sequelizeErrors = require('../../errors.js');
module.exports = (function() { var Query = function(database, sequelize, options) {
var Query = function(database, sequelize, options) {
this.database = database; this.database = database;
this.sequelize = sequelize; this.sequelize = sequelize;
this.instance = options.instance; this.instance = options.instance;
...@@ -18,14 +17,14 @@ module.exports = (function() { ...@@ -18,14 +17,14 @@ module.exports = (function() {
}, options || {}); }, options || {});
this.checkLoggingOption(); this.checkLoggingOption();
}; };
Utils.inherit(Query, AbstractQuery); Utils.inherit(Query, AbstractQuery);
Query.prototype.getInsertIdField = function() { Query.prototype.getInsertIdField = function() {
return 'lastID'; return 'lastID';
}; };
Query.prototype.run = function(sql) { Query.prototype.run = function(sql) {
var self = this var self = this
, promise; , promise;
...@@ -179,9 +178,9 @@ module.exports = (function() { ...@@ -179,9 +178,9 @@ module.exports = (function() {
}); });
return promise; return promise;
}; };
Query.prototype.formatError = function (err) { Query.prototype.formatError = function (err) {
var match; var match;
switch (err.code) { switch (err.code) {
...@@ -241,9 +240,9 @@ module.exports = (function() { ...@@ -241,9 +240,9 @@ module.exports = (function() {
default: default:
return new sequelizeErrors.DatabaseError(err); return new sequelizeErrors.DatabaseError(err);
} }
}; };
Query.prototype.handleShowIndexesQuery = function (data) { Query.prototype.handleShowIndexesQuery = function (data) {
var self = this; var self = this;
// Sqlite returns indexes so the one that was defined last is returned first. Lets reverse that! // Sqlite returns indexes so the one that was defined last is returned first. Lets reverse that!
...@@ -264,9 +263,9 @@ module.exports = (function() { ...@@ -264,9 +263,9 @@ module.exports = (function() {
return item; return item;
}); });
}); });
}; };
Query.prototype.getDatabaseMethod = function() { Query.prototype.getDatabaseMethod = function() {
if (this.isUpsertQuery()) { if (this.isUpsertQuery()) {
return 'exec'; // Needed to run multiple queries in one return 'exec'; // Needed to run multiple queries in one
} else if (this.isInsertQuery() || this.isUpdateQuery() || this.isBulkUpdateQuery() || (this.sql.toLowerCase().indexOf('CREATE TEMPORARY TABLE'.toLowerCase()) !== -1) || this.options.type === QueryTypes.BULKDELETE) { } else if (this.isInsertQuery() || this.isUpdateQuery() || this.isBulkUpdateQuery() || (this.sql.toLowerCase().indexOf('CREATE TEMPORARY TABLE'.toLowerCase()) !== -1) || this.options.type === QueryTypes.BULKDELETE) {
...@@ -274,7 +273,6 @@ module.exports = (function() { ...@@ -274,7 +273,6 @@ module.exports = (function() {
} else { } else {
return 'all'; return 'all';
} }
}; };
return Query; module.exports = Query;
})();
...@@ -4,28 +4,27 @@ var Toposort = require('toposort-class') ...@@ -4,28 +4,27 @@ var Toposort = require('toposort-class')
, Utils = require('./utils') , Utils = require('./utils')
, _ = require('lodash'); , _ = require('lodash');
module.exports = (function() { var ModelManager = function(sequelize) {
var ModelManager = function(sequelize) {
this.models = []; this.models = [];
this.sequelize = sequelize; this.sequelize = sequelize;
}; };
ModelManager.prototype.addModel = function(model) { ModelManager.prototype.addModel = function(model) {
this.models.push(model); this.models.push(model);
this.sequelize.models[model.name] = model; this.sequelize.models[model.name] = model;
return model; return model;
}; };
ModelManager.prototype.removeModel = function(model) { ModelManager.prototype.removeModel = function(model) {
this.models = this.models.filter(function($model) { this.models = this.models.filter(function($model) {
return $model.name !== model.name; return $model.name !== model.name;
}); });
delete this.sequelize.models[model.name]; delete this.sequelize.models[model.name];
}; };
ModelManager.prototype.getModel = function(against, options) { ModelManager.prototype.getModel = function(against, options) {
options = _.defaults(options || {}, { options = _.defaults(options || {}, {
attribute: 'name' attribute: 'name'
}); });
...@@ -35,18 +34,18 @@ module.exports = (function() { ...@@ -35,18 +34,18 @@ module.exports = (function() {
}); });
return !!model ? model[0] : null; return !!model ? model[0] : null;
}; };
ModelManager.prototype.__defineGetter__('all', function() { ModelManager.prototype.__defineGetter__('all', function() {
return this.models; return this.models;
}); });
/** /**
* Iterate over Models in an order suitable for e.g. creating tables. Will * Iterate over Models in an order suitable for e.g. creating tables. Will
* take foreign key constraints into account so that dependencies are visited * take foreign key constraints into account so that dependencies are visited
* before dependents. * before dependents.
*/ */
ModelManager.prototype.forEachModel = function(iterator, options) { ModelManager.prototype.forEachModel = function(iterator, options) {
var models = {} var models = {}
, sorter = new Toposort() , sorter = new Toposort()
, sorted , sorted
...@@ -97,7 +96,6 @@ module.exports = (function() { ...@@ -97,7 +96,6 @@ module.exports = (function() {
sorted.forEach(function(name) { sorted.forEach(function(name) {
iterator(models[name], name); iterator(models[name], name);
}); });
}; };
return ModelManager; module.exports = ModelManager;
})();
This diff could not be displayed because it is too large.
'use strict'; 'use strict';
module.exports = (function() { var Attribute = function(options) {
var Attribute = function(options) {
if (options.type === undefined) options = {type: options}; if (options.type === undefined) options = {type: options};
this.type = options.type; this.type = options.type;
}; };
return Attribute; module.exports = Attribute;
})();
...@@ -5,8 +5,7 @@ var Utils = require('./../utils') ...@@ -5,8 +5,7 @@ var Utils = require('./../utils')
, DataTypes = require('../data-types') , DataTypes = require('../data-types')
, Promise = require('bluebird'); , Promise = require('bluebird');
module.exports = (function() { var CounterCache = function(association, options) {
var CounterCache = function(association, options) {
this.association = association; this.association = association;
this.source = association.source; this.source = association.source;
this.target = association.target; this.target = association.target;
...@@ -32,10 +31,10 @@ module.exports = (function() { ...@@ -32,10 +31,10 @@ module.exports = (function() {
this.injectAttributes(); this.injectAttributes();
this.injectHooks(); this.injectHooks();
}; };
// Add countAssociation attribute to source model // Add countAssociation attribute to source model
CounterCache.prototype.injectAttributes = function() { CounterCache.prototype.injectAttributes = function() {
// Do not try to use a column that's already taken // Do not try to use a column that's already taken
Helpers.checkNamingCollision(this); Helpers.checkNamingCollision(this);
...@@ -54,10 +53,10 @@ module.exports = (function() { ...@@ -54,10 +53,10 @@ module.exports = (function() {
// Sync attributes and setters/getters to DAO prototype // Sync attributes and setters/getters to DAO prototype
this.source.refreshAttributes(); this.source.refreshAttributes();
}; };
// Add setAssociaton method to the prototype of the model instance // Add setAssociaton method to the prototype of the model instance
CounterCache.prototype.injectHooks = function() { CounterCache.prototype.injectHooks = function() {
var association = this.association, var association = this.association,
counterCacheInstance = this, counterCacheInstance = this,
CounterUtil, CounterUtil,
...@@ -173,7 +172,6 @@ module.exports = (function() { ...@@ -173,7 +172,6 @@ module.exports = (function() {
association.target.addHook('afterUpdate', atomicHooks.update); association.target.addHook('afterUpdate', atomicHooks.update);
association.target.addHook('afterDestroy', atomicHooks.destroy); association.target.addHook('afterDestroy', atomicHooks.destroy);
} }
}; };
return CounterCache; module.exports = CounterCache;
})();
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
var DataTypes = require('./data-types') var DataTypes = require('./data-types')
, SqlString = require('./sql-string') , SqlString = require('./sql-string')
, lodash = require('lodash') , lodash = require('lodash')
, ParameterValidator = require('./utils/parameter-validator') , parameterValidator = require('./utils/parameter-validator')
, inflection = require('inflection') , inflection = require('inflection')
, dottie = require('dottie') , dottie = require('dottie')
, uuid = require('node-uuid') , uuid = require('node-uuid')
...@@ -398,9 +398,7 @@ var Utils = module.exports = { ...@@ -398,9 +398,7 @@ var Utils = module.exports = {
this.logic = logic; this.logic = logic;
}, },
validateParameter: function(value, expectation, options) { validateParameter: parameterValidator,
return ParameterValidator.check(value, expectation, options);
},
formatReferences: function (obj) { formatReferences: function (obj) {
if (!lodash.isPlainObject(obj.references)) { if (!lodash.isPlainObject(obj.references)) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
var _ = require('lodash'); var _ = require('lodash');
var util = require('util'); var util = require('util');
var validateDeprecation = function(value, expectation, options) { function validateDeprecation (value, expectation, options) {
if (!options.deprecated) { if (!options.deprecated) {
return; return;
} }
...@@ -17,9 +17,9 @@ var validateDeprecation = function(value, expectation, options) { ...@@ -17,9 +17,9 @@ var validateDeprecation = function(value, expectation, options) {
} }
return valid; return valid;
}; }
var validate = function(value, expectation) { function validate (value, expectation) {
// the second part of this check is a workaround to deal with an issue that occurs in node-webkit when // the second part of this check is a workaround to deal with an issue that occurs in node-webkit when
// using object literals. https://github.com/sequelize/sequelize/issues/2685 // using object literals. https://github.com/sequelize/sequelize/issues/2685
if (value instanceof expectation || Object.prototype.toString.call(value) === Object.prototype.toString.call(expectation.call())) { if (value instanceof expectation || Object.prototype.toString.call(value) === Object.prototype.toString.call(expectation.call())) {
...@@ -27,10 +27,9 @@ var validate = function(value, expectation) { ...@@ -27,10 +27,9 @@ var validate = function(value, expectation) {
} }
throw new Error(util.format('The parameter (value: %s) is no %s.', value, expectation.name)); throw new Error(util.format('The parameter (value: %s) is no %s.', value, expectation.name));
}; }
module.exports = { function check (value, expectation, options) {
check: function(value, expectation, options) {
options = _.extend({ options = _.extend({
deprecated: false, deprecated: false,
index: null, index: null,
...@@ -53,5 +52,6 @@ module.exports = { ...@@ -53,5 +52,6 @@ module.exports = {
return false return false
|| validateDeprecation(value, expectation, options) || validateDeprecation(value, expectation, options)
|| validate(value, expectation, options); || validate(value, expectation, options);
} }
};
module.exports = check;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!