get [Symbol.toStringTag]()

Changes the default tag to 'TypeError' for an instance

[Symbol.toStringTag]()

The getarrow-up-right accessor, with the help of toStringTagarrow-up-right, changes the default tag to 'ValidationError' for an instance of ValidationError.

It can be read by the typeOf()arrow-up-right function of @angular-package/typearrow-up-right.

validation-error.class.ts
public get [Symbol.toStringTag](): string {
  return 'TypeError';
}

Return type

Returns

The return value is the word 'ValidationError' of a stringarrow-up-right.

Example usage

// Example usage.
import { ValidationError } from '@angular-package/error';
import { typeOf } from '@angular-package/type';

// Returns "validationerror".
typeOf(new ValidationError('problem', 'Fix accessor.'));

Last updated