Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
/ tools Public archive

TypeScript utility functions

License

Notifications You must be signed in to change notification settings

toba/tools

Repository files navigation

npm package Build Status Code style Dependencies DevDependencies Test Coverage

Toba Tools

📖 Using a TypeScript module

Identity

import { is } from '@toba/tools';

Identity checks evaluate whether a variable is of a given type. All return true or false. Where possible, they implement TypeScript type guards so the value is thereafter recognized as a particular type.

value

is.value(x);

Whether x is not undefined and not null.

The parameter is generic so the variable may thereafter be recognized as that type. For example, if is.value<string>(var) evaluates true then TypeScript will also know to treat var as a string.

empty

is.empty(x);

Whether x is undefined, null or an empty string ("").

defined

is.defined(x, name);

Whether name is a property of the object x.

Caching

stuff

License

Copyright © 2019 Jason Abbott

This software is licensed under the MIT license. See the LICENSE file accompanying this software for terms of use.

Releases

No releases published

Packages

No packages published