0.0.36 • Published 3 years ago
@cuser/utils v0.0.36
Status
@cuser/utils
Index
Functions
Functions
assert
▸ Const
assert(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:
Name | Type |
---|---|
assertion | any |
...args | any[] |
Returns: void
formatErr
▸ Const
formatErr(...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:
Name | Type |
---|---|
...args | any[] |
Returns: Error
timestamp
▸ Const
timestamp(): number
Defined in timestamp.js:5
Gets current timestamp
Returns: number
0.0.30
3 years ago
0.0.31
3 years ago
0.0.32
3 years ago
0.0.33
3 years ago
0.0.34
3 years ago
0.0.35
3 years ago
0.0.36
3 years ago
0.0.29
3 years ago
0.0.27
3 years ago
0.0.25
3 years ago
0.0.26
3 years ago
0.0.18
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.12
3 years ago
0.0.8
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago