Skip to main content

ArgumentError

Extends

  • TypeError

Constructors

new ArgumentError()

new ArgumentError(message?): ArgumentError

Parameters

message?: string

Returns

ArgumentError

Inherited from

TypeError.constructor

new ArgumentError()

new ArgumentError(message?): ArgumentError

Parameters

message?: string

Returns

ArgumentError

Inherited from

TypeError.constructor

Properties

message

message: string

Inherited from

TypeError.message


name

name: "ArgumentError" = ArgumentError.NAME

Overrides

TypeError.name


stack?

optional stack: string

Inherited from

TypeError.stack


NAME

readonly static NAME: "ArgumentError" = "ArgumentError"


prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

TypeError.prepareStackTrace


stackTraceLimit

static stackTraceLimit: number

Inherited from

TypeError.stackTraceLimit

Methods

assert()

assert(value, name, type)

static assert(value, name, type): asserts value is undefined

Parameters

value: any

name: string

type: "undefined"

Returns

asserts value is undefined

assert(value, name, type)

static assert(value, name, type): asserts value is null

Parameters

value: any

name: string

type: "null"

Returns

asserts value is null

assert(value, name, type)

static assert(value, name, type): asserts value is boolean

Parameters

value: any

name: string

type: "boolean"

Returns

asserts value is boolean

assert(value, name, type)

static assert(value, name, type): asserts value is number

Parameters

value: any

name: string

type: "number"

Returns

asserts value is number

assert(value, name, type)

static assert(value, name, type): asserts value is Object

Parameters

value: any

name: string

type: "object"

Returns

asserts value is Object

assert(value, name, type)

static assert(value, name, type): asserts value is string

Parameters

value: any

name: string

type: "string"

Returns

asserts value is string

assert(value, name, type)

static assert(value, name, type): asserts value is any[]

Parameters

value: any

name: string

type: "Array"

Returns

asserts value is any[]

assert(value, name, type)

static assert(value, name, type): asserts value is ArrayBuffer

Parameters

value: any

name: string

type: "ArrayBuffer"

Returns

asserts value is ArrayBuffer

assert(value, name, type)

static assert(value, name, type): asserts value is ArrayBufferView

Parameters

value: any

name: string

type: "ArrayBufferView"

Returns

asserts value is ArrayBufferView

assert(value, name, type)

static assert<T>(value, name, type): asserts value is T

Type Parameters

T

Parameters

value: any

name: string

type

Returns

asserts value is T

assert(value, name, type, types)

static assert(value, name, type, ...types): void

Parameters

value: any

name: string

type: ArgumentType

• ...types: ArgumentType[]

Returns

void


captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

TypeError.captureStackTrace


isType()

isType(value, type)

static isType(value, type): value is undefined

Parameters

value: any

type: "undefined"

Returns

value is undefined

isType(value, type)

static isType(value, type): value is null

Parameters

value: any

type: "null"

Returns

value is null

isType(value, type)

static isType(value, type): value is boolean

Parameters

value: any

type: "boolean"

Returns

value is boolean

isType(value, type)

static isType(value, type): value is number

Parameters

value: any

type: "number"

Returns

value is number

isType(value, type)

static isType(value, type): value is object

Parameters

value: any

type: "object"

Returns

value is object

isType(value, type)

static isType(value, type): value is string

Parameters

value: any

type: "string"

Returns

value is string

isType(value, type)

static isType(value, type): value is any[]

Parameters

value: any

type: "Array"

Returns

value is any[]

isType(value, type)

static isType(value, type): value is ArrayBuffer

Parameters

value: any

type: "ArrayBuffer"

Returns

value is ArrayBuffer

isType(value, type)

static isType(value, type): value is ArrayBufferView

Parameters

value: any

type: "ArrayBufferView"

Returns

value is ArrayBufferView

isType(value, type)

static isType<T>(value, type): value is T

Type Parameters

T

Parameters

value: any

type

Returns

value is T

isType(value, type)

static isType(value, type): boolean

Parameters

value: any

type: ArgumentType

Returns

boolean