Add in erro handeling forback end

This commit is contained in:
jmosrael@gmail.com
2024-05-26 19:28:01 -07:00
parent e62825a114
commit 5890041501
4 changed files with 185 additions and 97 deletions

View File

@@ -1,6 +1,8 @@
import Tokenizr from 'tokenizr'
import { Op } from 'sequelize'
export { ParsingError } from 'tokenizr'
export class OrderByParser {
lexer = new Tokenizr()
@@ -50,8 +52,8 @@ export class OrderByParser {
const openGroupRegex = /\(/
const closeGroupRegex = /\)/
const conjunctinoRegex = /AND|OR/
const equalityRegex = /([a-zA-Z]+)\s?(=|!=|<|>|<=|>=|:)\s?([a-zA-Z\d]+)/
const stringEqualityRegex = /([a-zA-Z]+)\s?(=|!=|<|>|<=|>=|:)\s?\"([a-zA-Z\d\s]*)\"/
const equalityRegex = /([a-zA-Z]+)\s?(=|!=|<|>|<=|>=|:)\s?([a-zA-Z'"\d]+)/
const stringEqualityRegex = /([a-zA-Z]+)\s?(=|!=|<|>|<=|>=|:)\s?\"([a-zA-Z'"\d\s]*)\"/
const spacerRegex = /\s/
const opperatorMap = {