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

@synatic/noql

Package Overview
Dependencies
Maintainers
0
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synatic/noql - npm Package Compare versions

Comparing version 4.1.11 to 4.1.12

35

lib/make/optimize-join-and-where.js

@@ -423,2 +423,12 @@ const {snakeCase} = require('lodash');

const field = Object.keys(d)[0];
if (field === '$expr') {
const res = mapMatchesToExpressionFormat(d, sourceName);
findLetValuesAndModifyExpression(
res,
sourceName,
lookup.$lookup.let
);
return res;
}
const letVar = snakeCase(field);

@@ -662,3 +672,3 @@ const explicitKey = `$${letVar}`;

*
* @param expression
* @param {Record<string,unknown>} expression
* @param {string} mustContain

@@ -709,2 +719,25 @@ * @param {string} mustNotContain

*
* @param {Record<string,unknown>} expression
* @param {string} sourceName
* @param {Record<string,unknown>} letObj
*/
function findLetValuesAndModifyExpression(expression, sourceName, letObj) {
const key = Object.keys(expression)[0];
const values = Object.values(expression)[0];
if ($check.array(values)) {
values.forEach((value) => {
if ($check.object(value)) {
findLetValuesAndModifyExpression(value, sourceName, letObj);
}
});
return;
}
if ($check.string(values) && values.startsWith(`$${sourceName}`)) {
const letVar = snakeCase(values);
letObj[letVar] = values;
expression[key] = letVar;
}
}
/**
*
* @param match

@@ -711,0 +744,0 @@ * @param {string} sourceName

2

package.json
{
"name": "@synatic/noql",
"version": "4.1.11",
"version": "4.1.12",
"description": "Convert SQL statements to mongo queries or aggregates",

@@ -5,0 +5,0 @@ "main": "index.js",

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