0.0.36 • Published 5 years ago

@cuser/utils v0.0.36

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Status

codecov npm npm-downloads

@cuser/utils

Index

Functions

Functions

assert

Constassert(assertion: any, ...args: any[]): void

Defined in assert.js:12

Asserts a condition to raise an error when not fullfilled

example

assert(true, 'should not raise the custom error with args %s', 'foo');
assert(false, 'should raise the custom error with args %s', 'foo');

Parameters:

NameType
assertionany
...argsany[]

Returns: void


formatErr

ConstformatErr(...args: any[]): Error

Defined in formatErr.js:12

Formats an error like sprintf

example

formatErr('messsage error with argument %s', 'foo')
formatErr(TypeError, 'messsage error with argument %s and custom Error constructor', 'foo')

Parameters:

NameType
...argsany[]

Returns: Error


timestamp

Consttimestamp(): number

Defined in timestamp.js:5

Gets current timestamp

Returns: number

0.0.30

5 years ago

0.0.31

5 years ago

0.0.32

5 years ago

0.0.33

5 years ago

0.0.34

5 years ago

0.0.35

5 years ago

0.0.36

5 years ago

0.0.29

5 years ago

0.0.27

5 years ago

0.0.25

5 years ago

0.0.26

5 years ago

0.0.18

5 years ago

0.0.16

5 years ago

0.0.17

5 years ago

0.0.12

5 years ago

0.0.8

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago