0.0.10 • Published 4 years ago

@shedevro/web-utils v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Travis (.org) Coveralls github npm GitHub stars

Web utils (WIP)

Provides assertion utility for better coding

Installation

npm install @shedevro/web-utils --save

Usage

Library uses typescript assert types like someFuntion(value): asserts value is string etc.

import { Assert } from '@shedevro/web-utils';

// some of functions
Assert.string(val);
Assert.number(val);
Assert.boolean(val);
Assert.array(val);
Assert.instance(val, SomeInstanceClass);
...
For example
const stringValue = 'some string';

Assert.string(stringValue); // not throws error
const uppercasedValue = stringValue.toUppercase();

// OR
const mayBeStringValue = 123;
Assert.string(mayBeStringValue); // throws WebUtilsAssertionError (Error)
const uppercasedValue = mayBeStringValue.toUppercase();
...

Build

npm run build

Test

npm test

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.1

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago