[Symbol.toStringTag]

[Symbol.toStringTag]

The getarrow-up-right accessor toStringTagarrow-up-right of the Symbolarrow-up-right changes the default tag String of the instance to the custom tag Wrapper. It can be read by the typeOf()arrow-up-right function of @angular-package/typearrow-up-right.

wrapper.class.ts
public get [Symbol.toStringTag](): string {
  return 'Wrapper';
}

Example usage

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

const quote = new Wrapper('[', ']', 'quote');

// Returns [object Wrapper].
Object.prototype.toString.call(quote);

// Returns wrapper.
typeOf(quote);

Last updated