Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tcomb-additional-types

eserozvataf51Apache-2.00.0.2TypeScript support: included

Additional types for tcomb

tcomb, additional, extra, validation, type, types, safety, model, store, checking, definition, schema, number, string, decimal, float, hexadecimal, integer, alpha, alphanumeric, base64, credit, card, domain, email, hex, color, ip, isbn, json, lower, upper, case, mac, address, md5, mobile, phone, mongo, id, url, uuid, guid, iso8601

readme

This project originally forked from tcomb-form-types, thanks to all contributor and maintainers.

Installation

npm install --save tcomb-additional-types

Usage

const tx = require('tcomb-additional-types');
// or
import * as tx from 'tcomb-additional-types';

const test = t.struct({
  alpha: tx.String.Alpha,
  alphanumeric: tx.String.Alphanumeric,
  base64: tx.String.Base64,
  creditcard: tx.String.CreditCard,
  decimal: tx.Number.Decimal,
  email: tx.String.Email,
  float: tx.Number.Float,
  hexadecimal: tx.String.Hexadecimal,
  hexcolor: tx.String.HexColor,
  ip: tx.String.IP,
  isbn: tx.String.ISBN,
  iso8601: tx.String.ISO8601,
  integer: tx.Number.Integer,
  json: tx.String.JSON,
  lowercase: tx.String.LowerCase,
  macaddress: tx.String.MacAddress,
  md5: tx.String.MD5,
  mobilephone: tx.String.MobilePhone,
  mongoid: tx.String.MongoId,
  null: tx.Null,
  nullable: tx.String.Nullable,
  url: tx.String.URL,
  uuid: tx.String.UUID,
  uppercase: tx.String.UpperCase,
});