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.27 to 3.2.28

5

CHANGELOG.md

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

# v3.2.28
- **Bug Fix**
- Enums.is() with an array value should always be false, #327 (@phorsuedzie)
# v3.2.27

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

3

lib/enums.js
var assert = require('./assert');
var isTypeName = require('./isTypeName');
var forbidNewOperator = require('./forbidNewOperator');
var isNumber = require('./isNumber');
var isString = require('./isString');

@@ -41,3 +42,3 @@ var isObject = require('./isObject');

Enums.is = function (x) {
return map.hasOwnProperty(x);
return (isString(x) || isNumber(x)) && map.hasOwnProperty(x);
};

@@ -44,0 +45,0 @@

{
"name": "tcomb",
"version": "3.2.27",
"version": "3.2.28",
"description": "Type checking and DDD for JavaScript",

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

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

# IMPORTANT: Running in production
tcomb is supposed to be used in **development** and is **disabled in production**.
If you want type checks in production you may use
- [tcomb-validation](https://github.com/gcanti/tcomb-validation)
- [io-ts](https://github.com/gcanti/io-ts)
# Setup

@@ -138,3 +145,3 @@

All models are inspectable at runtime. You can read and reuse the informations stored in your types (in the `meta` static member). See [The meta object](docs/GUIDE.md#the-meta-object) in the docs for details.
All models are inspectable at runtime. You can read and reuse the information stored in your types (in the `meta` static member). See [The meta object](docs/GUIDE.md#the-meta-object) in the docs for details.

@@ -147,3 +154,3 @@ Libraries exploiting tcomb's RTI:

**Easy JSON serialization / deseralization**
**Easy JSON serialization / deserialization**

@@ -150,0 +157,0 @@ Encodes / decodes your domain models to / from JSON for free.

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