[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 Wrap. It can be read by the typeOf()arrow-up-right function of @angular-package/typearrow-up-right.

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

Example usage

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

// Define the wrap.
const tagWrap = new Wrap('[', ']');

// Returns [object Wrap].
Object.prototype.toString.call(tagWrap);

// Returns wrap.
typeOf(tagWrap);

Last updated