Skip to content

Commit c1fcd1f

Browse files
committed
Updating readme
1 parent 2f0518d commit c1fcd1f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

API.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ const sql = '(name = "Shaun Persad" AND age >= 27';
165165
```
166166

167167

168+
168169
#### #parse(sql:String, evaluator:Function):*
169170

170171
Uses the supplied `evaluator(operatorValue:String|Symbol, operands:Array)` function to convert an operator and its operands into its evaluation. The default evaluator actually does no "evaluation" in the mathematical sense. Instead it creates an object whose key is the operator, and the value is an array of the operands.
@@ -209,6 +210,7 @@ equals(parsed, [
209210
```
210211

211212

213+
212214
#### #toArray(sql:String):Array
213215

214216
Parses the SQL string into a nested array, where each expression is its own array.
@@ -234,6 +236,7 @@ equals(sqlArray, [
234236
```
235237

236238

239+
237240
#### #operatorPrecedenceFromValues(operatorValue1:String|Symbol, operatorValue2:String|Symbol):Boolean
238241

239242
Determines if operator 2 is of a higher precedence than operator 1.
@@ -255,6 +258,7 @@ parser.operatorPrecedenceFromValues(SqlWhereParser.OPERATOR_UNARY_MINUS, '-').sh
255258
```
256259

257260

261+
258262
#### #getOperator(operatorValue:String|Symbol):Operator
259263

260264
Returns the corresponding instance of the Operator class.
@@ -280,6 +284,7 @@ unaryMinus.should.have.property('type', 1); // its unary
280284
```
281285

282286

287+
283288
#### #defaultEvaluator(operatorValue:String|Symbol, operands:Array)
284289

285290
Converts the operator and its operands into an object whose key is the operator value, and the value is the array of operands.
@@ -319,6 +324,7 @@ equals(evaluation, {
319324
```
320325

321326

327+
322328
#### #tokenizer:TokenizeThis
323329

324330
The tokenizer used on the string. See documentation [here](https://github.com/shaunpersad/tokenize-this).
@@ -329,6 +335,7 @@ parser.tokenizer.should.be.instanceOf(TokenizeThis);
329335
```
330336

331337

338+
332339
#### #operators:Object
333340

334341
An object whose keys are the supported operator values, and whose values are instances of the Operator class.
@@ -342,6 +349,7 @@ operators.forEach((operator) => {
342349
```
343350

344351

352+
345353
#### .defaultConfig:Object
346354

347355
The default config object used when no config is supplied. For the tokenizer config options, see [here](https://github.com/shaunpersad/tokenize-this#defaultconfigobject).
@@ -407,6 +415,7 @@ equals(SqlWhereParser.defaultConfig, {
407415
```
408416

409417

418+
410419
#### .Operator:Operator
411420

412421
The Operator class.
@@ -417,6 +426,7 @@ parser.operators['AND'].should.be.instanceOf(SqlWhereParser.Operator);
417426
```
418427

419428

429+
420430
#### .OPERATOR_UNARY_MINUS:Symbol
421431

422432
The Symbol used as the unary minus operator value.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,5 @@ equals(parsed, {
195195
});
196196
```
197197

198+
## API
198199
For the full API documentation and more examples, see [here](https://github.com/shaunpersad/sql-where-parser/blob/master/API.md).

0 commit comments

Comments
 (0)