🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@cuser/utils

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cuser/utils

common utils used by cuser

latest
Source
npmnpm
Version
0.0.36
Version published
Weekly downloads
4
-86.21%
Maintainers
1
Weekly downloads
 
Created
Source

cuser logo

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

FAQs

Package last updated on 24 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts