Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dbpath/pathparser

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbpath/pathparser - npm Package Compare versions

Comparing version 0.2.10 to 0.2.11

7

dist/src/parser.js

@@ -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 @@ });

8

package.json
{
"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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc