@knorm/knorm
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -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) |
@@ -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) |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
421449
59
9538
51
1