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

Commit bb952e89 by Wei-Liang Liou Committed by Sushant

docs: fix many typos (#10667)

1 parent b3091314
...@@ -154,7 +154,7 @@ Model.findAll({ ...@@ -154,7 +154,7 @@ Model.findAll({
Model.findAll({ Model.findAll({
where: { where: {
[Sequelize.Op.and]: [ // Dont use sequelize.Op, use Sequelize.Op instead [Sequelize.Op.and]: [ // Don't use sequelize.Op, use Sequelize.Op instead
{ {
name: "Abc" name: "Abc"
}, },
......
...@@ -83,7 +83,7 @@ class ConnectionManager extends AbstractConnectionManager { ...@@ -83,7 +83,7 @@ class ConnectionManager extends AbstractConnectionManager {
resolve(connection); resolve(connection);
}; };
// dont use connection.once for error event handling here // don't use connection.once for error event handling here
// mysql2 emit error two times in case handshake was failed // mysql2 emit error two times in case handshake was failed
// first error is protocol_lost and second is timeout // first error is protocol_lost and second is timeout
// if we will use `once.error` node process will crash on 2nd error emit // if we will use `once.error` node process will crash on 2nd error emit
......
...@@ -4159,7 +4159,7 @@ class Model { ...@@ -4159,7 +4159,7 @@ class Model {
* @see * @see
* {@link Model#reload} * {@link Model#reload}
* @param {string|Array|Object} fields If a string is provided, that column is decremented by the value of `by` given in options. If an array is provided, the same is true for each column. If and object is provided, each column is decremented by the value given * @param {string|Array|Object} fields If a string is provided, that column is decremented by the value of `by` given in options. If an array is provided, the same is true for each column. If and object is provided, each column is decremented by the value given
* @param {Object} [options] drecrement options * @param {Object} [options] decrement options
* @param {number} [options.by=1] The number to decrement by * @param {number} [options.by=1] The number to decrement by
* @param {boolean} [options.silent=false] If true, the updatedAt timestamp will not be updated. * @param {boolean} [options.silent=false] If true, the updatedAt timestamp will not be updated.
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
......
...@@ -5,7 +5,7 @@ const _ = require('lodash'); ...@@ -5,7 +5,7 @@ const _ = require('lodash');
const Utils = require('./utils'); const Utils = require('./utils');
const DataTypes = require('./data-types'); const DataTypes = require('./data-types');
const SQLiteQueryInterface = require('./dialects/sqlite/query-interface'); const SQLiteQueryInterface = require('./dialects/sqlite/query-interface');
const MSSSQLQueryInterface = require('./dialects/mssql/query-interface'); const MSSQLQueryInterface = require('./dialects/mssql/query-interface');
const MySQLQueryInterface = require('./dialects/mysql/query-interface'); const MySQLQueryInterface = require('./dialects/mysql/query-interface');
const PostgresQueryInterface = require('./dialects/postgres/query-interface'); const PostgresQueryInterface = require('./dialects/postgres/query-interface');
const Transaction = require('./transaction'); const Transaction = require('./transaction');
...@@ -531,7 +531,7 @@ class QueryInterface { ...@@ -531,7 +531,7 @@ class QueryInterface {
return SQLiteQueryInterface.removeColumn(this, tableName, attributeName, options); return SQLiteQueryInterface.removeColumn(this, tableName, attributeName, options);
case 'mssql': case 'mssql':
// mssql needs special treatment as it cannot drop a column with a default or foreign key constraint // mssql needs special treatment as it cannot drop a column with a default or foreign key constraint
return MSSSQLQueryInterface.removeColumn(this, tableName, attributeName, options); return MSSQLQueryInterface.removeColumn(this, tableName, attributeName, options);
case 'mysql': case 'mysql':
case 'mariadb': case 'mariadb':
// mysql/mariadb need special treatment as it cannot drop a column with a foreign key constraint // mysql/mariadb need special treatment as it cannot drop a column with a foreign key constraint
......
...@@ -705,7 +705,7 @@ class Sequelize { ...@@ -705,7 +705,7 @@ class Sequelize {
* @param {boolean} [options.force=false] If force is true, each Model will run `DROP TABLE IF EXISTS`, before it tries to create its own table * @param {boolean} [options.force=false] If force is true, each Model will run `DROP TABLE IF EXISTS`, before it tries to create its own table
* @param {RegExp} [options.match] Match a regex against the database name before syncing, a safety check for cases where force: true is used in tests but not live code * @param {RegExp} [options.match] Match a regex against the database name before syncing, a safety check for cases where force: true is used in tests but not live code
* @param {boolean|Function} [options.logging=console.log] A function that logs sql queries, or false for no logging * @param {boolean|Function} [options.logging=console.log] A function that logs sql queries, or false for no logging
* @param {string} [options.schema='public'] The schema that the tables should be created in. This can be overriden for each table in sequelize.define * @param {string} [options.schema='public'] The schema that the tables should be created in. This can be overridden for each table in sequelize.define
* @param {string} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {string} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {boolean} [options.hooks=true] If hooks is true then beforeSync, afterSync, beforeBulkSync, afterBulkSync hooks will be called * @param {boolean} [options.hooks=true] If hooks is true then beforeSync, afterSync, beforeBulkSync, afterBulkSync hooks will be called
* @param {boolean} [options.alter=false] Alters tables to fit models. Not recommended for production use. Deletes data in columns that were removed or had their type changed in the model. * @param {boolean} [options.alter=false] Alters tables to fit models. Not recommended for production use. Deletes data in columns that were removed or had their type changed in the model.
......
...@@ -1424,8 +1424,8 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => { ...@@ -1424,8 +1424,8 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => {
} }
}); });
// Usar not to clash with the beforEach definition // User not to clash with the beforeEach definition
const Users = this.sequelize.define('Usar', { const Users = this.sequelize.define('User', {
name: { name: {
type: DataTypes.STRING type: DataTypes.STRING
} }
...@@ -2541,7 +2541,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => { ...@@ -2541,7 +2541,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => {
}); });
it('should setup correct foreign keys', function() { it('should setup correct foreign keys', function() {
/* camcelCase */ /* camelCase */
let Person = this.sequelize.define('Person'), let Person = this.sequelize.define('Person'),
PersonChildren = this.sequelize.define('PersonChildren'), PersonChildren = this.sequelize.define('PersonChildren'),
Children; Children;
......
...@@ -356,7 +356,7 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -356,7 +356,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
}); });
}); });
it('should allow blank arrays (return immediatly)', function() { it('should allow blank arrays (return immediately)', function() {
const Worker = this.sequelize.define('Worker', {}); const Worker = this.sequelize.define('Worker', {});
return Worker.sync().then(() => { return Worker.sync().then(() => {
return Worker.bulkCreate([]).then(workers => { return Worker.bulkCreate([]).then(workers => {
...@@ -718,7 +718,7 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -718,7 +718,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
}); });
}); });
it('shold not validate', function() { it('should not validate', function() {
return this.User return this.User
.sync({ force: true }) .sync({ force: true })
.then(() => this.User.bulkCreate([ .then(() => this.User.bulkCreate([
......
...@@ -1024,7 +1024,7 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -1024,7 +1024,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
}); });
} }
it('raises an error if created object breaks definition contraints', function() { it('raises an error if created object breaks definition constraints', function() {
const UserNull = this.sequelize.define('UserWithNonNullSmth', { const UserNull = this.sequelize.define('UserWithNonNullSmth', {
username: { type: Sequelize.STRING, unique: true }, username: { type: Sequelize.STRING, unique: true },
smth: { type: Sequelize.STRING, allowNull: false } smth: { type: Sequelize.STRING, allowNull: false }
...@@ -1043,7 +1043,7 @@ describe(Support.getTestDialectTeaser('Model'), () => { ...@@ -1043,7 +1043,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
}); });
}); });
}); });
it('raises an error if created object breaks definition contraints', function() { it('raises an error if created object breaks definition constraints', function() {
const UserNull = this.sequelize.define('UserWithNonNullSmth', { const UserNull = this.sequelize.define('UserWithNonNullSmth', {
username: { type: Sequelize.STRING, unique: true }, username: { type: Sequelize.STRING, unique: true },
smth: { type: Sequelize.STRING, allowNull: false } smth: { type: Sequelize.STRING, allowNull: false }
......
...@@ -81,7 +81,7 @@ if (current.dialect.supports.transactions) { ...@@ -81,7 +81,7 @@ if (current.dialect.supports.transactions) {
}); });
}); });
it('supports running hooks when a transaction is commited', function() { it('supports running hooks when a transaction is committed', function() {
const hook = sinon.spy(); const hook = sinon.spy();
let transaction; let transaction;
return expect(this.sequelize.transaction(t => { return expect(this.sequelize.transaction(t => {
...@@ -106,7 +106,7 @@ if (current.dialect.supports.transactions) { ...@@ -106,7 +106,7 @@ if (current.dialect.supports.transactions) {
}); });
}); });
//Promise rejection test is specifc to postgres //Promise rejection test is specific to postgres
if (dialect === 'postgres') { if (dialect === 'postgres') {
it('do not rollback if already committed', function() { it('do not rollback if already committed', function() {
const SumSumSum = this.sequelize.define('transaction', { const SumSumSum = this.sequelize.define('transaction', {
...@@ -154,7 +154,7 @@ if (current.dialect.supports.transactions) { ...@@ -154,7 +154,7 @@ if (current.dialect.supports.transactions) {
}); });
}); });
it('does not allow queries immediatly after commit call', function() { it('does not allow queries immediately after commit call', function() {
return expect( return expect(
this.sequelize.transaction().then(t => { this.sequelize.transaction().then(t => {
return this.sequelize.query('SELECT 1+1', { transaction: t, raw: true }).then(() => { return this.sequelize.query('SELECT 1+1', { transaction: t, raw: true }).then(() => {
...@@ -194,7 +194,7 @@ if (current.dialect.supports.transactions) { ...@@ -194,7 +194,7 @@ if (current.dialect.supports.transactions) {
.to.eventually.be.rejectedWith('Transaction cannot be rolled back because it never started'); .to.eventually.be.rejectedWith('Transaction cannot be rolled back because it never started');
}); });
it('does not allow queries immediatly after rollback call', function() { it('does not allow queries immediately after rollback call', function() {
return expect( return expect(
this.sequelize.transaction().then(t => { this.sequelize.transaction().then(t => {
return Promise.join( return Promise.join(
...@@ -508,7 +508,7 @@ if (current.dialect.supports.transactions) { ...@@ -508,7 +508,7 @@ if (current.dialect.supports.transactions) {
}).then(() => { }).then(() => {
t2Spy(); t2Spy();
return t2.commit().then(() => { return t2.commit().then(() => {
expect(t2Spy).to.have.been.calledAfter(t1Spy); // Find should not succeed before t1 has comitted expect(t2Spy).to.have.been.calledAfter(t1Spy); // Find should not succeed before t1 has committed
}); });
}), }),
......
...@@ -48,7 +48,7 @@ export interface SyncOptions extends Logging { ...@@ -48,7 +48,7 @@ export interface SyncOptions extends Logging {
match?: RegExp; match?: RegExp;
/** /**
* The schema that the tables should be created in. This can be overriden for each table in sequelize.define * The schema that the tables should be created in. This can be overridden for each table in sequelize.define
*/ */
schema?: string; schema?: string;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!