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

h-orm

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

h-orm - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

8

lib/model/index.js

@@ -38,3 +38,9 @@ const mysql = require('../mysql')

} else {
conditions.push(`${key} in ( ${mysql.escape(this.conditions['select'][key]) } )`)
if (/_not_like$/.test(key)) {
conditions.push(`${key.split('_not_like')[0]} not like ${mysql.escape(this.conditions['select'][key])}`)
} else if (/_like$/.test(key)) {
conditions.push(`${key.split('_like')[0]} like ${mysql.escape(this.conditions['select'][key])}`)
} else {
conditions.push(`${key} in ( ${mysql.escape(this.conditions['select'][key]) } )`)
}
}

@@ -41,0 +47,0 @@ }

2

package.json
{
"name": "h-orm",
"version": "0.0.9",
"version": "0.0.10",
"main": "index.js",

@@ -5,0 +5,0 @@ "repository": "https://github.com/yuanhaoyu/h-orm.git",

@@ -37,2 +37,3 @@ const horm = require('../../index')

});
test('where {sex: 0}', async () => {

@@ -43,2 +44,3 @@ expect(await StudentModel().where({ sex: 0 })).toEqual([

})
test('where {sex: 0}', async () => {

@@ -51,2 +53,15 @@ expect(await StudentModel().where({ sex: ['0', '1'] })).toEqual([

})
test('where {sex: 0} and name like ad', async () => {
expect(await StudentModel().where({ sex: 1, name_like: '%ad%' })).toEqual([
{ name: 'adad', sex: 1 },
])
})
test('where {sex: 0} and name not like ad', async () => {
expect(await StudentModel().where({ sex: 1, name_not_like: '%ad%' })).toEqual([
{ name: 'man', sex: 1 },
])
})
test('where {sex: 0} or {sex: 1}', async () => {

@@ -58,4 +73,5 @@ expect(await StudentModel().where({ sex: 0, name: 'man' }, 'OR')).toEqual([

})
test('close mysql here', () => {
mysql.close()
})
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