Socket
Socket
Sign inDemoInstall

ormius

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ormius - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

27

lib/query.js

@@ -65,4 +65,27 @@ const { TYPES, RELATION_TYPES } = require('./types')

updateBy(conditions, values) {
this.currentQuery = 'UPDATE ?? SET ? WHERE ?'
this.conditions = [this.modelName, values, conditions]
this.currentQuery = 'UPDATE ?? SET '
this.conditions = [this.modelName]
Object.keys(values).reduce((currentQuery, valueKey) => {
if ([TYPES.BOOLEAN, TYPES.INT, TYPES.STRING].includes(this.model[valueKey].type)) {
if (currentQuery !== '') {
this.currentQuery += ', '
}
currentQuery += `${valueKey} = '${values[valueKey]}'`
this.currentQuery += `${valueKey} = ?`
this.conditions.push(values[valueKey])
}
return currentQuery
}, '')
this.currentQuery += ' WHERE '
Object.keys(conditions).reduce((currentQuery, condition) => {
if ([TYPES.BOOLEAN, TYPES.INT, TYPES.STRING].includes(this.model[condition].type)) {
if (currentQuery !== '') {
this.currentQuery += ', '
}
currentQuery += `${condition} = '${conditions[condition]}'`
this.currentQuery += `${condition} = ?`
this.conditions.push(conditions[condition])
}
return currentQuery
}, '')
return this

@@ -69,0 +92,0 @@ }

2

package.json
{
"name": "ormius",
"version": "0.0.8",
"version": "0.0.9",
"main": "index.js",

@@ -5,0 +5,0 @@ "author": "Adele Bendayan",

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

![Statements](https://img.shields.io/badge/statements-43.13%25-red.svg?style=flat)
![Branches](https://img.shields.io/badge/branches-38.77%25-red.svg?style=flat)
![Functions](https://img.shields.io/badge/functions-55%25-red.svg?style=flat)
![Lines](https://img.shields.io/badge/lines-43.04%25-red.svg?style=flat)
![Statements](https://img.shields.io/badge/statements-80.58%25-yellow.svg?style=flat)
![Branches](https://img.shields.io/badge/branches-71.92%25-red.svg?style=flat)
![Functions](https://img.shields.io/badge/functions-78.57%25-red.svg?style=flat)
![Lines](https://img.shields.io/badge/lines-80.95%25-yellow.svg?style=flat)
# Ormius

@@ -6,0 +6,0 @@ Simple Orm for mysql

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