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 Versions

1
8

3.1.0

Diff

Changelog

Source

v3.1.0

  • New Feature
    • add t.Integer to standard types
    • add t.Type to standard types
    • interface combinator, fix #195, docs (thanks @ctrlplusb)
      • add interface support to fromJSON (@minedeljkovic)
    • add support for extending refinements, fix #179, docs
    • local and global strict option for structs and interfaces, fix #203, docs
    • Chrome Dev Tools custom formatter for tcomb types docs
  • Bug Fix
    • More intelligent immutability update handling, fix #199 (thanks @ctrlplusb)
    • func combinator: support optional arguments, fix #198 (thanks @ivan-kleshnin)
  • Internal
    • add "Struct" prefix to structs default name
    • mixin() now allows identical references for overlapping properties
gcanti
published 3.0.0 •

Changelog

Source

v3.0.0

Warning. If you don't rely in your codebase on the property maybe(MyType)(undefined) === null this is not a breaking change for you.

  • Breaking Change
    • prevent Maybe constructor from altering the value when Nil, fix #183 (thanks @gabro)
gcanti
published 2.7.0 •

Changelog

Source

v2.7.0

  • New Feature
    • lib/fromJSON module: generic deserialize, fix #169
    • lib/fromJSON TypeScript definition file
  • Bug Fix
    • t.update module: $apply doesn't play well with dates and regexps, fix #172
    • t.update: cannot $merge and $remove at once, fix #170 (thanks @grahamlyus)
    • TypeScript: fix Exported external package typings file '...' is not a module
    • misleading error message in Struct.extend functions, fix #177 (thanks @Firfi)
gcanti
published 2.6.0 •

Changelog

Source

v2.6.0

  • New Feature
    • declare API: recursive and mutually recursive types (thanks @utaal)
    • typescript definition file, fix #160 (thanks @DanielRosenwasser)
    • t.struct.extend, fix #164 (thanks @dzdrazil)
  • Internal
    • split main file to separate modules, fix #158
    • add "typings" field to package.json (TypeScript)
    • add predicate field to irreducibles meta objects
  • Documentation
gcanti
published 2.5.2 •

Changelog

Source

v2.5.2

  • Bug Fix
    • remove the assert checking if the type returned by a union dispatch function is correct (was causing issues with unions of unions or unions of intersections)
gcanti
published 2.5.1 •

Changelog

Source

v2.5.1

  • Internal
    • t.update should not change the reference when no changes occur, fix #153
gcanti
published 2.5.0 •

Changelog

Source

v2.5.0

  • New Feature
    • check if the type returned by a union dispatch function is correct, fix #136 (thanks @fcracker79)
    • added refinement alias to subtype (which is deprecated), fix #140
  • Internal
    • optimisations: for identity types return early in production, fix #135 (thanks @fcracker79)
    • exposed getDefaultName on combinator constructors
gcanti
published 2.4.1 •

Changelog

Source

v2.4.1

  • New Feature
    • added struct multiple inheritance, fix #143
gcanti
published 2.4.0 •

Changelog

Source

v2.4.0

  • New Feature
    • unions
      • added update function, #127
      • the default dispatch implementation now handles unions of unions, #126
      • show the offended union type in error messages
gcanti
published 2.3.0 •

Changelog

Source

v2.3.0

  • New Feature

    • Add support for lazy messages in asserts, fix #124
    • Better error messages for assert failures, fix #120

    The messages now have the following general form:

    Invalid value <value> supplied to <context>
    

    where context is a slash-separated string with the following properties:

    • the first element is the name of the "root"
    • the following elements have the form: <field name>: <field type>

    Note: for more readable messages remember to give types a name

    Example:

    var Person = t.struct({
      name: t.String
    }, 'Person'); // <- remember to give types a name
    
    var User = t.struct({
      email: t.String,
      profile: Person
    }, 'User');
    
    var mynumber = t.Number('a');
    // => Invalid value "a" supplied to Number
    
    var myuser = User({ email: 1 });
    // => Invalid value 1 supplied to User/email: String
    
    myuser = User({ email: 'email', profile: { name: 2 } });
    // => Invalid value 2 supplied to User/profile: Person/name: String
    
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