Skip to content

Commit

Permalink
fix: don't export protected methods (ali-sdk#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Mar 6, 2023
1 parent 13de465 commit b2757df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit b2757df

Please sign in to comment.