Page cover image

Overview

The `Wrap` primitive wrapper object

Wrap {}

The Wrap object is based on the String object and represents the immutable primitive value of the text wrapped by the opening and closing chars. It is designed to preserve the type names of the supplied opening, text, and closing chars by using the generic type variables.

Instance

Accessors

public get closing(): Closing The get accessor gets the closing of the wrap by returning the #closing property of the specified object.

public get opening(): Opening The get accessor gets the opening of the wrap by returning the #opening property of the specified object.

public get text(): Text The get accessor gets the text of the Wrap by returning the #text property of a specified object.

public get [Symbol.toStringTag](): string The get accessor toStringTag of the Symbol changes the default tag String of the instance to the custom tag Wrap.

Properties

Private

#closing: Closing Private property of the closing chars of a generic type variable Closing.

#opening: Opening Private property of the opening chars of a generic type variable Opening.

#text: Text Private property of text of a generic type variable Text.

Methods

Public

public getClosing() Gets the closing chars of the wrap by returning the #closing property of a specified object.

public getOpening() Gets the opening chars of the wrap by returning the #opening property of a specified object.

public getText() Gets the text of the wrap by returning the #text property of a specified object, without the opening and closing chars of the Wrap.

public hasClosing() Checks whether the primitive value of a specified object has the closing chars or given closing chars.

public hasOpening() Checks whether the primitive value of a specified object has the opening chars or given opening chars.

public hasText() The method checks whether the text of a specified Wrap object is defined, which means it's a string of at least one char and optionally equal to the given text.

public isWrapped() The method checks whether the primitive value of the specified object is wrapped by the opening and closing chars of an instance or given opening and closing chars.

public ★ replaceClosing() Returns the primitive value with replaced closing chars.

public ★ replaceOpening() Returns the primitive value with replaced opening chars.

public ★ replaceText() Returns the primitive value with replaced text.

public toString() Gets the wrap, the primitive value of a specified Wrap object.

public valueOf() Returns the wrap, primitive value of a specified Wrap object.

Static

Methods

Public

public static hasClosing() Checks whether the text has given closing chars at the end.

public static hasOpening() Checks whether the text has given opening chars at the beginning.

public static isWrap() The method checks whether the value of any type is the Wrap instance of any or given opening and closing chars.

Last updated

Was this helpful?