New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

notmytype

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notmytype - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

8

assert.js

@@ -239,7 +239,9 @@ /**

const type = new Type(name, function(x, ctx) {
if(types.some(function(type) { return type.is(x); })) {
ctx = (ctx || []).concat(name);
if(types.some(function(type) {
return validate(x, type, ctx, true) === null;
})) {
return null;
}
ctx = ctx || [];
return [new Failure(x, type, ctx.concat(name))];
return [new Failure(x, type, ctx)];
});

@@ -246,0 +248,0 @@ return type;

{
"name": "notmytype",
"version": "1.0.0",
"version": "1.1.0",
"description": "Type-check your function inputs with syntax like T(s, T.string, buf, Buffer, strings, T.list(T.string))",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/ludios/notmytype",

@@ -147,3 +147,3 @@ /**

it('should succeed if x is a list of T', function() {
it('should succeed if x is a list of numbers', function() {
assert.strictEqual(

@@ -154,2 +154,9 @@ f.list(f.number).validate([1, 2]),

});
it('should succeed if x is a list of Dates', function() {
assert.strictEqual(
f.list(Date).validate([new Date(), new Date()]),
null
);
});
});

@@ -209,3 +216,3 @@

it('should succeed if x is an instance of T', function() {
it('should succeed if x is a number', function() {
assert.strictEqual(

@@ -216,2 +223,9 @@ f.maybe(f.number).validate(1),

});
it('should succeed if x is an instance of Date', function() {
assert.strictEqual(
f.maybe(Date).validate(new Date()),
null
);
});
});

@@ -255,3 +269,3 @@

it('should succeed if x is an instance of T', function() {
it('should succeed if x is a tuple of string and number', function() {
assert.strictEqual(

@@ -386,3 +400,3 @@ f.tuple([f.string, f.number]).validate(['s', 1]),

it('should succeed if x is an instance of T', function() {
it('should succeed if x is an instance of string or number', function() {
assert.strictEqual(

@@ -394,2 +408,8 @@ f.union([f.string, f.number]).validate(1),

it('should succeed if x is an instance of string or Date', function() {
assert.strictEqual(
f.union([f.string, Date]).validate(new Date()),
null
);
});
});

@@ -396,0 +416,0 @@

@@ -57,3 +57,4 @@ "use strong";

assert.strictEqual(T(3, T.number, [new Buffer("hi")], T.list(Buffer)));
assert.strictEqual(T([new Buffer("hi"), new Date()], T.list(T.union([Buffer, Date]))));
});
});
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