File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- export const assert = ( condition : boolean , message : string ) : asserts condition => {
1
+ export function assert ( condition : boolean , message : string ) : asserts condition {
2
2
if ( ! condition )
3
3
throw new Error ( message )
4
4
}
5
5
export const toString = ( v : any ) => Object . prototype . toString . call ( v )
6
- export const getTypeName = ( v : any ) => {
6
+ export function getTypeName ( v : any ) {
7
7
if ( v === null )
8
8
return 'null'
9
9
const type = toString ( v ) . slice ( 8 , - 1 ) . toLowerCase ( )
10
- return typeof v === 'object' || typeof v === 'function' ? type : typeof v
10
+ return ( typeof v === 'object' || typeof v === 'function' ) ? type : typeof v
11
11
}
12
- export const noop = ( ) => { }
12
+ export function noop ( ) { }
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromis
40
40
*/
41
41
export function sleep ( ms : number , callback ?: Fn < any > ) {
42
42
return new Promise < void > ( resolve =>
43
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
43
+
44
44
setTimeout ( async ( ) => {
45
45
await callback ?.( )
46
46
resolve ( )
You can’t perform that action at this time.
0 commit comments