get type()

The `get` accessor obtains the type

TypeError.prototype.type

The getarrow-up-right accessor obtains the type of generic type variable Type that causes an error to be thrown(or not thrown) if set, otherwise returns undefinedarrow-up-right.

type-error.class.ts
public get type(): Type | undefined {
  return this.#type;
}

Return type

Returns

The return value is the type of generic type variable Type or undefinedarrow-up-right.

Example usage

// Example usage.
import { TypeError } from '@angular-package/error';

// Returns "string".
new TypeError('problem', 'Fix accessor.', '(TE:201)', 'string').type;

Last updated

Was this helpful?