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

bson-type-of-is

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bson-type-of-is - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

21

index.js

@@ -47,3 +47,3 @@ // BSON types

var types = [
var typesArray = [
{

@@ -120,8 +120,13 @@ alias: 'undefined',

var typesObject = typesArray.reduce(function (acc, type) {
acc[type.alias] = type.check
return acc
}, {});
// recognize bson types
function bsonTypeOfIs (value) {
var i
for (i = 0; i < types.length; i++) {
if (types[i].check(value)) {
return types[i].alias
for (i = 0; i < typesArray.length; i++) {
if (typesArray[i].check(value)) {
return typesArray[i].alias
}

@@ -137,3 +142,3 @@ }

function testBsonType (type, value) {
if (!types[type]) {
if (!typesObject[type]) {
throw {

@@ -145,8 +150,10 @@ message: 'This type is not a bson type alias',

return types[type].check(value)
return typesObject[type].check(value)
}
bsonTypeOfIs.TYPES = TYPES
bsonTypeOfIs.typesArray = typesArray
bsonTypeOfIs.typesObject = typesObject
bsonTypeOfIs.testBsonType = testBsonType
bsonTypeOfIs.TYPES = TYPES
module.exports = bsonTypeOfIs
{
"name": "bson-type-of-is",
"version": "1.2.0",
"version": "1.3.0",
"description": "Get BSON type alias of a value",

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

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