Instance accessors

The properties of `Wrap` the string object.

Public

Wrap.prototype.closing

The get accessor gets the closing of the wrap by returning the #closing property of the specified object.

wrap.class.ts
public get closing(): Closing {
  return this.#closing;
}

Returns

The return value is the wrap closing of a generic type variable Closing.

Wrap.prototype.opening

The get accessor gets the opening of the wrap by returning the #opening property of the specified object.

wrap.class.ts
public get opening(): Opening {
  return this.#opening;
}

Returns

The return value is the wrap opening of a generic type variable Opening.

Wrap.prototype.wrap

The get accessor gets the wrap consisting of the opening and closing.

wrap.class.ts
public get wrap(): `${Opening}${Closing}` {
  return this.value;
}

Returns

The return value is the wrap of a generic type variable in order Opening and Closing on the template.

Wrap.prototype.value

The get accessor gets the wrap consisting of the opening and closing.

wrap.class.ts
public get value(): `${Opening}${Closing}` {
  return this.valueOf();
}

Returns

The return value is the wrap of a generic type variable in order Opening and Closing on the template.

[Symbol.toStringTag]

The get accessor, with the help of toStringTag of Symbol, changes the default object tag to wrap for an instance of the Wrap.

Good to know: The property can be read by the typeOf() function of the type package.

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

Example usage

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

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

// Returns wrap.
typeOf(tagWrap);

Last updated