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

mythix-orm

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mythix-orm - npm Package Compare versions

Comparing version 1.11.0 to 1.11.1

68

lib/query-engine/model-scope.js

@@ -53,10 +53,74 @@ 'use strict';

function wrapOrderClause(func) {
func.DESC = (...args) => {
const applyQueryOrder = (_order, replace) => {
let query = this;
let order = Nife.toArray(_order).filter(Boolean);
let asc = order.filter((thisOrder) => {
if (!Nife.instanceOf(thisOrder, 'string'))
return true;
if (thisOrder.charAt(0) === '-')
return false;
return true;
});
let desc = order.filter((thisOrder) => {
if (!Nife.instanceOf(thisOrder, 'string'))
return false;
if (thisOrder.charAt(0) !== '-')
return false;
return true;
});
if (Nife.isNotEmpty(asc)) {
asc = asc.map((thisOrder) => {
if (!Nife.instanceOf(thisOrder, 'string'))
return thisOrder;
return thisOrder.replace(/^\+/, '');
});
// eslint-disable-next-line new-cap
query = (replace) ? ASC(asc) : ASC('+', asc);
}
if (Nife.isNotEmpty(desc)) {
desc = desc.map((thisOrder) => {
if (!Nife.instanceOf(thisOrder, 'string'))
return thisOrder;
return thisOrder.replace(/^-/, '');
});
// eslint-disable-next-line new-cap
query = (replace) ? DESC(desc) : DESC('+', desc);
}
return query;
};
const DESC = (...args) => {
return applyOrderClause.call(this, { direction: '-' }, ...args);
};
func.ASC = (...args) => {
const ASC = (...args) => {
return applyOrderClause.call(this, { direction: '+' }, ...args);
};
const ADD = (...args) => {
return applyQueryOrder(args, false);
};
const REPLACE = (...args) => {
return applyQueryOrder(args, true);
};
func.DESC = DESC;
func.ASC = ASC;
func.ADD = ADD;
func.REPLACE = REPLACE;
return func;

@@ -63,0 +127,0 @@ }

@@ -82,3 +82,2 @@ import ConnectionBase from '../connection/connection-base';

public OFFSET(value: number): QueryEngine;
public ORDER(...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>): QueryEngine;
public GROUP_BY(...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>): QueryEngine;

@@ -89,2 +88,13 @@ public HAVING(query: QueryEngine): QueryEngine;

declare public ORDER: {
(...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>): QueryEngine;
ASC: (...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>) => QueryEngine;
DESC: (...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>) => QueryEngine;
ADD: (...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>) => QueryEngine;
REPLACE: (...args: Array<LiteralBase | Field | string | Array<LiteralBase | Field | string>>) => QueryEngine;
name: QueryEngine;
};
declare public NOT: {

@@ -91,0 +101,0 @@ (): QueryEngine;

2

package.json
{
"name": "mythix-orm",
"version": "1.11.0",
"version": "1.11.1",
"description": "ORM for Mythix framework",

@@ -5,0 +5,0 @@ "main": "lib/index",

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