Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hadron-type-checker

Package Overview
Dependencies
Maintainers
20
Versions
497
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hadron-type-checker - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

23

lib/type-checker.js

@@ -132,2 +132,9 @@ 'use strict';

function toObjectID(object) {
if (object === '') {
return new bson.ObjectID();
}
return bson.ObjectID.createFromHexString(object);
}
/**

@@ -149,3 +156,4 @@ * The functions to cast to a type.

'Object': toObject,
'Array': toArray
'Array': toArray,
'ObjectID': toObjectID
};

@@ -263,3 +271,3 @@

const STRING_TESTS = [
new Test(/^$/, [ 'String', 'Null', 'MinKey', 'MaxKey', 'Object', 'Array' ]),
new Test(/^$/, [ 'String', 'Null', 'MinKey', 'MaxKey', 'Object', 'Array', 'ObjectID']),
new Test(INT32_CHECK, [ 'Int32', 'Int64', 'Double', 'String', 'Object', 'Array' ]),

@@ -273,3 +281,4 @@ new Test(INT_DBL_CHECK, [ 'Int64', 'Double', 'String', 'Object', 'Array' ]),

new Test(/^\/(.*)\/$/, [ 'BSONRegExp', 'String', 'Object', 'Array' ]),
new Test(DATE_CHECK, [ 'Date', 'String', 'Object', 'Array' ])
new Test(DATE_CHECK, [ 'Date', 'String', 'Object', 'Array' ]),
new Test(/(^$)|^[A-Fa-f0-9]{24}$/, [ 'String', 'Object', 'Array', 'ObjectID' ])
];

@@ -281,3 +290,3 @@

const HP_STRING_TESTS = [
new Test(/^$/, [ 'String', 'Null', 'MinKey', 'MaxKey', 'Object', 'Array' ]),
new Test(/^$/, [ 'String', 'Null', 'MinKey', 'MaxKey', 'Object', 'Array', 'ObjectID' ]),
new Test(INT32_CHECK, [ 'Int32', 'Int64', 'Double', 'Decimal128', 'String', 'Object', 'Array' ]),

@@ -292,3 +301,4 @@ new Test(INT_DBL_CHECK, [ 'Int64', 'Double', 'Decimal128', 'String', 'Object', 'Array' ]),

new Test(/^\/(.*)\/$/, [ 'BSONRegExp', 'String', 'Object', 'Array' ]),
new Test(DATE_CHECK, [ 'Date', 'String', 'Object', 'Array' ])
new Test(DATE_CHECK, [ 'Date', 'String', 'Object', 'Array' ]),
new Test(/(^$)|^[A-Fa-f0-9]{24}$/, [ 'String', 'Object', 'Array', 'ObjectID' ])
];

@@ -364,3 +374,4 @@

*
* @param {Object} - The object.
* @param {Object} object - The object.
* @param {Boolean} highPrecisionSupport - If high precision is supported or not.
*

@@ -367,0 +378,0 @@ * @returns {Array} The available types.

@@ -7,3 +7,3 @@ {

"homepage": "https://github.com/mongodb-js/hadron-type-checker",
"version": "1.1.0",
"version": "1.1.1",
"repository": {

@@ -10,0 +10,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc