@dbpath/pathparser
Advanced tools
Comparing version 0.2.1 to 0.2.2
import { Token } from "./tokeniser"; | ||
import { ErrorsAnd } from "@dbpath/utils"; | ||
import { PathValidator, TwoIds } from "@dbpath/dal"; | ||
export interface RawTableResult { | ||
import { LinkInPath, PathItem, TableInPath } from "./path"; | ||
export interface TableAndFullTableName { | ||
table: string; | ||
fullTable?: string; | ||
fields?: string[]; | ||
} | ||
export interface RawLinkWithoutIdEqualsResult extends RawTableResult { | ||
previousLink?: RawLinkResult; | ||
} | ||
export interface RawLinkResult extends RawLinkWithoutIdEqualsResult { | ||
idEquals: TwoIds[]; | ||
} | ||
export type Result = RawTableResult; | ||
export type Result = TableInPath; | ||
export interface ParserContext { | ||
@@ -27,6 +21,2 @@ tokens: Token[]; | ||
export declare const identifier: (type: string) => (context: ParserContext) => ResultAndContext<string>; | ||
export interface TableAndFullTableName { | ||
table: string; | ||
fullTable?: string; | ||
} | ||
export declare function gotForError(c: ParserContext): string; | ||
@@ -38,7 +28,7 @@ export declare function parseCommaSeparated<R>(c: ParserContext, comma: string, parser: PathParser<R>): ResultAndContext<R[]>; | ||
export declare function parseTableName(context: ParserContext): ResultAndContext<TableAndFullTableName>; | ||
export declare const parseTable: (context: ParserContext) => ResultAndContext<RawTableResult>; | ||
export declare const parseTableAndNextLink: (previousTable: RawTableResult | undefined, idEquals: TwoIds[]) => PathParser<RawLinkWithoutIdEqualsResult>; | ||
export declare const parseLink: (previousTable: RawTableResult | undefined) => PathParser<RawLinkResult>; | ||
export declare const parseTableAndLinks: PathParser<RawLinkResult | RawTableResult>; | ||
export declare const parsePath: (validator: PathValidator) => (s: string) => ErrorsAnd<RawLinkResult | RawTableResult>; | ||
export declare const parseTable: (context: ParserContext) => ResultAndContext<TableInPath>; | ||
export declare const parseTableAndNextLink: (previousTable: TableInPath | undefined, idEquals: TwoIds[]) => PathParser<LinkInPath>; | ||
export declare const parseLink: (previousTable: TableInPath | undefined) => PathParser<LinkInPath>; | ||
export declare const parseTableAndLinks: PathParser<PathItem>; | ||
export declare const parsePath: (validator: PathValidator) => (s: string) => ErrorsAnd<LinkInPath | TableInPath>; | ||
export declare function errorData<R>(pr: ResultAndContext<R>, s: string): { | ||
@@ -45,0 +35,0 @@ error: string[]; |
@@ -5,4 +5,2 @@ "use strict"; | ||
const tokeniser_1 = require("./tokeniser"); | ||
; | ||
; | ||
const identifier = (type) => (context) => { | ||
@@ -112,4 +110,6 @@ var pos = context.pos; | ||
const parseTableAndLinks = c => mapParser((0, exports.parseTable)(c), (c, previousLink) => { | ||
if (isNextChar(c, '.')) | ||
return (0, exports.parseLink)(previousLink)(c); | ||
if (isNextChar(c, '.')) { | ||
const linkInPathResultAndContext = (0, exports.parseLink)(previousLink)(c); | ||
return linkInPathResultAndContext; | ||
} | ||
else | ||
@@ -116,0 +116,0 @@ return lift(c, previousLink); |
@@ -225,2 +225,6 @@ "use strict"; | ||
return []; | ||
}, | ||
useIdsOrSingleFkLinkOrError: (fromTableName, toTableName, idEquals) => { | ||
remembered.push(`useIdsOrSingleFkLinkOrError(${fromTableName},${toTableName}) ${idEquals}`); | ||
return idEquals; | ||
} | ||
@@ -227,0 +231,0 @@ }; |
{ | ||
"name": "@dbpath/pathparser", | ||
"description": "", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "dist/index", | ||
@@ -20,4 +20,4 @@ "types": "dist/index", | ||
"dependencies": { | ||
"@dbpath/dal": "0.2.1", | ||
"@dbpath/utils": "0.2.1" | ||
"@dbpath/types": "0.2.2", | ||
"@dbpath/utils": "0.2.2" | ||
}, | ||
@@ -24,0 +24,0 @@ "devDependencies": { |
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
28548
15
638
+ Added@dbpath/types@0.2.2
+ Added@dbpath/types@0.2.2(transitive)
+ Added@dbpath/utils@0.2.2(transitive)
- Removed@dbpath/dal@0.2.1
- Removed@dbpath/config@0.2.1(transitive)
- Removed@dbpath/dal@0.2.1(transitive)
- Removed@dbpath/utils@0.2.1(transitive)
Updated@dbpath/utils@0.2.2