Socket
Socket
Sign inDemoInstall

tcomb

Package Overview
Dependencies
0
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.1 to 3.2.2

5

CHANGELOG.md

@@ -15,2 +15,7 @@ # Changelog

# v3.2.2
- **Bug Fix**
- relax `isObject` contraint in interface combinator, fix #214
# v3.2.1

@@ -17,0 +22,0 @@

22

lib/interface.js

@@ -55,6 +55,5 @@ var assert = require('./assert');

path = path || [displayName];
assert(isObject(value), function () { return 'Invalid value ' + assert.stringify(value) + ' supplied to ' + path.join('/') + ' (expected an object)'; });
// strictness
if (strict) {
for (k in value) {
for (var k in value) {
assert(props.hasOwnProperty(k), function () { return 'Invalid additional prop "' + k + '" supplied to ' + path.join('/'); });

@@ -67,8 +66,8 @@ }

var ret = {};
for (var k in props) {
var expected = props[k];
var actual = value[k];
var instance = create(expected, actual, ( process.env.NODE_ENV !== 'production' ? path.concat(k + ': ' + getTypeName(expected)) : null ));
for (var prop in props) {
var expected = props[prop];
var actual = value[prop];
var instance = create(expected, actual, ( process.env.NODE_ENV !== 'production' ? path.concat(prop + ': ' + getTypeName(expected)) : null ));
idempotent = idempotent && ( actual === instance );
ret[k] = instance;
ret[prop] = instance;
}

@@ -99,7 +98,4 @@

Interface.is = function (x) {
if (!isObject(x)) {
return false;
}
if (strict) {
for (k in x) {
for (var k in x) {
if (!props.hasOwnProperty(k)) {

@@ -110,4 +106,4 @@ return false;

}
for (var k in props) {
if (!is(x[k], props[k])) {
for (var prop in props) {
if (!is(x[prop], props[prop])) {
return false;

@@ -114,0 +110,0 @@ }

{
"name": "tcomb",
"version": "3.2.1",
"version": "3.2.2",
"description": "Type checking and DDD for JavaScript",

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc