@knorm/knorm
Advanced tools
Comparing version 1.4.2 to 1.5.0
@@ -0,1 +1,13 @@ | ||
<a name="1.5.0"></a> | ||
# [1.5.0](https://github.com/knorm/knorm/compare/v1.4.1...v1.5.0) (2018-08-19) | ||
### Features | ||
* **Query:** add `hasOption` and `unsetOption` ([17ad152](https://github.com/knorm/knorm/commit/17ad152)) | ||
* **Query:** add `Query.prototype.clone` ([2315c45](https://github.com/knorm/knorm/commit/2315c45)) | ||
* **Query:** add `unsetOptions` and `getOption` ([d896aec](https://github.com/knorm/knorm/commit/d896aec)) | ||
<a name="1.4.2"></a> | ||
@@ -2,0 +14,0 @@ ## [1.4.2](https://github.com/knorm/knorm/compare/v1.4.1...v1.4.2) (2018-08-16) |
@@ -52,7 +52,12 @@ const { difference } = require('lodash'); | ||
// TODO: add Query.prototype.reset | ||
// TODO: add Query.prototype.clone | ||
// TODO: add Query.prototype.schema: set schema | ||
// TODO: add Query.prototype.alias: set alias - would be used by @knorm/relations | ||
// depended on by knorm-postgres | ||
clone() { | ||
const clone = new this.constructor(this.model); | ||
clone.config = Object.assign(clone.config, this.config); | ||
clone.options = Object.assign(clone.options, this.options); | ||
return clone; | ||
} | ||
setOption(option, value) { | ||
@@ -82,2 +87,24 @@ this.options[option] = value; | ||
unsetOption(option) { | ||
this.options[option] = undefined; | ||
return this; | ||
} | ||
unsetOptions(options) { | ||
options.forEach(option => { | ||
this.options[option] = undefined; | ||
}); | ||
return this; | ||
} | ||
getOption(option) { | ||
return this.options[option]; | ||
} | ||
hasOption(option) { | ||
return this.options[option] !== undefined; | ||
} | ||
debug(debug = true) { | ||
@@ -84,0 +111,0 @@ return this.setOption('debug', !!debug); |
{ | ||
"name": "@knorm/knorm", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"description": "A purely ES6 class-based ORM for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
436091
9917