kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/657/head
rodzic
5fbad5f57b
commit
a1ebc9ddbf
|
@ -1,15 +1,15 @@
|
|||
import is from '@sindresorhus/is'
|
||||
import { isError } from '@sindresorhus/is'
|
||||
|
||||
function assertImpl(value: unknown, message?: string | Error): asserts value {
|
||||
if (value) {
|
||||
return
|
||||
}
|
||||
|
||||
if (is.error(message)) {
|
||||
throw message
|
||||
if (!message) {
|
||||
throw new Error('Assertion failed')
|
||||
}
|
||||
|
||||
throw new Error(message ?? 'Assertion failed')
|
||||
throw isError(message) ? message : new Error(message)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Ładowanie…
Reference in New Issue