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

@dbnx/mysql

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dbnx/mysql - npm Package Compare versions

Comparing version 1.0.23 to 1.0.24

2

dist/utilities/condition.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.dbnxCondition=dbnxCondition;const sanitize_1=require("./sanitize");function handlePattern(i,n){return"REGEXP"===n?i.replace(/%/g,".*").replace(/_/g,".").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"):i}function dbnxCondition(i,n="AND"){var e,l,t,o,s,d,u,a,r,v,$,z,p;let h=[];for(const n in i){const g=i[n];if("$and"==n)h.push(`(${dbnxCondition(g,"AND")})`);else if("$or"==n)h.push(`(${dbnxCondition(g,"OR")})`);else if("object"==typeof g)if(Array.isArray(g))h.push(`\`${n}\` IN ${(0,sanitize_1.sanitize)(g)}`);else{if(Array.isArray(null==g?void 0:g.notIn)&&(null===(e=null==g?void 0:g.notIn)||void 0===e?void 0:e.length)&&h.push(`\`${n}\` NOT IN ${(0,sanitize_1.sanitize)(null==g?void 0:g.notIn)}`),Array.isArray(null==g?void 0:g.in)&&(null===(l=null==g?void 0:g.in)||void 0===l?void 0:l.length)&&h.push(`\`${n}\` NOT IN ${(0,sanitize_1.sanitize)(null==g?void 0:g.in)}`),Array.isArray(null==g?void 0:g.between)&&2==(null===(t=null==g?void 0:g.between)||void 0===t?void 0:t.length)&&h.push(`\`${n}\` BETWEEN ${(0,sanitize_1.sanitize)(null===(o=null==g?void 0:g.between)||void 0===o?void 0:o[0])} AND ${(0,sanitize_1.sanitize)(null===(s=null==g?void 0:g.between)||void 0===s?void 0:s[1])}`),Array.isArray(null==g?void 0:g.notBetween)&&2==(null===(d=null==g?void 0:g.notBetween)||void 0===d?void 0:d.length)&&h.push(`\`${n}\` NOT BETWEEN ${(0,sanitize_1.sanitize)(null===(u=null==g?void 0:g.notBetween)||void 0===u?void 0:u[0])} AND ${(0,sanitize_1.sanitize)(null===(a=null==g?void 0:g.notBetween)||void 0===a?void 0:a[1])}`),Array.isArray(null==g?void 0:g.inRange)&&2==(null===(r=null==g?void 0:g.inRange)||void 0===r?void 0:r.length)&&h.push(`\`${n}\` BETWEEN ${(0,sanitize_1.sanitize)(null===(v=null==g?void 0:g.inRange)||void 0===v?void 0:v[0])} AND ${(0,sanitize_1.sanitize)(null===($=null==g?void 0:g.inRange)||void 0===$?void 0:$[1])}`),Array.isArray(null==g?void 0:g.$or)&&(null===(z=null==g?void 0:g.$or)||void 0===z?void 0:z.length)){const i=g.$or.map((i=>dbnxCondition({[n]:i},"OR")));h.push(`(${i.join(" OR ")})`)}if(Array.isArray(null==g?void 0:g.$and)&&(null===(p=null==g?void 0:g.$and)||void 0===p?void 0:p.length)){const i=g.$and.map((i=>dbnxCondition({[n]:i},"AND")));h.push(`(${i.join(" AND ")})`)}g.like&&"string"==typeof(null==g?void 0:g.like)&&h.push(`\`${n}\` LIKE ${(0,sanitize_1.sanitize)(handlePattern(g.like,"LIKE"))}`),g.notLike&&"string"==typeof(null==g?void 0:g.notLike)&&h.push(`\`${n}\` NOT LIKE ${(0,sanitize_1.sanitize)(handlePattern(g.notLike,"NOT LIKE"))}`),g.regexp&&"string"==typeof(null==g?void 0:g.regexp)&&h.push(`\`${n}\` REGEXP ${(0,sanitize_1.sanitize)(handlePattern(g.regexp,"REGEXP"))}`),g.eq&&h.push(`\`${n}\` = ${(0,sanitize_1.sanitize)(null==g?void 0:g.eq)}`),g.gt&&h.push(`\`${n}\` > ${(0,sanitize_1.sanitize)(null==g?void 0:g.gt)}`),g.lt&&h.push(`\`${n}\` < ${(0,sanitize_1.sanitize)(null==g?void 0:g.lt)}`),g.gte&&h.push(`\`${n}\` >= ${(0,sanitize_1.sanitize)(null==g?void 0:g.gte)}`),g.lte&&h.push(`\`${n}\` <= ${(0,sanitize_1.sanitize)(null==g?void 0:g.lte)}`),g.neq&&h.push(`\`${n}\` != ${(0,sanitize_1.sanitize)(null==g?void 0:g.neq)}`),null!=(null==g?void 0:g.isNull)&&(g.isNull?h.push(`\`${n}\` IS NULL`):h.push(`\`${n}\` IS NOT NULL`))}else"string"==typeof g&&h.push(`\`${n}\` = ${(0,sanitize_1.sanitize)(g)}`)}return(null==h?void 0:h.length)?null==h?void 0:h.join(` ${n||"AND"} `):""}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.dbnxCondition=dbnxCondition;const sanitize_1=require("./sanitize");function handlePattern(i,n){return"REGEXP"===n?`'${i.replace(/%/g,".*").replace(/_/g,".").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}'`:(0,sanitize_1.sanitize)(i)}function dbnxCondition(i,n="AND"){var e,l,t,o,s,d,u,a,r,v,$,p,z;let h=[];for(const n in i){const g=i[n];if("$and"==n)h.push(`(${dbnxCondition(g,"AND")})`);else if("$or"==n)h.push(`(${dbnxCondition(g,"OR")})`);else if("object"==typeof g)if(Array.isArray(g))h.push(`\`${n}\` IN ${(0,sanitize_1.sanitize)(g)}`);else{if(Array.isArray(null==g?void 0:g.notIn)&&(null===(e=null==g?void 0:g.notIn)||void 0===e?void 0:e.length)&&h.push(`\`${n}\` NOT IN ${(0,sanitize_1.sanitize)(null==g?void 0:g.notIn)}`),Array.isArray(null==g?void 0:g.in)&&(null===(l=null==g?void 0:g.in)||void 0===l?void 0:l.length)&&h.push(`\`${n}\` NOT IN ${(0,sanitize_1.sanitize)(null==g?void 0:g.in)}`),Array.isArray(null==g?void 0:g.between)&&2==(null===(t=null==g?void 0:g.between)||void 0===t?void 0:t.length)&&h.push(`\`${n}\` BETWEEN ${(0,sanitize_1.sanitize)(null===(o=null==g?void 0:g.between)||void 0===o?void 0:o[0])} AND ${(0,sanitize_1.sanitize)(null===(s=null==g?void 0:g.between)||void 0===s?void 0:s[1])}`),Array.isArray(null==g?void 0:g.notBetween)&&2==(null===(d=null==g?void 0:g.notBetween)||void 0===d?void 0:d.length)&&h.push(`\`${n}\` NOT BETWEEN ${(0,sanitize_1.sanitize)(null===(u=null==g?void 0:g.notBetween)||void 0===u?void 0:u[0])} AND ${(0,sanitize_1.sanitize)(null===(a=null==g?void 0:g.notBetween)||void 0===a?void 0:a[1])}`),Array.isArray(null==g?void 0:g.inRange)&&2==(null===(r=null==g?void 0:g.inRange)||void 0===r?void 0:r.length)&&h.push(`\`${n}\` BETWEEN ${(0,sanitize_1.sanitize)(null===(v=null==g?void 0:g.inRange)||void 0===v?void 0:v[0])} AND ${(0,sanitize_1.sanitize)(null===($=null==g?void 0:g.inRange)||void 0===$?void 0:$[1])}`),Array.isArray(null==g?void 0:g.$or)&&(null===(p=null==g?void 0:g.$or)||void 0===p?void 0:p.length)){const i=g.$or.map((i=>dbnxCondition({[n]:i},"OR")));h.push(`(${i.join(" OR ")})`)}if(Array.isArray(null==g?void 0:g.$and)&&(null===(z=null==g?void 0:g.$and)||void 0===z?void 0:z.length)){const i=g.$and.map((i=>dbnxCondition({[n]:i},"AND")));h.push(`(${i.join(" AND ")})`)}g.like&&"string"==typeof(null==g?void 0:g.like)&&h.push(`\`${n}\` LIKE ${handlePattern(g.like,"LIKE")}`),g.notLike&&"string"==typeof(null==g?void 0:g.notLike)&&h.push(`\`${n}\` NOT LIKE ${handlePattern(g.notLike,"NOT LIKE")}`),g.regexp&&"string"==typeof(null==g?void 0:g.regexp)&&h.push(`\`${n}\` REGEXP ${handlePattern(g.regexp,"REGEXP")}`),g.eq&&h.push(`\`${n}\` = ${(0,sanitize_1.sanitize)(null==g?void 0:g.eq)}`),g.gt&&h.push(`\`${n}\` > ${(0,sanitize_1.sanitize)(null==g?void 0:g.gt)}`),g.lt&&h.push(`\`${n}\` < ${(0,sanitize_1.sanitize)(null==g?void 0:g.lt)}`),g.gte&&h.push(`\`${n}\` >= ${(0,sanitize_1.sanitize)(null==g?void 0:g.gte)}`),g.lte&&h.push(`\`${n}\` <= ${(0,sanitize_1.sanitize)(null==g?void 0:g.lte)}`),g.neq&&h.push(`\`${n}\` != ${(0,sanitize_1.sanitize)(null==g?void 0:g.neq)}`),null!=(null==g?void 0:g.isNull)&&(g.isNull?h.push(`\`${n}\` IS NULL`):h.push(`\`${n}\` IS NOT NULL`))}else"string"==typeof g&&h.push(`\`${n}\` = ${(0,sanitize_1.sanitize)(g)}`)}return(null==h?void 0:h.length)?null==h?void 0:h.join(` ${n||"AND"} `):""}
{
"name": "@dbnx/mysql",
"version": "1.0.23",
"version": "1.0.24",
"description": "A powerful and enhanced ORM library for MySQL, offering query execution, model creation, and full relational management.",

@@ -5,0 +5,0 @@ "main": "./dist/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