Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 30, 2023
1 parent 9905a72 commit fb02b90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/base.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const assert = (condition: boolean, message: string): asserts condition => {
export function assert(condition: boolean, message: string): asserts condition {
if (!condition)
throw new Error(message)
}
export const toString = (v: any) => Object.prototype.toString.call(v)
export const getTypeName = (v: any) => {
export function getTypeName(v: any) {
if (v === null)
return 'null'
const type = toString(v).slice(8, -1).toLowerCase()
return typeof v === 'object' || typeof v === 'function' ? type : typeof v
return (typeof v === 'object' || typeof v === 'function') ? type : typeof v
}
export const noop = () => {}
export function noop() {}
2 changes: 1 addition & 1 deletion src/promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromis
*/
export function sleep(ms: number, callback?: Fn<any>) {
return new Promise<void>(resolve =>
// eslint-disable-next-line @typescript-eslint/no-misused-promises

setTimeout(async () => {
await callback?.()
resolve()
Expand Down

0 comments on commit fb02b90

Please sign in to comment.