@andrewscwei/mongodb-odm
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -405,3 +405,3 @@ import { CollectionAggregationOptions, CollectionInsertManyOptions, CollectionInsertOneOptions, CommonOptions, FilterQuery, FindOneAndReplaceOption, IndexOptions, ObjectID, ReplaceOneOptions, UpdateQuery } from 'mongodb'; | ||
/** | ||
* Checks if a value is an ObjectID. | ||
* Checks if a value is a value ObjectID. | ||
* | ||
@@ -412,3 +412,3 @@ * @param value - Value to check. | ||
*/ | ||
export declare function typeIsObjectID(value: any): value is ObjectID; | ||
export declare function typeIsValidObjectID(value: any): value is ObjectID; | ||
/** | ||
@@ -415,0 +415,0 @@ * Checks if a value is a GeoCoordinate. Also ensures the longitude and latitude |
@@ -33,3 +33,3 @@ "use strict"; | ||
return false; | ||
if (!typeIsObjectID(value._id)) | ||
if (!typeIsValidObjectID(value._id)) | ||
return false; | ||
@@ -40,3 +40,3 @@ return true; | ||
/** | ||
* Checks if a value is an ObjectID. | ||
* Checks if a value is a value ObjectID. | ||
* | ||
@@ -47,8 +47,12 @@ * @param value - Value to check. | ||
*/ | ||
function typeIsObjectID(value) { | ||
function typeIsValidObjectID(value) { | ||
if (is_1.default.nullOrUndefined(value)) | ||
return false; | ||
if (!is_1.default.directInstanceOf(value, mongodb_1.ObjectID)) | ||
return false; | ||
if (!mongodb_1.ObjectID.isValid(value)) | ||
return false; | ||
return true; | ||
} | ||
exports.typeIsObjectID = typeIsObjectID; | ||
exports.typeIsValidObjectID = typeIsValidObjectID; | ||
/** | ||
@@ -55,0 +59,0 @@ * Checks if a value is a GeoCoordinate. Also ensures the longitude and latitude |
{ | ||
"name": "@andrewscwei/mongodb-odm", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "ODM for MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
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
241356
3649