Skip to content

Commit 5515cf6

Browse files
committed
fix(selectql.ts): change access modifier of a util method to be used in WHERE and AND methods
changed filtered util method for WHERE and AND functions
1 parent f68431b commit 5515cf6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/SelectQL.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export class SelectQL implements ISelector {
2323

2424

2525
/**
26-
* Like a map to iterate and pick an item by key and conditionally change array like object
26+
* As per SQL definition The WHERE clause is used to filter records.
27+
* It is used to extract only those records that fulfill a specified condition.
2728
* @param expressionKey string or any key
2829
* @param expressionOperator Operator type operator
2930
* @param expressionValue string or any value
@@ -41,13 +42,13 @@ export class SelectQL implements ISelector {
4142
}
4243

4344
/**
44-
* another predicate which eventually calls where
45+
* where like function a predicate which will eventually use WHERE method
4546
* @param expressionKey string or any key
4647
* @param expressionOperator Operator type operator
4748
* @param expressionValue string or any value
4849
* @returns extracted array like object
4950
*/
50-
and(expressionKey: any, expressionOperator: Operators, expressionValue: any): this {
51+
and(expressionKey: any, expressionOperator: Operators, expressionValue: any): this {
5152
let filtered = this._filteredBody(expressionKey, expressionOperator, expressionValue);
5253
if (filtered) {
5354
this.data = filtered;
@@ -58,7 +59,14 @@ export class SelectQL implements ISelector {
5859
}
5960
}
6061

61-
_filteredBody(expressionKey: any, expressionOperator: Operators, expressionValue: any): this {
62+
/**
63+
* private member to be used in WHERE and AND methods
64+
* @param expressionKey
65+
* @param expressionOperator
66+
* @param expressionValue
67+
* @returns filtered object of array
68+
*/
69+
private _filteredBody(expressionKey: any, expressionOperator: Operators, expressionValue: any): this {
6270
let returned = this.data;
6371

6472
// checks if any of the where/and clause is key/operator or value is empty
@@ -98,7 +106,7 @@ export class SelectQL implements ISelector {
98106
return this;
99107
}
100108

101-
109+
102110

103111
/**
104112
* Creates an array of unique values, taking an iteratee to compute uniqueness with the provided key

0 commit comments

Comments
 (0)