@dbpath/parser
Advanced tools
Comparing version 0.3.12 to 0.3.13
@@ -10,3 +10,3 @@ import { Token } from "./tokeniser"; | ||
context: C; | ||
error?: string[]; | ||
errors?: string[]; | ||
} | ||
@@ -13,0 +13,0 @@ export declare const identifier: (type: string) => <C extends ParserContext>(context: C) => ResultAndContext<C, string>; |
@@ -9,3 +9,3 @@ "use strict"; | ||
if (token === undefined) | ||
return { context, error: [`Expected a ${type} but got to end`] }; | ||
return { context, errors: [`Expected a ${type} but got to end`] }; | ||
if (token.type === 'string') { | ||
@@ -15,3 +15,3 @@ return { result: token.value, context: Object.assign(Object.assign({}, context), { pos }) }; | ||
else { | ||
return { context, error: [`Expected a ${type} ${gotForError(context)}`] }; | ||
return { context, errors: [`Expected a ${type} ${gotForError(context)}`] }; | ||
} | ||
@@ -21,3 +21,3 @@ }; | ||
const mapParser = (c, f) => { | ||
if (c.error) | ||
if (c.errors) | ||
return c; | ||
@@ -37,3 +37,3 @@ let result = f(c.context, c.result); | ||
function liftError(context, error) { | ||
return { context, error }; | ||
return { context, errors: error }; | ||
} | ||
@@ -40,0 +40,0 @@ exports.liftError = liftError; |
{ | ||
"name": "@dbpath/parser", | ||
"description": "", | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"main": "dist/index", | ||
@@ -6,0 +6,0 @@ "types": "dist/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14596