New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@db-auto/tables

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@db-auto/tables - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

13

dist/src/query.js

@@ -22,2 +22,4 @@ "use strict";

let table = tables[path[0]];
if (table === undefined)
return [`Cannot find table ${path[0]} in tables. Available tables are: ${Object.keys(tables).sort()}`];
let alias = `T${0}`;

@@ -29,6 +31,6 @@ const where = [...(0, utils_1.safeArray)(wheres), ...makeWhere(id, params, alias, table)];

exports.buildPlan = buildPlan;
function findLink(table, linkName) {
function findLink(pathSoFar, table, linkName) {
const link = table.links[linkName];
if (link === undefined)
return [`Cannot find link ${linkName} in table ${table.table}. Available links are: ${Object.keys(table.links)}`];
return [`Cannot find link ${linkName} in table ${table.table} for path [${pathSoFar}]. Available links are: ${Object.keys(table.links).sort()}`];
return link;

@@ -40,3 +42,4 @@ }

const p = path[index];
const linkOrErrors = findLink(previousPlan.table, p);
const pathSoFar = path.slice(0, index).join('.');
const linkOrErrors = findLink(pathSoFar, previousPlan.table, p);
if ((0, utils_1.hasErrors)(linkOrErrors))

@@ -46,8 +49,8 @@ return linkOrErrors;

const table = tables[link.table];
if (table === undefined)
return [`Cannot find table ${p} in tables. Path is ${pathSoFar}. Available tables are: ${Object.keys(tables)}`];
let alias = `T${index}`;
const where = makeWhere(undefined, params, alias, table);
if (table === undefined)
return [`Cannot find table ${p} in tables. Path is ${path.slice(0, index)}. Available tables are: ${Object.keys(tables)}`];
const plan = { table, alias, linkToPrevious: { link, linkTo: previousPlan }, where };
return buildNextStep(tables, path, params, plan, index + 1);
}
{
"name": "@db-auto/tables",
"description": "",
"version": "0.0.15",
"version": "0.0.16",
"main": "dist/index",

@@ -20,3 +20,3 @@ "types": "dist/index",

"dependencies": {
"@db-auto/utils": "0.0.15"
"@db-auto/utils": "0.0.16"
},

@@ -23,0 +23,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