Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some typos #1024

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions commands/db_truncate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default class DbTruncate extends BaseCommand {
/**
* Prompts to take consent when truncating the database in production
*/
private async takeProductionConstent(): Promise<boolean> {
private async takeProductionConsent(): Promise<boolean> {
const question = 'You are in production environment. Want to continue truncating the database?'
try {
return await this.prompt.confirm(question)
Expand Down Expand Up @@ -78,7 +78,7 @@ export default class DbTruncate extends BaseCommand {
*/
let continueTruncate = !this.app.inProduction || this.force
if (!continueTruncate) {
continueTruncate = await this.takeProductionConstent()
continueTruncate = await this.takeProductionConsent()
}

/**
Expand Down
4 changes: 2 additions & 2 deletions commands/db_wipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class DbWipe extends BaseCommand {
/**
* Prompts to take consent when wiping the database in production
*/
private async takeProductionConstent(): Promise<boolean> {
private async takeProductionConsent(): Promise<boolean> {
const question = 'You are in production environment. Want to continue wiping the database?'
try {
return await this.prompt.confirm(question)
Expand Down Expand Up @@ -141,7 +141,7 @@ export default class DbWipe extends BaseCommand {
*/
let continueWipe = !this.app.inProduction || this.force
if (!continueWipe) {
continueWipe = await this.takeProductionConstent()
continueWipe = await this.takeProductionConsent()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion commands/migration/_base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default abstract class MigrationsBase extends BaseCommand {
/**
* Prompts to take consent for running migrations in production
*/
protected async takeProductionConstent(): Promise<boolean> {
protected async takeProductionConsent(): Promise<boolean> {
const question = 'You are in production environment. Want to continue running migrations?'
try {
return await this.prompt.confirm(question)
Expand Down
4 changes: 2 additions & 2 deletions commands/migration/rollback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class Rollback extends MigrationsBase {
/**
* Force run migrations in production
*/
@flags.boolean({ description: 'Explictly force to run migrations in production' })
@flags.boolean({ description: 'Explicitly force to run migrations in production' })
declare force: boolean

/**
Expand Down Expand Up @@ -102,7 +102,7 @@ export default class Rollback extends MigrationsBase {
*/
let continueMigrations = !this.app.inProduction || this.force
if (!continueMigrations) {
continueMigrations = await this.takeProductionConstent()
continueMigrations = await this.takeProductionConsent()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion commands/migration/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class Migrate extends MigrationsBase {
*/
let continueMigrations = !this.app.inProduction || this.force
if (!continueMigrations) {
continueMigrations = await this.takeProductionConstent()
continueMigrations = await this.takeProductionConsent()
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/bindings/vinejs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function defineValidationRules(db: Database) {
return
}

const isUnqiue = await checker(db, value as string, field)
if (!isUnqiue) {
const isUnique = await checker(db, value as string, field)
if (!isUnique) {
field.report('The {{ field }} has already been taken', 'database.unique', field)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/connection/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class ConnectionManager implements ConnectionManagerContract {

/**
* Move the current connection to the orphan connections. We need
* to keep a seperate track of old connections to make sure
* to keep a separate track of old connections to make sure
* they cleanup after some time
*/
if (connection.connection) {
Expand Down
2 changes: 1 addition & 1 deletion src/database/query_builder/chainable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { RawBuilder } from '../static_builder/raw.js'
import { ReferenceBuilder } from '../static_builder/reference.js'

/**
* The chainable query builder to consturct SQL queries for selecting, updating and
* The chainable query builder to construct SQL queries for selecting, updating and
* deleting records.
*
* The API internally uses the knex query builder. However, many of methods may have
Expand Down
4 changes: 2 additions & 2 deletions src/orm/relations/belongs_to/query_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class BelongsToQueryBuilder extends BaseQueryBuilder {
}

/**
* The profiler data for belongsTo relatioship
* The profiler data for belongsTo relationship
*/
protected profilerData() {
return {
Expand Down Expand Up @@ -92,7 +92,7 @@ export class BelongsToQueryBuilder extends BaseQueryBuilder {
const queryAction = this.queryAction()

/**
* Eager query contraints
* Eager query constraints
*/
if (Array.isArray(this.parent)) {
const foreignKeyValues = this.parent
Expand Down
2 changes: 1 addition & 1 deletion src/orm/relations/has_many/query_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class HasManyQueryBuilder
this.appliedConstraints = true

/**
* Eager query contraints
* Eager query constraints
*/
if (Array.isArray(this.parent)) {
this.wrapExisting().whereIn(
Expand Down
2 changes: 1 addition & 1 deletion src/orm/relations/has_many_through/query_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class HasManyThroughQueryBuilder
const queryAction = this.queryAction()

/**
* Eager query contraints
* Eager query constraints
*/
if (Array.isArray(this.parent)) {
builder.whereIn(
Expand Down
2 changes: 1 addition & 1 deletion src/orm/relations/has_one/query_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class HasOneQueryBuilder extends BaseQueryBuilder {
const queryAction = this.queryAction()

/**
* Eager query contraints
* Eager query constraints
*/
if (Array.isArray(this.parent)) {
this.wrapExisting().whereIn(
Expand Down
12 changes: 6 additions & 6 deletions src/orm/relations/many_to_many/pivot_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export class PivotHelpers {
/**
* Adds a where pivot condition to the query
*/
wherePivot(varition: 'or' | 'and' | 'not' | 'orNot', key: any, operator?: any, value?: any) {
wherePivot(variation: 'or' | 'and' | 'not' | 'orNot', key: any, operator?: any, value?: any) {
let method: keyof (ManyToManyQueryBuilder | ManyToManySubQueryBuilder) = 'where'

switch (varition) {
switch (variation) {
case 'or':
method = 'orWhere'
break
Expand All @@ -71,10 +71,10 @@ export class PivotHelpers {
/**
* Adds a where pivot condition to the query
*/
whereNullPivot(varition: 'or' | 'and' | 'not' | 'orNot', key: string) {
whereNullPivot(variation: 'or' | 'and' | 'not' | 'orNot', key: string) {
let method: keyof (ManyToManyQueryBuilder | ManyToManySubQueryBuilder) = 'whereNull'

switch (varition) {
switch (variation) {
case 'or':
method = 'orWhereNull'
break
Expand All @@ -91,10 +91,10 @@ export class PivotHelpers {
/**
* Adds a where pivot condition to the query
*/
whereInPivot(varition: 'or' | 'and' | 'not' | 'orNot', key: any, value: any) {
whereInPivot(variation: 'or' | 'and' | 'not' | 'orNot', key: any, value: any) {
let method: keyof (ManyToManyQueryBuilder | ManyToManySubQueryBuilder) = 'whereIn'

switch (varition) {
switch (variation) {
case 'or':
method = 'orWhereIn'
break
Expand Down
2 changes: 1 addition & 1 deletion src/orm/relations/many_to_many/query_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class ManyToManyQueryBuilder
const queryAction = this.queryAction()

/**
* Eager query contraints
* Eager query constraints
*/
if (Array.isArray(this.parent)) {
this.wrapExisting().whereInPivot(
Expand Down
2 changes: 1 addition & 1 deletion src/seeders/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class SeedsRunner {
}

/**
* Ignore when when the node environement is not the same as the seeder configuration.
* Ignore when the node environment is not the same as the seeder configuration.
*/
if (Source.environment && !Source.environment.includes(this.nodeEnvironment)) {
seeder.status = 'ignored'
Expand Down
6 changes: 3 additions & 3 deletions src/types/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export interface TransactionFn {
}

/**
* Shape of the query client, that is used to retrive instances
* Shape of the query client, that is used to retrieve instances
* of query builder
*/
export interface QueryClientContract {
Expand All @@ -117,13 +117,13 @@ export interface QueryClientContract {
readonly mode: 'dual' | 'write' | 'read'

/**
* The name of the connnection from which the client
* The name of the connection from which the client
* was originated
*/
readonly connectionName: string

/**
* Is debug enabled on the connnection or not. Also opens up the API to
* Is debug enabled on the connection or not. Also opens up the API to
* disable debug for a given client
*/
debug: boolean
Expand Down