import { MyPromise } from '../promise'
import type { ResolveFn, RejectFn } from '../type'

export function reject(arg?: unknown) {
  if (!arg) arg = undefined
  return new MyPromise((_: ResolveFn, reject: RejectFn) => {
    reject(arg)
  })
}

{'avg_line_length': 24.3, 'max_line_length': 60, 'alphanum_fraction': 0.654320987654321, 'licenses': ['MIT'], 'repository_name': 'Cheng-DX/js-practice', 'path': 'src/promise/my-promise/static-functions/promise-reject.ts', 'size': 243, 'lang': 'TypeScript'}