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

@janiscommerce/model-controller

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@janiscommerce/model-controller - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

5

CHANGELOG.md

@@ -7,2 +7,7 @@ # Changelog

## [1.4.0] - 2019-06-24
### Added
- `Controller` - insert, save, update methods
- `Model` - insert, save, update methods
## [1.3.0] - 2019-06-21

@@ -9,0 +14,0 @@ ### Added

@@ -97,4 +97,60 @@ 'use strict';

}
async getTotals() {
return this
.getModel()
.getTotals();
}
async insert(item) {
return this
.getModel()
.insert(item);
}
async save(item) {
return this
.getModel()
.save(item);
}
async update(values, filter) {
return this
.getModel()
.update(values, filter);
}
async remove(item) {
return this
.getModel()
.remove(item);
}
async multiInsert(items) {
return this
.getModel()
.multiInsert(items);
}
async multiSave(items) {
return this
.getModel()
.multiSave(items);
}
async multiRemove(filter) {
return this
.getModel()
.multiRemove(filter);
}
}
module.exports = Controller;

34

lib/model/index.js

@@ -43,7 +43,39 @@ 'use strict';

async get(params = {}) {
return this.db.get(params);
return this.db.get(this, params);
}
async getTotals() {
return this.db.getTotals(this);
}
async insert(item) {
return this.db.insert(this, item);
}
async save(item) {
return this.db.save(this, item);
}
async update(values, filter) {
return this.db.update(this, values, filter);
}
async remove(item) {
return this.db.remove(this, item);
}
async multiInsert(items) {
return this.db.multiInsert(this, items);
}
async multiSave(items) {
return this.db.multiSave(this, items);
}
async multiRemove(filter) {
return this.db.multiRemove(this, filter);
}
}
module.exports = Model;

4

package.json
{
"name": "@janiscommerce/model-controller",
"version": "1.3.0",
"version": "1.4.0",
"description": "The `model-controller` module allows you to get a controller/model class or instance easily",

@@ -8,3 +8,3 @@ "main": "index.js",

"test": "export TEST_ENV=true; mocha --exit -R nyan --recursive tests/",
"watch-test": "export TEST_ENV=true; mocha --exit -R nyan -w --recursive",
"watch-test": "export TEST_ENV=true; mocha --exit -R nyan -w --recursive tests/",
"test-ci": "nyc --reporter=html --reporter=text mocha --recursive tests/",

@@ -11,0 +11,0 @@ "coverage": "nyc npm test",

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