Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@andrewscwei/mongodb-odm

Package Overview
Dependencies
87
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.39.0 to 0.40.0

17

build/types/index.d.ts

@@ -424,1 +424,18 @@ import { CollectionAggregationOptions, CollectionInsertManyOptions, CollectionInsertOneOptions, CommonOptions, FilterQuery, FindOneAndReplaceOption, IndexOptions, ObjectID, ReplaceOneOptions, UpdateQuery } from 'mongodb';

}): GeoCoordinate;
/**
* Makes an ObjectID from a value.
*
* @param value - Value to make the ObjectID from.
*
* @returns If successful, a new ObjectID instance will be returned. If not,
* `undefined` will be returned.
*/
export declare function ObjectIDMake(value: any): ObjectID | undefined;
/**
* Checks if a value can be used to create a valid ObjectID.
*
* @param value - The value to check.
*
* @returns `true` or `false`.
*/
export declare function valueIsValidObjectID(value: any): boolean;

@@ -106,2 +106,41 @@ "use strict";

exports.GeoCoordinateMake = GeoCoordinateMake;
/**
* Makes an ObjectID from a value.
*
* @param value - Value to make the ObjectID from.
*
* @returns If successful, a new ObjectID instance will be returned. If not,
* `undefined` will be returned.
*/
function ObjectIDMake(value) {
if (!valueIsValidObjectID(value))
return undefined;
return new mongodb_1.ObjectID(value);
}
exports.ObjectIDMake = ObjectIDMake;
/**
* Checks if a value can be used to create a valid ObjectID.
*
* @param value - The value to check.
*
* @returns `true` or `false`.
*/
function valueIsValidObjectID(value) {
if (is_1.default.nullOrUndefined(value))
return false;
if (!mongodb_1.ObjectID.isValid(value))
return false;
if (is_1.default.directInstanceOf(value, mongodb_1.ObjectID))
return true;
try {
const objectId = new mongodb_1.ObjectID(value);
if (objectId.toHexString() !== String(value))
return false;
}
catch (err) {
return false;
}
return true;
}
exports.valueIsValidObjectID = valueIsValidObjectID;
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "@andrewscwei/mongodb-odm",
"version": "0.39.0",
"version": "0.40.0",
"description": "ODM for MongoDB",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc