@dbpath/pathparser
Advanced tools
Comparing version 0.2.10 to 0.2.11
@@ -83,3 +83,8 @@ "use strict"; | ||
exports.parseBracketedCommaSeparated = parseBracketedCommaSeparated; | ||
const parseIdEqualsId = (c) => mapParser((0, exports.identifier)("'from id'='to id'")(c), (c, fromId) => mapParser(nextChar(c, '='), c => mapParser((0, exports.identifier)("'to id'")(c), (c, toId) => lift(c, { fromId, toId })))); | ||
const parseIdEqualsId = (c) => mapParser((0, exports.identifier)("'from id'='to id'")(c), (c, fromId) => { | ||
if (isNextChar(c, '=')) | ||
return mapParser(nextChar(c, '='), c => mapParser((0, exports.identifier)("'to id'")(c), (c, toId) => lift(c, { fromId, toId }))); | ||
else | ||
return lift(c, { fromId, toId: fromId }); | ||
}); | ||
exports.parseIdEqualsId = parseIdEqualsId; | ||
@@ -86,0 +91,0 @@ function parseTableName(context) { |
@@ -75,2 +75,19 @@ "use strict"; | ||
}); | ||
it("should handle just an id in the id=id part", () => { | ||
expect(pl(".driver.(driver)mission", 7)).toEqual({ | ||
"fields": [], | ||
"idEquals": [ | ||
{ | ||
"fromId": "driver", | ||
"toId": "driver" | ||
} | ||
], | ||
"previousLink": { | ||
"fields": [], | ||
"idEquals": [], | ||
"table": "drivertable" | ||
}, | ||
"table": "mission" | ||
}); | ||
}); | ||
it("should parse .(id1=id2)drive", () => { | ||
@@ -168,7 +185,8 @@ expect(pl(".(id1=id2)driver", 7)).toEqual({ | ||
it("should process a.(noequals)b", () => { | ||
expect((0, parser_1.parsePath)(validator)("a.(noequals)b")).toEqual([ | ||
"a.(noequals)b", | ||
" ^", | ||
"Expected = unexpected character )" | ||
]); | ||
expect((0, parser_1.parsePath)(validator)("a.(noequals)b")).toEqual({ | ||
"fields": [], | ||
"idEquals": [{ "fromId": "noequals", "toId": "noequals" }], | ||
"previousLink": { "fields": [], "table": "a" }, | ||
"table": "b" | ||
}); | ||
}); | ||
@@ -175,0 +193,0 @@ }); |
{ | ||
"name": "@dbpath/pathparser", | ||
"description": "", | ||
"version": "0.2.10", | ||
"version": "0.2.11", | ||
"main": "dist/index", | ||
@@ -20,5 +20,5 @@ "types": "dist/index", | ||
"dependencies": { | ||
"@dbpath/types": "0.2.10", | ||
"@dbpath/utils": "0.2.10", | ||
"@dbpath/fixtures": "0.2.10" | ||
"@dbpath/types": "0.2.11", | ||
"@dbpath/utils": "0.2.11", | ||
"@dbpath/fixtures": "0.2.11" | ||
}, | ||
@@ -25,0 +25,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
28665
635
+ Added@dbpath/fixtures@0.2.11(transitive)
+ Added@dbpath/types@0.2.11(transitive)
+ Added@dbpath/utils@0.2.11(transitive)
- Removed@dbpath/fixtures@0.2.10(transitive)
- Removed@dbpath/types@0.2.10(transitive)
- Removed@dbpath/utils@0.2.10(transitive)
Updated@dbpath/fixtures@0.2.11
Updated@dbpath/types@0.2.11
Updated@dbpath/utils@0.2.11