Skip to content

Small util to operate types representing by strings

Notifications You must be signed in to change notification settings

vsandbox/typler

Repository files navigation

typler

Build Status

Install

npm install https://github.com/vladvsydorenko/typler.git

Syntax

Types are represented by strings. E.g. string, number. Type could be a container, like array<number> or stream<string>. Or is also supported: string | number | array<array<stream<number>>>.

Parse and Validate

Before using you should parse your type

import {parseType, isCompatible} from 'typler';

// parse types
const stringOrNumberType = parseType('string | number');
const stringType = parseType('string');

// check
isCompatible(stringOrNumberType, string); // true

About

Small util to operate types representing by strings

Resources

Stars

Watchers

Forks

Packages

No packages published