xpress-mongo
Advanced tools
Comparing version 2.9.2 to 2.9.3
{ | ||
"name": "xpress-mongo", | ||
"version": "2.9.2", | ||
"version": "2.9.3", | ||
"description": "Light Weight ODM for mongoDb NodeJs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -121,3 +121,3 @@ import ObjectCollection from "object-collection"; | ||
*/ | ||
get(key: string, $default?: any): any; | ||
get<Value = any>(key: string, $default?: Value): Value; | ||
/** | ||
@@ -166,3 +166,3 @@ * Set data in model | ||
*/ | ||
static make<T extends typeof XMongoModel>(this: T, data?: StringToAnyObject): InstanceType<T>; | ||
static make<M extends typeof XMongoModel>(this: M, data?: StringToAnyObject): InstanceType<M>; | ||
/** | ||
@@ -272,3 +272,3 @@ * Check if id is a valid id | ||
*/ | ||
validate(data?: StringToAnyObject): StringToAnyObject; | ||
validate<ValidatedType extends StringToAnyObject>(data?: StringToAnyObject): ValidatedType; | ||
/** | ||
@@ -275,0 +275,0 @@ * Delete this |
@@ -183,3 +183,3 @@ "use strict"; | ||
// Find current value of key | ||
let data = this.get(key, undefined); | ||
let data = this.get(key); | ||
// if current value is undefined create new array | ||
@@ -416,3 +416,3 @@ if (data === undefined) { | ||
*/ | ||
let compareWith = this.get(key, undefined); | ||
let compareWith = this.get(key); | ||
// Return false of to || compareWith is false, undefined or null | ||
@@ -438,3 +438,2 @@ if (!to || !compareWith) | ||
const data = {}; | ||
// @ts-ignore | ||
const append = this.$static().append || []; | ||
@@ -653,6 +652,6 @@ const excluded = [...append, ...this.loadedRelationships]; | ||
/** | ||
* If data doesnt have schemaKey we skip | ||
* If data doesn't have schemaKey we skip | ||
* else throw Error if this is not a customData | ||
* | ||
* i.e else if data === this.data | ||
* i.e. else if data === this.data | ||
*/ | ||
@@ -659,0 +658,0 @@ if (data.hasOwnProperty(schemaKey)) { |
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
111790
3428