Socket
Socket
Sign inDemoInstall

tcomb

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tcomb - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

7

CHANGELOG.md

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

# v3.2.1
- **Bug Fix**
- fix missing path argument in FuncType
- **Polish**
- better stringify serialization for functions
# v3.2.0

@@ -17,0 +24,0 @@

7

lib/func.js

@@ -51,10 +51,11 @@ var assert = require('./assert');

function FuncType(value, curried) {
function FuncType(value, path) {
if (!isInstrumented(value)) { // automatically instrument the function
return FuncType.of(value, curried);
return FuncType.of(value);
}
if (process.env.NODE_ENV !== 'production') {
assert(FuncType.is(value), function () { return 'Invalid value ' + assert.stringify(value) + ' supplied to ' + displayName; });
path = path || [displayName];
assert(FuncType.is(value), function () { return 'Invalid value ' + assert.stringify(value) + ' supplied to ' + path.join('/'); });
}

@@ -61,0 +62,0 @@

@@ -0,4 +1,13 @@

var getFunctionName = require('./getFunctionName');
function replacer(key, value) {
if (typeof value === 'function') {
return getFunctionName(value);
}
return value;
}
module.exports = function stringify(x) {
try { // handle "Converting circular structure to JSON" error
return JSON.stringify(x, null, 2);
return JSON.stringify(x, replacer, 2);
}

@@ -5,0 +14,0 @@ catch (e) {

{
"name": "tcomb",
"version": "3.2.0",
"version": "3.2.1",
"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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc