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: don't export protected methods #106

Merged
merged 1 commit into from
Mar 6, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export abstract class Operator {
return await this.query(sql);
}

_where(where?: object | null) {
protected _where(where?: object | null) {
if (!where) {
return '';
}
Expand All @@ -358,7 +358,7 @@ export abstract class Operator {
return '';
}

_selectColumns(table: string, columns?: string | string[]) {
protected _selectColumns(table: string, columns?: string | string[]) {
if (!columns || columns.length === 0) {
columns = '*';
}
Expand All @@ -368,7 +368,7 @@ export abstract class Operator {
return this.format('SELECT ?? FROM ??', [ columns, table ]);
}

_orders(orders?: string | string[]) {
protected _orders(orders?: string | string[]) {
if (!orders) {
return '';
}
Expand All @@ -395,7 +395,7 @@ export abstract class Operator {
return ' ORDER BY ' + values.join(', ');
}

_limit(limit?: number, offset?: number) {
protected _limit(limit?: number, offset?: number) {
if (!limit || typeof limit !== 'number') {
return '';
}
Expand Down
2 changes: 1 addition & 1 deletion test/operator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CustomOperator extends Operator {}
describe('test/operator.test.ts', () => {
describe('_where(where)', () => {
it('should get where sql', () => {
const op = new CustomOperator();
const op: any = new CustomOperator();
assert.equal(op._where(), '');
assert.equal(op._where({}), '');
assert.equal(op._where({ id: 1 }), ' WHERE `id` = 1');
Expand Down