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

bsonschema

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

bsonschema - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

32

lib/validator.js
'use strict';
var typesObject = require('bson-type-of-is').typesObject;
var urilib = require('url');

@@ -303,33 +304,4 @@

var types = Validator.prototype.types = {};
types.string = function testString (instance) {
return typeof instance == 'string';
};
types.number = function testNumber (instance) {
// isFinite returns false for NaN, Infinity, and -Infinity
return typeof instance == 'number' && isFinite(instance);
};
types.integer = function testInteger (instance) {
return (typeof instance == 'number') && instance % 1 === 0;
};
types.boolean = function testBoolean (instance) {
return typeof instance == 'boolean';
};
types.array = function testArray (instance) {
return instance instanceof Array;
};
types['null'] = function testNull (instance) {
return instance === null;
};
types.date = function testDate (instance) {
return instance instanceof Date;
};
types.any = function testAny (instance) {
return true;
};
types.object = function testObject (instance) {
// TODO: fix this - see #15
return instance && (typeof instance) === 'object' && !(instance instanceof Array) && !(instance instanceof Date);
};
var types = Validator.prototype.types = typesObject;
module.exports = Validator;

7

package.json
{
"author": "Tom de Grunt <tom@degrunt.nl>",
"name": "bsonschema",
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",
"dependencies": {
"bson-type-of-is": "^1.3.0"
},
"contributors": [
{ "name" : "Austin Wright" }
{
"name": "Austin Wright"
}
],

@@ -11,0 +14,0 @@ "main": "./lib",

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