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

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 2.5.0 to 2.5.1

5

CHANGELOG.md

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

## v2.5.1
- **Internal**
- `t.update` should not change the reference when no changes occur, fix #153
## v2.5.0

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

10

index.js

@@ -167,2 +167,3 @@ /*! @preserve

var value = getShallowCopy(instance);
var isChanged = false;
for (var k in spec) {

@@ -174,7 +175,9 @@ if (spec.hasOwnProperty(k)) {

else {
value[k] = update(value[k], spec[k]);
var newValue = update(value[k], spec[k]);
isChanged = isChanged || ( newValue !== value[k] );
value[k] = newValue;
}
}
}
return value;
return isChanged ? value : instance;
}

@@ -425,2 +428,5 @@

var type = Union.dispatch(value);
if (!type && Union.is(value)) {
return value;
}

@@ -427,0 +433,0 @@ if (process.env.NODE_ENV !== 'production') {

2

package.json
{
"name": "tcomb",
"version": "2.5.0",
"version": "2.5.1",
"description": "Type checking and DDD for JavaScript",

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

@@ -91,3 +91,3 @@ [![build status](https://img.shields.io/travis/gcanti/tcomb/master.svg?style=flat-square)](https://travis-ci.org/gcanti/tcomb)

Instances are immutables using `Object.freeze`. This means you can use standard JavaScript objects and arrays. You don't have to change how you normally code. You can update an immutable instance with the provided `update(instance, spec)` function:
Instances are immutable using `Object.freeze`. This means you can use standard JavaScript objects and arrays. You don't have to change how you normally code. You can update an immutable instance with the provided `update(instance, spec)` function:

@@ -94,0 +94,0 @@ ```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