Comparing version 1.2.1 to 1.2.2
@@ -20,2 +20,8 @@ ## [Unreleased] | ||
## [1.2.2] - 2019-03-10 | ||
### Removed | ||
- Schema fields and discriminator keys now allow start wit '\_' | ||
## [1.2.1] - 2019-02-13 | ||
@@ -588,2 +594,4 @@ | ||
[1.2.2]: https://github.com/Yonirt/moltyjs/compare/v1.2.1...v1.2.2 | ||
[1.2.1]: https://github.com/Yonirt/moltyjs/compare/v1.2.0...v1.2.1 | ||
[1.2.0]: https://github.com/Yonirt/moltyjs/compare/v1.1.0...v1.2.0 | ||
@@ -590,0 +598,0 @@ [1.1.0]: https://github.com/Yonirt/moltyjs/compare/v1.0.10...v1.1.0 |
@@ -87,5 +87,8 @@ 'use strict'; | ||
/* | ||
// Elastic search does not admit fields starting with '_' | ||
if (key[0] === '_') { | ||
throw new Error('Schema fields can not start with "_": ' + key); | ||
} | ||
*/ | ||
@@ -112,5 +115,17 @@ // Objects nested | ||
Object.keys(options[key]).forEach(inheritOptionsKey => { | ||
if (!this._isValidInheritOption(inheritOptionsKey, options[key])) throw new Error('Unsupported schema inherit option: ' + inheritOptionsKey); | ||
if (inheritOptionsKey === 'discriminatorKey' && options[key].discriminatorKey[0] === '_') throw new Error('Discriminator key can not start with "_": ' + options[key].discriminatorKey); | ||
if (!this._isValidInheritOption(inheritOptionsKey, options[key])) { | ||
throw new Error('Unsupported schema inherit option: ' + inheritOptionsKey); | ||
} | ||
/* | ||
// Elastic search does not admit fields starting with '_' | ||
if ( | ||
inheritOptionsKey === 'discriminatorKey' && | ||
options[key].discriminatorKey[0] === '_' | ||
) { | ||
throw new Error( | ||
'Discriminator key can not start with "_": ' + | ||
options[key].discriminatorKey, | ||
); | ||
} | ||
*/ | ||
}); | ||
@@ -117,0 +132,0 @@ } |
{ | ||
"name": "moltyjs", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "A tiny ODM for MongoDB with multy tenancy support.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
138873
2519