Skip to content

Commit 7a9cc2c

Browse files
committed
private -> protected
1 parent cd62098 commit 7a9cc2c

File tree

5 files changed

+38
-38
lines changed

5 files changed

+38
-38
lines changed

src/connection.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,22 @@ export type Config =
9292
}>;
9393

9494
export class Connection {
95-
private _activeTasks: number = 0;
96-
private _agent?: any;
97-
private _agentOptions: { [key: string]: any };
98-
private _arangoVersion: number = 30400;
99-
private _headers: { [key: string]: string };
100-
private _loadBalancingStrategy: LoadBalancingStrategy;
101-
private _useFailOver: boolean;
102-
private _shouldRetry: boolean;
103-
private _maxRetries: number;
104-
private _maxTasks: number;
105-
private _queue = new LinkedList<Task>();
106-
private _hosts: RequestFunction[] = [];
107-
private _urls: string[] = [];
108-
private _activeHost: number;
109-
private _activeDirtyHost: number;
110-
private _transactionId: string | null = null;
95+
protected _activeTasks: number = 0;
96+
protected _agent?: any;
97+
protected _agentOptions: { [key: string]: any };
98+
protected _arangoVersion: number = 30400;
99+
protected _headers: { [key: string]: string };
100+
protected _loadBalancingStrategy: LoadBalancingStrategy;
101+
protected _useFailOver: boolean;
102+
protected _shouldRetry: boolean;
103+
protected _maxRetries: number;
104+
protected _maxTasks: number;
105+
protected _queue = new LinkedList<Task>();
106+
protected _hosts: RequestFunction[] = [];
107+
protected _urls: string[] = [];
108+
protected _activeHost: number;
109+
protected _activeDirtyHost: number;
110+
protected _transactionId: string | null = null;
111111

112112
constructor(config: Config = {}) {
113113
if (typeof config === "string") config = { url: config };
@@ -155,7 +155,7 @@ export class Connection {
155155
}
156156
}
157157

158-
private _runQueue() {
158+
protected _runQueue() {
159159
if (!this._queue.length || this._activeTasks >= this._maxTasks) return;
160160
const task = this._queue.shift()!;
161161
let host = this._activeHost;
@@ -220,7 +220,7 @@ export class Connection {
220220
}
221221
}
222222

223-
private _buildUrl({ basePath, path, qs }: UrlInfo) {
223+
protected _buildUrl({ basePath, path, qs }: UrlInfo) {
224224
const pathname = `${basePath || ""}${path || ""}`;
225225
let search;
226226
if (qs) {

src/cursor.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export class ArrayCursor<T = any> {
99
};
1010
count?: number;
1111

12-
private _db: Database;
13-
private _result: T[];
14-
private _hasMore: boolean;
15-
private _id: string | undefined;
16-
private _host?: number;
17-
private _allowDirtyRead?: boolean;
12+
protected _db: Database;
13+
protected _result: T[];
14+
protected _hasMore: boolean;
15+
protected _id: string | undefined;
16+
protected _host?: number;
17+
protected _allowDirtyRead?: boolean;
1818

1919
constructor(
2020
db: Database,
@@ -38,13 +38,13 @@ export class ArrayCursor<T = any> {
3838
this._allowDirtyRead = allowDirtyRead;
3939
}
4040

41-
private async _drain(): Promise<ArrayCursor<T>> {
41+
protected async _drain(): Promise<ArrayCursor<T>> {
4242
await this._more();
4343
if (!this._hasMore) return this;
4444
return this._drain();
4545
}
4646

47-
private async _more(): Promise<void> {
47+
protected async _more(): Promise<void> {
4848
if (!this._hasMore) return;
4949
const res = await this._db.request({
5050
method: "PUT",

src/graph.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export type GraphCollectionRemoveOptions = {
5757
export class GraphVertexCollection<T extends object = any>
5858
implements ArangoCollection {
5959
isArangoCollection: true = true;
60-
private _db: Database;
61-
private _name: string;
60+
protected _db: Database;
61+
protected _name: string;
6262

6363
graph: Graph;
6464
collection: DocumentCollection<T>;
@@ -230,8 +230,8 @@ export class GraphVertexCollection<T extends object = any>
230230
export class GraphEdgeCollection<T extends object = any>
231231
implements ArangoCollection {
232232
isArangoCollection: true = true;
233-
private _db: Database;
234-
private _name: string;
233+
protected _db: Database;
234+
protected _name: string;
235235

236236
graph: Graph;
237237
collection: EdgeCollection<T>;
@@ -431,9 +431,9 @@ export type GraphCreateOptions = {
431431
};
432432

433433
export class Graph {
434-
private _name: string;
434+
protected _name: string;
435435

436-
private _db: Database;
436+
protected _db: Database;
437437

438438
constructor(db: Database, name: string) {
439439
this._name = name;

src/route.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export type Headers = { [key: string]: string };
66
export type Params = { [key: string]: string | number | boolean };
77

88
export class Route {
9-
private _db: Database;
10-
private _path: string;
11-
private _headers: Headers;
9+
protected _db: Database;
10+
protected _path: string;
11+
protected _headers: Headers;
1212

1313
constructor(db: Database, path: string = "", headers: Headers = {}) {
1414
if (!path) path = "";
@@ -37,7 +37,7 @@ export class Route {
3737
return this._db.request(options);
3838
}
3939

40-
private _request1(method: string, ...args: any[]) {
40+
protected _request1(method: string, ...args: any[]) {
4141
let path: string = "";
4242
let qs: Params | undefined;
4343
let headers: Headers | undefined;
@@ -53,7 +53,7 @@ export class Route {
5353
return this.request({ method, path, qs, headers });
5454
}
5555

56-
private _request2(method: string, ...args: any[]) {
56+
protected _request2(method: string, ...args: any[]) {
5757
let path: string = "";
5858
let body: any = undefined;
5959
let qs: Params | undefined;

src/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface TransactionStatus {
1515
const TRANSACTION_NOT_FOUND = 10;
1616
export class Transaction implements ArangoTransaction {
1717
isArangoTransaction: true = true;
18-
private _db: Database;
18+
protected _db: Database;
1919
id: string;
2020

2121
constructor(db: Database, id: string) {

0 commit comments

Comments
 (0)