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

@knorm/knorm

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knorm/knorm - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

docs/assets/favicon.ico

21

CHANGELOG.md

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

<a name="1.2.1"></a>
## [1.2.1](https://github.com/knorm/knorm/compare/v1.2.0...v1.2.1) (2018-08-07)
### Bug Fixes
* **Field:** handle `undefined` in array json schemas ([bd0367f](https://github.com/knorm/knorm/commit/bd0367f))
<a name="1.2.0"></a>
# [1.2.0](https://github.com/knorm/knorm/compare/v1.1.0...v1.2.0) (2018-07-30)
### Features
* **Model:** allow setting query and plugin options ([83f8dba](https://github.com/knorm/knorm/commit/83f8dba))
* **Model:** set default query options ([37dffbe](https://github.com/knorm/knorm/commit/37dffbe))
<a name="1.1.0"></a>

@@ -2,0 +23,0 @@ # [1.1.0](https://github.com/knorm/knorm/compare/v1.0.1...v1.1.0) (2018-07-26)

1

docs/sidebar.md

@@ -22,2 +22,3 @@ * Guides

* [@knorm/postgres](knorm-postgres.md)
* [@knorm/to-json](knorm-to-json.md)
* [@knorm/relations](knorm-relations.md)

@@ -24,0 +25,0 @@ * [@knorm/soft-delete](knorm-soft-delete.md)

10

lib/Field.js

@@ -430,5 +430,9 @@ const { isUUID, isDecimal, isEmail } = require('validator');

if (this.type === 'array') {
if (schema.validators.required && !value.length) {
schema.valueIndex = undefined;
schema.throwValidationError(value, { required: true });
if (!value || !value.length) {
if (schema.validators.required) {
schema.valueIndex = undefined;
schema.throwValidationError(value, { required: true });
} else {
return true;
}
}

@@ -435,0 +439,0 @@ return Promise.all(

@@ -475,4 +475,3 @@ const { upperFirst, merge } = require('lodash');

// TODO: remove `if (this.knorm)` (only there till tests are updated)
if (this.knorm && !this.knorm.models[this.name]) {
if (!this.knorm.models[this.name]) {
this.knorm.addModel(this);

@@ -479,0 +478,0 @@ }

@@ -52,3 +52,3 @@ const { difference } = require('lodash');

// TODO: add Query.prototype.clone
// TODO: add Query.prototype.alias: allow setting custom aliases for queries
// TODO: add Query.prototype.alias: set alias - would be used by @knorm/relations

@@ -204,2 +204,3 @@ // depended on by knorm-postgres

// TODO: Query.prototype.formatColumn - needed by @knorm/relations
return `${this.quote(this.config.alias)}.${this.quote(column)}`;

@@ -206,0 +207,0 @@ }

{
"name": "@knorm/knorm",
"version": "1.2.0",
"version": "1.2.1",
"description": "A purely ES6 class-based ORM for Node.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -49,1 +49,3 @@ # @knorm/knorm

but it now generates it's own queries via [SQL Bricks.js](http://csnw.github.io/sql-bricks/).
Thank you [Ramsés Cabello](https://twitter.com/ramsescabello) for making the logo.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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