Skip to content

Commit

Permalink
Fix some spelling mistakes (#3572)
Browse files Browse the repository at this point in the history
  • Loading branch information
asashour authored and kibertoad committed Dec 10, 2019
1 parent dcbe555 commit a613fe2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -26,7 +26,7 @@ Documentation pull requests should not be merged before knex version which has t

Currently there are already way too many dialects supported in `knex` and instead of adding new dialect to central codebase, all the dialects should be moved to separate npm packages out from `knex` core library with their respective maintainers and test suites.

So if you like to write your own dialect, you can just inherit own dialect from knex base classes and use it by passing dilaect to knex in knex configuration (https://runkit.com/embed/90b3cpyr4jh2):
So if you like to write your own dialect, you can just inherit own dialect from knex base classes and use it by passing dialect to knex in knex configuration (https://runkit.com/embed/90b3cpyr4jh2):

```js
// simple dialect overriding sqlite3 dialect to use sqlite3-offline driver
Expand Down Expand Up @@ -152,7 +152,7 @@ $ KNEX_TEST='./path/to/my/config.js' npm test

### Creating Postgres User

If you are running tests agains own local database one might need to setup test user and databse for knex to connect.
If you are running tests against own local database one might need to setup test user and database for knex to connect.

To create a new user, login to Postgres and use the following queries to add the user. This assumes you've already created the `knex_test` database.

Expand Down
2 changes: 1 addition & 1 deletion lib/dialects/oracledb/index.js
Expand Up @@ -78,7 +78,7 @@ Client_Oracledb.prototype.prepBindings = function(bindings) {
Client_Oracledb.prototype.acquireRawConnection = function() {
const client = this;
const asyncConnection = new Bluebird(function(resolver, rejecter) {
// If external authentication dont have to worry about username/password and
// If external authentication don't have to worry about username/password and
// if not need to set the username and password
const oracleDbConfig = client.connectionSettings.externalAuth
? { externalAuth: client.connectionSettings.externalAuth }
Expand Down
2 changes: 1 addition & 1 deletion lib/util/make-knex.js
Expand Up @@ -222,7 +222,7 @@ function redefineProperties(knex, client) {
}

// Unfortunately, something seems to be broken in Node 6 and removing events from a clone also mutates original Knex,
// which is highly undesireable
// which is highly undesirable
if (knex._internalListeners) {
knex._internalListeners.forEach(({ eventName, listener }) => {
knex.client.removeListener(eventName, listener); // Remove duplicates for copies
Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/inserts.js
Expand Up @@ -763,7 +763,7 @@ module.exports = function(knex) {
})
.then(
function() {
// No errors happen in sqlite3 or mysql, which dont have native support
// No errors happen in sqlite3 or mysql, which don't have native support
// for the uuid type.
if (
knex.client.driverName === 'pg' ||
Expand Down
18 changes: 9 additions & 9 deletions types/index.d.ts
Expand Up @@ -49,7 +49,7 @@ type UnionToIntersection<U> = (U extends any
? I
: never;

type ComparisionOperator = '=' | '>' | '>=' | '<' | '<=' | '<>';
type ComparisonOperator = '=' | '>' | '>=' | '<' | '<=' | '<>';

// If T is an array, get the type of member, else fall back to never
type ArrayMember<T> = T extends (infer M)[] ? M : never;
Expand Down Expand Up @@ -97,7 +97,7 @@ type DeferredKeySelection<
TKeys extends string,
// Changes how the resolution should behave if TKeys is never.
// If true, then we assume that some keys were selected, and if TKeys is never, we will fall back to any.
// If false, and TKeys is never, then we select TBase in its entirity
// If false, and TKeys is never, then we select TBase in its entirety
THasSelect extends true | false = false,
// Mapping of aliases <key in result> -> <key in TBase>
TAliasMapping extends {} = {},
Expand Down Expand Up @@ -521,8 +521,8 @@ declare namespace Knex {
limit(limit: number): QueryBuilder<TRecord, TResult>;

// Aggregation
count: AssymetricAggregation<TRecord, TResult, Lookup<ResultTypes.Registry, "Count", number | string>>;
countDistinct: AssymetricAggregation<TRecord, TResult, Lookup<ResultTypes.Registry, "Count", number | string>>;
count: AsymmetricAggregation<TRecord, TResult, Lookup<ResultTypes.Registry, "Count", number | string>>;
countDistinct: AsymmetricAggregation<TRecord, TResult, Lookup<ResultTypes.Registry, "Count", number | string>>;
min: TypePreservingAggregation<TRecord, TResult>;
max: TypePreservingAggregation<TRecord, TResult>;
sum: TypePreservingAggregation<TRecord, TResult>;
Expand Down Expand Up @@ -1057,7 +1057,7 @@ declare namespace Knex {

<T extends keyof TRecord>(
columnName: T,
operator: ComparisionOperator,
operator: ComparisonOperator,
value: TRecord[T] | null
): QueryBuilder<TRecord, TResult>;
(columnName: string, operator: string, value: Value | null): QueryBuilder<
Expand All @@ -1067,7 +1067,7 @@ declare namespace Knex {

<T extends keyof TRecord, TRecordInner, TResultInner>(
columnName: T,
operator: ComparisionOperator,
operator: ComparisonOperator,
value: QueryBuilder<TRecordInner, TResultInner>
): QueryBuilder<TRecord, TResult>;
<TRecordInner, TResultInner>(
Expand Down Expand Up @@ -1151,11 +1151,11 @@ declare namespace Knex {
): QueryBuilder<TRecord, TResult>;
}

// Note: Attempting to unify AssymetricAggregation & TypePreservingAggregation
// Note: Attempting to unify AsymmetricAggregation & TypePreservingAggregation
// by extracting out a common base interface will not work because order of overloads
// is significant.

interface AssymetricAggregation<TRecord = any, TResult = unknown[], TValue = any> {
interface AsymmetricAggregation<TRecord = any, TResult = unknown[], TValue = any> {
<TResult2 = AggregationQueryResult<TResult, Dict<TValue>>>(
...columnNames: (keyof TRecord)[]
): QueryBuilder<TRecord, TResult2>;
Expand Down Expand Up @@ -1232,7 +1232,7 @@ declare namespace Knex {
<K1 extends keyof TRecord, K2 extends keyof TRecord>(
tableName: string,
column1: K1,
operator: ComparisionOperator,
operator: ComparisonOperator,
column2: K2
): QueryBuilder<TRecord, TResult>;
(
Expand Down

0 comments on commit a613fe2

Please sign in to comment.