@@ -92,7 +92,7 @@ export const parse = awaitInit(async (query: string): Promise<ParseResult> => {
9292 resultPtr = wasmModule . _wasm_parse_query ( queryPtr ) ;
9393 const resultStr = ptrToString ( resultPtr ) ;
9494
95- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
95+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
9696 throw new Error ( resultStr ) ;
9797 }
9898
@@ -121,7 +121,7 @@ export const deparse = awaitInit(async (parseTree: ParseResult): Promise<string>
121121 resultPtr = wasmModule . _wasm_deparse_protobuf ( dataPtr , data . length ) ;
122122 const resultStr = ptrToString ( resultPtr ) ;
123123
124- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
124+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
125125 throw new Error ( resultStr ) ;
126126 }
127127
@@ -142,7 +142,7 @@ export const parsePlPgSQL = awaitInit(async (query: string): Promise<ParseResult
142142 resultPtr = wasmModule . _wasm_parse_plpgsql ( queryPtr ) ;
143143 const resultStr = ptrToString ( resultPtr ) ;
144144
145- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
145+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
146146 throw new Error ( resultStr ) ;
147147 }
148148
@@ -163,7 +163,7 @@ export const fingerprint = awaitInit(async (query: string): Promise<string> => {
163163 resultPtr = wasmModule . _wasm_fingerprint ( queryPtr ) ;
164164 const resultStr = ptrToString ( resultPtr ) ;
165165
166- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
166+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
167167 throw new Error ( resultStr ) ;
168168 }
169169
@@ -184,7 +184,7 @@ export const normalize = awaitInit(async (query: string): Promise<string> => {
184184 resultPtr = wasmModule . _wasm_normalize_query ( queryPtr ) ;
185185 const resultStr = ptrToString ( resultPtr ) ;
186186
187- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
187+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
188188 throw new Error ( resultStr ) ;
189189 }
190190
@@ -209,7 +209,7 @@ export function parseSync(query: string): ParseResult {
209209 resultPtr = wasmModule . _wasm_parse_query ( queryPtr ) ;
210210 const resultStr = ptrToString ( resultPtr ) ;
211211
212- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
212+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
213213 throw new Error ( resultStr ) ;
214214 }
215215
@@ -241,7 +241,7 @@ export function deparseSync(parseTree: ParseResult): string {
241241 resultPtr = wasmModule . _wasm_deparse_protobuf ( dataPtr , data . length ) ;
242242 const resultStr = ptrToString ( resultPtr ) ;
243243
244- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
244+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
245245 throw new Error ( resultStr ) ;
246246 }
247247
@@ -265,7 +265,7 @@ export function parsePlPgSQLSync(query: string): ParseResult {
265265 resultPtr = wasmModule . _wasm_parse_plpgsql ( queryPtr ) ;
266266 const resultStr = ptrToString ( resultPtr ) ;
267267
268- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
268+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
269269 throw new Error ( resultStr ) ;
270270 }
271271
@@ -289,7 +289,7 @@ export function fingerprintSync(query: string): string {
289289 resultPtr = wasmModule . _wasm_fingerprint ( queryPtr ) ;
290290 const resultStr = ptrToString ( resultPtr ) ;
291291
292- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
292+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
293293 throw new Error ( resultStr ) ;
294294 }
295295
@@ -313,7 +313,7 @@ export function normalizeSync(query: string): string {
313313 resultPtr = wasmModule . _wasm_normalize_query ( queryPtr ) ;
314314 const resultStr = ptrToString ( resultPtr ) ;
315315
316- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
316+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
317317 throw new Error ( resultStr ) ;
318318 }
319319
@@ -334,7 +334,7 @@ export const scan = awaitInit(async (query: string): Promise<ScanResult> => {
334334 resultPtr = wasmModule . _wasm_scan ( queryPtr ) ;
335335 const resultStr = ptrToString ( resultPtr ) ;
336336
337- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
337+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
338338 throw new Error ( resultStr ) ;
339339 }
340340
@@ -358,7 +358,7 @@ export function scanSync(query: string): ScanResult {
358358 resultPtr = wasmModule . _wasm_scan ( queryPtr ) ;
359359 const resultStr = ptrToString ( resultPtr ) ;
360360
361- if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . includes ( 'ERROR' ) ) {
361+ if ( resultStr . startsWith ( 'syntax error' ) || resultStr . startsWith ( 'deparse error' ) || resultStr . startsWith ( 'ERROR' ) ) {
362362 throw new Error ( resultStr ) ;
363363 }
364364
0 commit comments