# Introduction

## angular-package/wrapper

Wrap the text with the opening and closing chars.

### Idea

The idea behind the `Wrapper` is to have an object that creates a tag of string type, not a specific tag like Html, or BBCode but any tag of a string with preserved exact type.


# ❤ Benefits

Under the hood of some packages are [primitive wrapper objects](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript), and below is a list containing some **pros** of using them and of important design benefits.

* [**Immutable**](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) primitive value of [primitive wrapper objects](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript).
* A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value is divided into private properties of [generic type variables](https://www.typescriptlang.org/docs/handbook/2/generics.html).&#x20;
* A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value type is built of generic type variables on the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), which results in the **exact return type** rather than just a `string`.
* The **ability** to get part of the primitive value of the exact return type.
* Specific functionality objects with generic type variables(which preserves exact type) act as **precise** types.
* The most **important** functionalities for a **specific** name.
* General and [**intuitive**](/wrapper-draft/general-concepts#intuitive) object names.

All this above is in a **minimal**, **simple** to use, and **ease-extendable** form of objects.

<details>

<summary>Immutability</summary>

[**Immutable**](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) primitive value of [primitive wrapper objects](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript).

Some methods return converted primitive value to a form of an [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) object or array.

Use the [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessors to return parts of the [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value of a specified object.

</details>

<details>

<summary>Partial primitive value with the exact return type</summary>

A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value is divided into private properties of [generic type variables](https://www.typescriptlang.org/docs/handbook/2/generics.html). &#x20;

A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value type is built of generic type variables on the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), which results in the **exact return type** rather than just a `string`.

The **ability** to get part of the primitive value of the exact return type.

</details>

<details>

<summary>Object as types</summary>

Specific in functionality objects with generic type variables(which preserves type), act as **precise** types.

Objects have changed a [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) to **unique immutable** names.

Type of the objects can be detected by the [`Object.prototype.toString.call()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). because of its **uniqueness** and **immutability**.&#x20;

There is `typeOf()` function of `angular-package/type` to detect these objects type.

</details>

<details>

<summary>Functionality <strong>follows</strong> the type</summary>

The most **important** functionalities, dedicated to a **specific** name.

Objects have functionalities that use their parts of [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) primitive values.

</details>

<details>

<summary>Intuitiveness</summary>

General and [**intuitive**](/wrapper-draft/general-concepts#intuitive) object names.

[Intuitive](/wrapper-draft/general-concepts#intuitive) names of generic type variables.

[Intuitive](/wrapper-draft/general-concepts#intuitive) accessor and property names.

[Intuitive](/wrapper-draft/general-concepts#intuitive) method names.

</details>

<details>

<summary>Minimalism and simplicity</summary>

**Minimal**, **simple** to use and an **ease-extendable** objects.

</details>


# Explanation

### Partial primitive value with the exact return type

This example explains what **partial primitive value** and the **exact return type** means in the [`Wrap`](/wrapper-draft/wrap/overview) `string` object.

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

// Define tag [quote].
const quoteTag = new Wrap(
  // quoteTag.opening;
  `[`,
  // quoteTag.closing;
  `]`,
  // quoteTag.content;
  'quote'
);

// The opening is of a generic type variable Opening in this case it's [.
quoteTag.opening;

// The closing is of a generic type variable Closing in this case it's ].
quoteTag.closing;

// The content is of a generic type variable Content in this case it's quote.
quoteTag.content;

```

To create primitive value of [`Wrap`](/wrapper-draft/wrap/overview) object there is the need to provide three parameters in order `opening`, `closing`, and optional `content`. They are stored in separate private properties which are accessible with the help of accessors, and because of this, access to **parts of the primitive value** is achieved. More, each parameter is of a generic type variable that detects the type of given value, and because of this, the **exact return type** of **primitive value** and its **parts** is achieved.

#### Immutability

All the parts that make up the primitive value of the [`Wrap`](/wrapper-draft/wrap/overview) object are **immutable** because they are accessible only by the `get` accessors. There is no possibility to change any part of the primitive value of the `quoteTag` object and any try to change e.g. `opening` results in the error message "*Cannot assign to 'opening' because it is a read-only property*".&#x20;

```typescript

// Cannot assign to 'opening' because it is a read-only property
// and the opening is of a generic type variable Opening in this case it's `[`.
quoteTag.opening = ; 

```

### Object as types

There is possibility to check whether the object is the `wrapper` with the help of `typeOf()` function. The name of `bbCodeWrapper` object cannot be changed in the example below.

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

class CustomWrap {
  bbCode: Wrapper<`[`, `]`> = new Wrapper(`[`, `]`);
  html: Wrapper<'<', '>'> = new Wrapper(`<`, `>`);
}

// Returns [quote] of type "[quote]".
new CustomWrap().bbCode.wrap('quote');

// Returns <span> of type "<span>".
new CustomWrap().html.wrap('span');

// Checks the object type. Returns 'wrapper'.
const bbCodeWrapper = new Wrapper('[', ']');

// Returns 'wrapper'.
typeOf(bbCodeWrapper);

// Symbol.toStringTag is immutable. Can't be changed.
// Uncaught TypeError: Cannot set property Symbol(Symbol.toStringTag) of [object Object] which has only a getter
Object.assign(bbCodeWrapper, {
  [Symbol.toStringTag]: 'custom'
});

```


# General concepts

Explanation of common terms for all packages.

### ⚠

The warning sign indicates the element is **not** **available**.

### ★

The element starred as most **useful**.

### **Checks**

It's to **check** the provided value to be the same as **expected**.

### Type guard (constrain)

Constrains the parameter type to not let input unexpected value in the code editor.

### **Guard**

It's a **combination** of both above, **constrains** the type of the parameter in the **code editor**, and checks its provided argument.

### **Defines**

Returns defined value from a method of an object.

Defines new value in an object and returns a defined value.

### **Gets**

Returns a value from an object.

### **Sets**

Adds or updates an element with a specified key and a value to an object and returns an object.

### Intuitive

Having the ability to know or understand things without any proof or evidence. E.g. some of the accessor names indicate directly its role.

### General

Relating to the main or major parts of something rather than the details. E.g. some of the accessor names don't indicate the specific role in the object.

{% embed url="<https://docs.angular-package.dev/v/designing/definitions>" %}
More definitions
{% endembed %}


# Skeleton

The package was generated by the [library skeleton](https://github.com/angular-package/skeleton) which was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.&#x20;

Copy package to the `packages/wrapper` folder of the [library skeleton](https://github.com/angular-package/skeleton) then run the commands below.

### Code scaffolding

Run `ng generate component component-name --project wrapper` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project wrapper`.

> Note: Don't forget to add `--project wrapper` or else it will be added to the default project in your `angular.json` file.

### Build

Run `ng build wrapper` to build the project. The build artifacts will be stored in the `dist/` directory.

### **Publishing**

After building your library with `ng build wrapper`, go to the dist folder `cd dist/wrapper` and run `npm publish`.

### **Running unit tests**

Before the test can be performed install `@angular-package/testing` with command:&#x20;

```bash
npm i @angular-package/testing --no-save
```

Run `ng test wrapper` to execute the unit tests via [Karma](https://karma-runner.github.io).

### Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.


# Installation

The package can be installed into your project via [NPM](https://www.npmjs.com/), or [yarn](https://yarnpkg.com/getting-started/install).

{% tabs %}
{% tab title="npm" %}

```bash
npm install @angular-package/wrapper --save
```

{% endtab %}

{% tab title="yarn" %}

```
yarn add @angular-package/wrapper
```

{% endtab %}
{% endtabs %}


# Public API

Public features that can be imported.

```typescript
import {
  // Wrapper
  Wrap,
  Wrapper,
  // Type.
  Wrapped
} from '@angular-package/wrapper';
```


# Basic concepts

Explanation of terms specific to wrapper.

### Closing

The characters indicate the [wrap](#wrap) closing used at the **end** of the [wrapped text](#wrapped).

### Text <a href="#wrap-content" id="wrap-content"></a>

The text without the [opening](#opening) and [closing](#closing) characters.

### Opening

The characters indicate the [wrap](#wrap) opening used at the **beginning** of the [wrapped text](#wrapped).

### Wrap

As a **noun**, wrap consists of the **opening** and **closing** characters.

As a **verb**, wraps the specified text around with the opening chars **before** and the closing **after** the text.

### Wrapped text

The [text](#text) consists of [opening](#opening) characters at the **beginning** and [closing](#closing) at the **end**.

### Wrapper

A wrapper is an object consisting of a [wrap](#wrap), which uses it to wrap the specified [text](#text) around.


# Overview

The \`Wrap\` primitive wrapper object

## Wrap {}

The [`Wrap`](https://github.com/angular-package/wrapper/blob/main/src/lib/wrap.class.ts) object is based on the [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) object and represents the [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf) of the [text](/wrapper-draft/getting-started/basic-concepts#wrap-content) wrapped by the [opening](/wrapper-draft/getting-started/basic-concepts#opening) and [closing](/wrapper-draft/getting-started/basic-concepts#closing) chars. It is designed to preserve the type names of the supplied opening, text, and closing chars by using the generic type variables.

{% embed url="<https://github.com/angular-package/wrapper/blob/main/src/lib/wrap.class.ts>" %}

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_primitives_and_string_objects>" %}

{% embed url="<https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html>" %}

## Instance

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public get <a href="/pages/y486cVc4dkfJSdWG82YB"><strong>closing(): </strong><mark style="color:green;"><strong>Closing</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> of the wrap by returning the <a href="/pages/oKLZ9AUvVxrQOUBye2mp"><code>#closing</code></a> property of the specified object.</p>                                                                                                                                                                                                                                              |
| <p>public get <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><strong>opening(): </strong><mark style="color:green;"><strong>Opening</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> of the wrap by returning the <a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><code>#opening</code></a> property of the specified object.</p>                                                                                                                                                                                                                                              |
| <p>public get <a href="/pages/dVcsuee2Tiyg6m9Naczl">t<strong>ext(): </strong><mark style="color:green;"><strong>Text</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap-content">text</a> of the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object.</p>                                                                                                                                                                                                |
| <p>public get <a href="/pages/LjT4vPzcCOLRlNlnXHEK"><strong>[Symbol.toStringTag](https://wrapper.angular-package.dev/wrapper-draft/wrap): </strong><mark style="color:green;"><strong>string</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrap</code>.</p> |

### Properties

#### Private

|                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/oKLZ9AUvVxrQOUBye2mp"><strong>#closing: </strong><mark style="color:green;"><strong>Closing</strong></mark></a><br>Private property of the closing chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-closing"><code>Closing</code></a>.</p>     |
| <p><a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><strong>#opening: </strong><mark style="color:green;"><strong>Opening</strong></mark></a><br>Private property of the opening chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-opening"><code>Opening</code></a>.</p>     |
| <p><a href="/pages/oDUSz67aGEA6VGbBULlE"><strong>#text: </strong><mark style="color:green;"><strong>Text</strong></mark></a><br>Private property of text of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than"><code>Text</code></a>.</p> |

### Methods

#### Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>public <a href="/pages/DO4ArQjbDGnDv1Ta74Yy"><strong>getClosing()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#closing-closing"><code>#closing</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p>public <a href="/pages/sMY677pZekEiwLxaWOT8"><strong>getOpening()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#opening-opening"><code>#opening</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p>public <a href="/pages/LoemdYYF2nsxY7XYurnU"><strong>getText()</strong></a><br>Gets the text of the wrap by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object, without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of the <a href="/pages/vlRmumtdkPHxEUrU51WO"><code>Wrap</code></a>.</p>                                                                                                                                        |
| <p>public <a href="/pages/SwVbIKxEQyWEUHmJcqB7"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars or given <a href="/pages/SwVbIKxEQyWEUHmJcqB7#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                             |
| <p>public <a href="/pages/AXIumFXCrM0Gvjvp6Ygz"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars or given <a href="/pages/AXIumFXCrM0Gvjvp6Ygz#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                             |
| <p>public <a href="/pages/EPu74cDYJe28Jt8YJlfl"><strong>hasText()</strong></a><br>The method checks whether the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object is defined, which means it's a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> of at least one char and optionally equal to the given <a href="/pages/EPu74cDYJe28Jt8YJlfl#text-string"><code>text</code></a>.</p>         |
| <p>public <a href="/pages/VDTORK00NPJgmbN7aELv"><strong>isWrapped()</strong></a><br>The method checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the specified object is wrapped by the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of an instance or given <a href="/pages/VDTORK00NPJgmbN7aELv#opening-string-this.-opening"><code>opening</code></a> and <a href="/pages/VDTORK00NPJgmbN7aELv#closing-string-this.-closing"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/VqVru4aHNREMRPPI7C7x"><strong>★ replaceClosing()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p>public <a href="/pages/zKADrcHiPoJayJd5LR4Q"><strong>★ replaceOpening()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p>public <a href="/pages/2khbXB2F6Yiq7r6I68nu"><strong>★ replaceText()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>.</p>                                                                                                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/6nAq7tnHWOAKno0FtVIY"><strong>toString()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="#wrap"><code>Wrap</code></a> object.</p>                                                                                                                                                                                                                                                                                    |
| <p>public <a href="/pages/K32cdMdrpsCcE0oMk8Ek"><strong>valueOf()</strong></a><br>Returns the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf">primitive value</a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object.</p>                                                                                                                                                                                            |

## Static

### Methods

#### Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/pages/KqCEKG6pfYooFvLJylRi"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/KqCEKG6pfYooFvLJylRi#text-string"><code>text</code></a> has given <a href="/pages/KqCEKG6pfYooFvLJylRi#closing-string"><code>closing</code></a> chars at the end.</p>                                                                                                                                                        |
| <p>public static <a href="/pages/5ZNZc77RcMzT5lXjVIQN"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/5ZNZc77RcMzT5lXjVIQN#text-string"><code>text</code></a> has given <a href="/pages/5ZNZc77RcMzT5lXjVIQN#opening-string"><code>opening</code></a> chars at the beginning.</p>                                                                                                                                                  |
| <p>public static <a href="/pages/tMC6jpWbwyHbTibV7FVb"><strong>isWrap()</strong></a><br>The method checks whether the <a href="/pages/tMC6jpWbwyHbTibV7FVb#value-any"><code>value</code></a> of any type is the <a href="#wrap"><code>Wrap</code></a> instance of any or given <a href="/pages/tMC6jpWbwyHbTibV7FVb#opening-opening"><code>opening</code></a> and <a href="/pages/tMC6jpWbwyHbTibV7FVb#closing-closing"><code>closing</code></a> chars.</p> |


# Generic type variables

The \`Wrap\` primitive wrapper object generic type variables

## `Wrap<`<mark style="color:green;background-color:green;">`Opening`</mark>`,`<mark style="color:green;">`Text`</mark>`,`<mark style="color:green;">`Closing`</mark>`>` <a href="#wrap-opening" id="wrap-opening"></a>

#### <mark style="color:green;">`Opening`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`string`</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value **captured** from the provided [`opening`](/wrapper-draft/wrap/constructor#opening-opening) indicates the opening type of a new [`Wrap`](/wrapper-draft/wrap/overview) instance.

{% code title="wrap.class.ts" %}

```typescript
class Wrap<
  Opening extends string = string, // <--- Declare generic type variable Opening.
  Text extends string = ``,
  Closing extends string = string
> extends String {
  ...
  constructor(
    opening: Opening, // <--- Capture generic type variable Opening.
    closing: Closing,
    text: Text = '' as Text
  ) { ... }
  ...
}
```

{% endcode %}

## `Wrap<`<mark style="color:green;">`Opening`</mark>`,`<mark style="color:green;background-color:green;">`Text`</mark>`,`<mark style="color:green;">`Closing`</mark>`>`

#### <mark style="color:green;">`Text`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">` `` `</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value **captured** from the provided [`text`](/wrapper-draft/wrap/constructor#text-text) indicates the text type of a new [`Wrap`](/wrapper-draft/wrap/overview) instance.

{% hint style="info" %}
The constructor **`text`** parameter is optional, and if not provided, the default value of the generic type variable [`Text`](#wrap-less-than...-text-...greater-than) is not captured, but it's an empty [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) from the declaration.
{% endhint %}

{% code title="wrap.class.ts" %}

```typescript
class Wrap<
  Opening extends string = string,
  Text extends string = ``, // <--- Declare generic type variable Text.
  Closing extends string = string
> extends String {
  ...
  constructor(
    opening: Opening,
    closing: Closing,
    text: Text = '' as Text  // <--- Capture generic type variable Text.
  ) { ... }
  ...
}
```

{% endcode %}

## `Wrap<`<mark style="color:green;">`Opening`</mark>`,`<mark style="color:green;">`Text`</mark>`,`<mark style="color:green;background-color:green;">`Closing`</mark>`>` <a href="#wrap-closing" id="wrap-closing"></a>

#### <mark style="color:green;">`Closing`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`string`</mark>

​A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value **captured** from the provided [`closing`](/wrapper-draft/wrap/constructor#closing-closing) indicates the closing type of a new [`Wrap`](/wrapper-draft/wrap/overview) instance.

{% code title="wrap.class.ts" %}

```typescript
class Wrap<
  Opening extends string = string,
  Text extends string = ``,
  Closing extends string = string // <--- Declare generic type variable Closing.
> extends String {
  ...
  constructor(
    opening: Opening,
    closing: Closing, // <--- Capture generic type variable Closing.
    text: Text = '' as Text
  ) { ... }
  ...
}
```

{% endcode %}


# ★ Constructor

## `Wrap()`

Creates a new [`Wrap`](/wrapper-draft/wrap/overview) instance of the [`opening`](#opening-opening) and [`closing`](#closing-closing) chars and optional [`text`](#text-text) to wrap.&#x20;

{% code title="wrap.class.ts" %}

```typescript
constructor(opening: Opening, closing: Closing, text: Text = '' as Text) {
  super(`${opening}${text}${closing}`);
  this.#closing = String(closing) as Closing;
  this.#text = String(text) as Text;
  this.#opening = String(opening) as Opening;
}
```

{% endcode %}

### Parameters

#### `opening:`[<mark style="color:green;">`Opening`</mark>](/wrapper-draft/wrap/generic-type-variables#wrap-opening)

Opening characters of the generic type variable [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening) placed before the given [`text`](#text-text). An empty [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) indicates that for the [`hasOpening()`](https://wrapper.angular-package.dev/wrapper-draft/wrap/pages/AXIumFXCrM0Gvjvp6Ygz#wrap.prototype.hasopening) and [`isWrapped()`](/wrapper-draft/wrap/methods/iswrapped) methods, the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars are [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined), returning `false`.

#### `closing:`[<mark style="color:green;">`Closing`</mark>](/wrapper-draft/wrap/generic-type-variables#wrap-closing)

Closing characters of the generic type variable [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing) placed after the given [`text`](#text-text). An empty [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) indicates that for the [`hasClosing()`](/wrapper-draft/wrap/methods/hasclosing) and [`isWrapped()`](/wrapper-draft/wrap/methods/iswrapped) methods, the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars are [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined), returning `false`.

#### `text:`[<mark style="color:green;">`Text`</mark>](https://wrapper.angular-package.dev/wrapper-draft/wrap/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than)`=`<mark style="color:green;">`''`</mark>

An optional text placed between the given [`opening`](#opening-opening) and [`closing`](#closing-closing) chars on the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) `${Opening}${Text}${Closing}`.

### Returns

The **return value** is a new instance of [`Wrap`](/wrapper-draft/wrap/overview) with the [primitive value](/wrapper-draft/wrap/methods/valueof) of the provided [`opening`](#opening-opening), [`closing`](#closing-closing), and the optional [`text`](#text-text).

## Example usage

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

// Returns Wrap{'[]'}
new Wrap('[', ']');

// Returns Wrap{'nullnull'}
new Wrap(null as any, null as any);
```


# Accessors

The \`Wrap\` primitive wrapper object accessors

## Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public get <a href="/pages/y486cVc4dkfJSdWG82YB"><strong>closing(): </strong><mark style="color:green;"><strong>Closing</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> of the wrap by returning the <a href="/pages/oKLZ9AUvVxrQOUBye2mp"><code>#closing</code></a> property of the specified object.</p>                                                                                                                                                                                                                                              |
| <p>public get <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><strong>opening(): </strong><mark style="color:green;"><strong>Opening</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> of the wrap by returning the <a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><code>#opening</code></a> property of the specified object.</p>                                                                                                                                                                                                                                              |
| <p>public get <a href="/pages/dVcsuee2Tiyg6m9Naczl">t<strong>ext(): </strong><mark style="color:green;"><strong>Text</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap-content">text</a> of the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object.</p>                                                                                                                                                                                                |
| <p>public get <a href="/pages/LjT4vPzcCOLRlNlnXHEK"><strong>[Symbol.toStringTag](https://wrapper.angular-package.dev/wrapper-draft/wrap): </strong><mark style="color:green;"><strong>string</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrap</code>.</p> |


# get closing()

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

## `Wrap.prototype.closing`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor gets the [closing](/wrapper-draft/getting-started/basic-concepts#closing) of the wrap by returning the [`#closing`](/wrapper-draft/wrap/properties/closing) property of the specified object.

{% code title="wrap.class.ts" %}

```typescript
public get closing(): Closing {
  return this.#closing;
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Closing`</mark>

The **return type** is the generic type variable [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing) declared in the [`Wrap`](/wrapper-draft/wrap/overview) class.

### Returns

The **return value** is [closing](/wrapper-draft/getting-started/basic-concepts#closing) of the wrap of a generic type variable [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).

## Example usage

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

// Returns ] of type "]".
new Wrap(`[`, `]`, 'quote').closing;
```


# get opening()

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

## `Wrap.prototype.opening`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor gets the [opening](/wrapper-draft/getting-started/basic-concepts#opening) of the wrap by returning the [`#opening`](/wrapper-draft/wrap/properties/opening) property of the specified object.

{% code title="wrap.class.ts" %}

```typescript
public get opening(): Opening {
  return this.#opening;
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Opening`</mark>

The **return type** is the generic type variable [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening) declared in the [`Wrap`](/wrapper-draft/wrap/overview) class.

### Returns

The **return value** is the [opening](/wrapper-draft/getting-started/basic-concepts#opening) of the wrap of a generic type variable [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening).

## Example usage

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

// Returns [ of type "[".
new Wrap(`[`, `]`, 'quote').opening;
```


# get text()

The \`get\` accessor gets the text of the \`Wrap\` by returning the \`#text\` property of a specified object.

## `Wrap.prototype.text`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor gets the text of the [`Wrap`](/wrapper-draft/wrap/overview) by returning the [`#text`](/wrapper-draft/wrap/properties/text) property of a specified object.

{% code title="wrap.class.ts" %}

```typescript
public get text(): Text {
  return this.#text;
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Text`</mark>

The **return type** is the generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/accessors/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) declared in the [`Wrap`](/wrapper-draft/wrap/overview) class.

### Returns

The **return value** is the text of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/accessors/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than).

## Example usage

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

// Returns quote of type "quote".
new Wrap(`[`, `]`, 'quote').text;
```


# get \[Symbol.toStringTag]\()

## `[Symbol.toStringTag]`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor [`toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) of the [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) changes the default tag `String` of the instance to the custom tag `Wrap`. It can be read by the [`typeOf()`](https://type.angular-package.dev/v/type-draft/helper/typeof) function of [`@angular-package/type`](https://type.angular-package.dev/).

{% code title="wrap.class.ts" %}

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

{% endcode %}

### Return type

#### [<mark style="color:green;">string</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)

## Example usage

```typescript
// 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);
```


# Properties

The \`Wrap\` primitive wrapper object properties

|                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/oKLZ9AUvVxrQOUBye2mp"><strong>#closing: </strong><mark style="color:green;"><strong>Closing</strong></mark></a><br>Private property of the closing chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-closing"><code>Closing</code></a>.</p>     |
| <p><a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><strong>#opening: </strong><mark style="color:green;"><strong>Opening</strong></mark></a><br>Private property of the opening chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-opening"><code>Opening</code></a>.</p>     |
| <p><a href="/pages/oDUSz67aGEA6VGbBULlE"><strong>#text: </strong><mark style="color:green;"><strong>Text</strong></mark></a><br>Private property of text of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than"><code>Text</code></a>.</p> |


# #closing

## `#closing:`<mark style="color:green;">`Closing`</mark>

Private property of the [closing chars](/wrapper-draft/getting-started/basic-concepts#closing) of a generic type variable [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).

{% code title="wrap.class.ts" %}

```typescript
#closing: Closing;
```

{% endcode %}


# #opening

## `#opening:`<mark style="color:green;">`Opening`</mark>

Private property of the [opening chars](/wrapper-draft/getting-started/basic-concepts#opening) of a generic type variable [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening).

{% code title="wrap.class.ts" %}

```typescript
#opening: Opening;
```

{% endcode %}


# #text

## `#text:`<mark style="color:green;">`Text`</mark>

Private property of [text](/wrapper-draft/getting-started/basic-concepts#wrap-content) of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/properties/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than).

{% code title="wrap.class.ts" %}

```typescript
#text: Text;
```

{% endcode %}


# Methods

The \`Wrap\` primitive wrapper object methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="/pages/KqCEKG6pfYooFvLJylRi"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/KqCEKG6pfYooFvLJylRi#text-string"><code>text</code></a> has given <a href="/pages/KqCEKG6pfYooFvLJylRi#closing-string"><code>closing</code></a> chars at the end.</p>                                                                                                                                                                              |
| <p><strong>public static</strong> <a href="/pages/5ZNZc77RcMzT5lXjVIQN"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/5ZNZc77RcMzT5lXjVIQN#text-string"><code>text</code></a> has given <a href="/pages/5ZNZc77RcMzT5lXjVIQN#opening-string"><code>opening</code></a> chars at the beginning.</p>                                                                                                                                                                        |
| <p><strong>public static</strong> <a href="/pages/tMC6jpWbwyHbTibV7FVb"><strong>isWrap()</strong></a><br>The method checks whether the <a href="/pages/tMC6jpWbwyHbTibV7FVb#value-any"><code>value</code></a> of any type is the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> instance of any or given <a href="/pages/tMC6jpWbwyHbTibV7FVb#opening-opening"><code>opening</code></a> and <a href="/pages/tMC6jpWbwyHbTibV7FVb#closing-closing"><code>closing</code></a> chars.</p> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>public <a href="/pages/DO4ArQjbDGnDv1Ta74Yy"><strong>getClosing()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#closing-closing"><code>#closing</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p>public <a href="/pages/sMY677pZekEiwLxaWOT8"><strong>getOpening()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#opening-opening"><code>#opening</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p>public <a href="/pages/LoemdYYF2nsxY7XYurnU"><strong>getText()</strong></a><br>Gets the text of the wrap by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object, without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of the <a href="/pages/vlRmumtdkPHxEUrU51WO"><code>Wrap</code></a>.</p>                                                                                                                                        |
| <p>public <a href="/pages/SwVbIKxEQyWEUHmJcqB7"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars or given <a href="/pages/SwVbIKxEQyWEUHmJcqB7#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                             |
| <p>public <a href="/pages/AXIumFXCrM0Gvjvp6Ygz"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars or given <a href="/pages/AXIumFXCrM0Gvjvp6Ygz#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                             |
| <p>public <a href="/pages/EPu74cDYJe28Jt8YJlfl"><strong>hasText()</strong></a><br>The method checks whether the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object is defined, which means it's a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> of at least one char and optionally equal to the given <a href="/pages/EPu74cDYJe28Jt8YJlfl#text-string"><code>text</code></a>.</p>         |
| <p>public <a href="/pages/VDTORK00NPJgmbN7aELv"><strong>isWrapped()</strong></a><br>The method checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the specified object is wrapped by the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of an instance or given <a href="/pages/VDTORK00NPJgmbN7aELv#opening-string-this.-opening"><code>opening</code></a> and <a href="/pages/VDTORK00NPJgmbN7aELv#closing-string-this.-closing"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/VqVru4aHNREMRPPI7C7x"><strong>★ replaceClosing()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p>public <a href="/pages/zKADrcHiPoJayJd5LR4Q"><strong>★ replaceOpening()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p>public <a href="/pages/2khbXB2F6Yiq7r6I68nu"><strong>★ replaceText()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>.</p>                                                                                                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/6nAq7tnHWOAKno0FtVIY"><strong>toString()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/vlRmumtdkPHxEUrU51WO"><code>Wrap</code></a> object.</p>                                                                                                                                                                                                                                                              |
| <p>public <a href="/pages/K32cdMdrpsCcE0oMk8Ek"><strong>valueOf()</strong></a><br>Returns the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf">primitive value</a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object.</p>                                                                                                                                                                                            |


# ↓ Static

The \`Wrap\` primitive wrapper object static methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/pages/KqCEKG6pfYooFvLJylRi"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/KqCEKG6pfYooFvLJylRi#text-string"><code>text</code></a> has given <a href="/pages/KqCEKG6pfYooFvLJylRi#closing-string"><code>closing</code></a> chars at the end.</p>                                                                                                                                                                              |
| <p>public static <a href="/pages/5ZNZc77RcMzT5lXjVIQN"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/5ZNZc77RcMzT5lXjVIQN#text-string"><code>text</code></a> has given <a href="/pages/5ZNZc77RcMzT5lXjVIQN#opening-string"><code>opening</code></a> chars at the beginning.</p>                                                                                                                                                                        |
| <p>public static <a href="/pages/tMC6jpWbwyHbTibV7FVb"><strong>isWrap()</strong></a><br>The method checks whether the <a href="/pages/tMC6jpWbwyHbTibV7FVb#value-any"><code>value</code></a> of any type is the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> instance of any or given <a href="/pages/tMC6jpWbwyHbTibV7FVb#opening-opening"><code>opening</code></a> and <a href="/pages/tMC6jpWbwyHbTibV7FVb#closing-closing"><code>closing</code></a> chars.</p> |


# static hasClosing()

Checks whether the text has given closing chars at the end.

## `Wrap.hasClosing()`

Checks whether the [`text`](#text-string) has given [`closing`](#closing-string) chars at the **end**.

{% code title="wrap.class.ts" %}

```typescript
public static hasClosing(text: string, closing: string): boolean {
  return (
    typeof text === 'string' &&
    text.length >= 1 &&
    typeof closing === 'string' &&
    closing.length >= 1 &&
    text.slice(-closing.length) === closing
  );
}
```

{% endcode %}

### Parameters

#### `text: string`

The text of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type, to check whether it contains given [`closing`](#closing-string) chars.

#### `closing: string`

The closing chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to check if a given [`text`](#text-string) contains.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the [`text`](#text-string) contains [`closing`](#closing-string) chars at the **end**.

## Example usage

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

const quote = new Wrap(`[`, `]`, 'quote');

// Returns true.
Wrap.hasClosing(quote.valueOf(), ']');

// Returns false.
Wrap.hasClosing(quote.valueOf(), '>');

// Returns false.
Wrap.hasClosing(quote.valueOf(), '');

// Returns false.
Wrap.hasClosing(new Wrap(`[`, ``, 'quote').valueOf(), '');
```


# static hasOpening()

Checks whether the text has given opening chars at the beginning.

## `Wrap.hasOpening()`

Checks whether the [`text`](#text-string) has given [`opening`](#opening-string) chars at the **beginning**.

{% code title="wrap.class.ts" %}

```typescript
public static hasOpening(text: string, opening: string): boolean {
  return (
    typeof text === 'string' &&
    text.length >= 1 &&
    typeof opening === 'string' &&
    opening.length >= 1 &&
    text.slice(0, opening.length) === opening
  );
}
```

{% endcode %}

### Parameters

#### `text: string`

The text of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), to check whether it contains given [`opening`](#opening-string) chars.

#### `opening: string`

The opening chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to check if a given [`text`](#text-string) contains.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the [`text`](#text-string) contains [`opening`](#opening-string) chars at the **beginning**.

## Example usage

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

const quote = new Wrap(`[`, `]`, 'quote');

// Returns true.
Wrap.hasOpening(quote.valueOf(), '[');

// Returns false.
Wrap.hasOpening(quote.valueOf(), '>');

// Returns false.
Wrap.hasOpening(quote.valueOf(), '');

// Returns false.
Wrap.hasOpening(new Wrap(``, `]`, 'quote').valueOf(), '');
```


# static isWrap()

The method checks whether the value of any type is the Wrap instance of any or given opening and closing chars.

## `Wrap.isWrap()`

The method checks whether the [`value`](#value-any) of any type is the [`Wrap`](/wrapper-draft/wrap/overview) instance of any or given [`opening`](#opening-opening) and [`closing`](#closing-closing) chars.

{% code title="wrap.class.ts" %}

```typescript
public static isWrap<
  Opening extends string = string,
  Closing extends string = string,
  Text extends string = ``
>(
  value: any,
  opening?: Opening,
  closing?: Closing,
  text?: Text
): value is Wrap<Opening, Text, Closing> {
  return typeof value === 'object' && value instanceof this
    ? (typeof opening === 'string' ? opening === value.opening : true) &&
        (typeof closing === 'string' ? closing === value.closing : true) &&
        (typeof text === 'string' ? text === value.text : true)
    : false;
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`Opening`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`string`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`opening`](#opening-opening) indicates the `Opening` type of the [`Wrap`](/wrapper-draft/wrap/overview) instance the [return type](#return-type).

#### <mark style="color:green;">**`Closing`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`string`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`closing`](#closing-closing) indicates the `Closing` type of the [`Wrap`](/wrapper-draft/wrap/overview) instance via [return type](#return-type).

#### <mark style="color:green;">**`Text`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**` `` `**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`text`](#text-text) indicates the `Text` type of the [`Wrap`](/wrapper-draft/wrap/overview) instance via [return type](#return-type).

### Parameters

#### `value: any`

The value of [`any`](https://www.typescriptlang.org/docs/handbook/basic-types.html#any) type to test against the [`Wrap`](/wrapper-draft/wrap/overview) instance of any or given [`opening`](#opening-opening) and [`closing`](#closing-closing).

#### `opening?: Opening`

Optional opening chars of a generic type variable [`Opening`](#openingextendsstring-string) to check if the given [`value`](#value-any) contains.

#### `closing?: Closing`

Optional closing chars of a generic type variable [`Closing`](#closingextendsstring-string) to check if the given [`value`](#value-any) contains.

#### `text?: Text`

An optional text of a generic type variable [`Text`](#textextendsstring) to check if the given [`value`](#value-any) contains.

### Return type

**`value is Wrap<Opening, Text, Closing>`**

The **return type** is a [`boolean`](https://www.typescriptlang.org/docs/handbook/basic-types.html#boolean) indicating the [`value`](#value-any) parameter is an instance of [`Wrap`](/wrapper-draft/wrap/overview) that takes a generic type variable [`Opening`](#openingextendsstring-string) [`Text`](#textextendsstring) and [`Closing`](#closingextendsstring-string).

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) type indicating whether the [`value`](#value-any) is an instance of [`Wrap`](/wrapper-draft/wrap/overview) of any, or the given [`opening`](#opening-opening), [`closing`](#closing-closing), and [`text`](#text-text).

## Example usage

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

const tagWrap = new Wrap(`[`, `]`, 'quote');

// Returns true confirming the type Wrap<"[", "", "]">
Wrap.isWrap(tagWrap);

// Returns true, confirming the type Wrap<"[", "", "]">
Wrap.isWrap(tagWrap, '[', ']');

// Returns true, confirming the type Wrap<"[", "quote", "]">
Wrap.isWrap(tagWrap, '[', ']', 'quote');

// Returns true, confirming the type Wrap<"[", "", "]">
Wrap.isWrap<'[', ']'>(tagWrap, '[', ']');

// Returns false, denying the type Wrap<"[", "span", "]">
Wrap.isWrap(tagWrap, '[', ']', 'span');

// Returns false denying the value is Wrap<"(", "", ")">
Wrap.isWrap(tagWrap, '(', ')');

// Returns false denying the value is Wrap<"(", "", ")">
Wrap.isWrap<'[', ']'>(null as any);

// Returns false denying the value is Wrap<"[", "", "]">
Wrap.isWrap(null as any, '[', ']');
```


# ↓ Instance

## Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>public <a href="/pages/DO4ArQjbDGnDv1Ta74Yy"><strong>getClosing()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#closing-closing"><code>#closing</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p>public <a href="/pages/sMY677pZekEiwLxaWOT8"><strong>getOpening()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#opening-opening"><code>#opening</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p>public <a href="/pages/LoemdYYF2nsxY7XYurnU"><strong>getText()</strong></a><br>Gets the text of the wrap by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object, without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of the <a href="/pages/vlRmumtdkPHxEUrU51WO"><code>Wrap</code></a>.</p>                                                                                                                                        |
| <p>public <a href="/pages/SwVbIKxEQyWEUHmJcqB7"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars or given <a href="/pages/SwVbIKxEQyWEUHmJcqB7#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                             |
| <p>public <a href="/pages/AXIumFXCrM0Gvjvp6Ygz"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars or given <a href="/pages/AXIumFXCrM0Gvjvp6Ygz#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                             |
| <p>public <a href="/pages/EPu74cDYJe28Jt8YJlfl"><strong>hasText()</strong></a><br>The method checks whether the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object is defined, which means it's a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> of at least one char and optionally equal to the given <a href="/pages/EPu74cDYJe28Jt8YJlfl#text-string"><code>text</code></a>.</p>         |
| <p>public <a href="/pages/VDTORK00NPJgmbN7aELv"><strong>isWrapped()</strong></a><br>The method checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the specified object is wrapped by the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of an instance or given <a href="/pages/VDTORK00NPJgmbN7aELv#opening-string-this.-opening"><code>opening</code></a> and <a href="/pages/VDTORK00NPJgmbN7aELv#closing-string-this.-closing"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/VqVru4aHNREMRPPI7C7x"><strong>★ replaceClosing()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p>public <a href="/pages/zKADrcHiPoJayJd5LR4Q"><strong>★ replaceOpening()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p>public <a href="/pages/2khbXB2F6Yiq7r6I68nu"><strong>★ replaceText()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>.</p>                                                                                                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/6nAq7tnHWOAKno0FtVIY"><strong>toString()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/vlRmumtdkPHxEUrU51WO"><code>Wrap</code></a> object.</p>                                                                                                                                                                                                                                                              |
| <p>public <a href="/pages/K32cdMdrpsCcE0oMk8Ek"><strong>valueOf()</strong></a><br>Returns the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf">primitive value</a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object.</p>                                                                                                                                                                                            |


# getClosing()

Gets the closing chars of the wrap by returning the \`#closing\` property of a specified object.

## `Wrap.prototype.getClosing()`

Gets the [closing](/wrapper-draft/getting-started/basic-concepts#closing) chars of the wrap by returning the [`#closing`](/wrapper-draft/wrap/properties/closing) property of a specified object.

{% code title="wrap.class.ts" %}

```typescript
public getClosing(): Closing {
  return this.#closing;
}
```

{% endcode %}

### Returns

The **return value** is [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of a generic type variable [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).

## Example usage

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

// Returns ] of type "]".
new Wrap(`[`, `]`).getClosing();
```


# getOpening()

Gets the opening chars of the wrap by returning the #opening property of a specified object.

## `Wrap.prototype.getOpening()`

Gets the [opening](/wrapper-draft/getting-started/basic-concepts#opening) chars of the wrap by returning the [`#opening`](/wrapper-draft/wrap/properties/opening) property of a specified object.

{% code title="wrap.class.ts" %}

```typescript
public getOpening(): Opening {
  return this.#opening;
}
```

{% endcode %}

### Returns

The **return value** is [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars of a generic type variable [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening).

## Example usage

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

// Returns [ of type "[".
new Wrap(`[`, `]`, 'quote').getOpening();
```


# 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.

## `Wrap.prototype.getText()`

Gets the text of the wrap by returning the [`#text`](/wrapper-draft/wrap/properties/text) property of a specified object, without the [opening](/wrapper-draft/wrap/accessors/get-opening) and [closing](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrap`](/wrapper-draft/wrap/overview).

{% code title="wrap.class.ts" %}

```typescript
public getText(): Text {
  return this.#text;
}
```

{% endcode %}

### Returns

The **return value** is the [`text`](/wrapper-draft/wrap/accessors/get-text) of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than).

## Example usage

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

// Returns quote of type "quote".
new Wrap(`[`, `]`, 'quote').getText();
```


# hasClosing()

Checks whether the primitive value of a specified object has the closing chars or given closing chars.

## `Wrap.prototype.hasClosing()`

Checks whether the [primitive value](/wrapper-draft/wrap/methods/valueof) of a specified object has the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars or given [`closing`](#closing-string) chars.

{% hint style="info" %}
If given `closing` chars in the constructor are the **empty** `string`, the method returns **`false`**.
{% endhint %}

{% code title="wrap.class.ts" %}

```typescript
public hasClosing(closing?: string): boolean {
  return (
    this.#closing.length >= 1 &&
    (typeof closing === 'string' ? this.#closing === closing : true)
  );
}
```

{% endcode %}

### Parameters

#### `closing?: string`

Optional closing chars of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to check whether the [primitive value](/wrapper-draft/wrap/methods/valueof) contains them at the **end**.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the [primitive value](/wrapper-draft/wrap/methods/valueof) has the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars or given [`closing`](#closing-string) chars.

## Example usage

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

// Returns true.
new Wrap(`[`, `]`, 'quote').hasClosing();

// Returns false.
new Wrap(`[`, ``, 'quote').hasClosing();
```

### Given `closing` chars

```typescript
// Example usage of given closing chars.
import { Wrap } from '@angular-package/wrapper';

// Returns true.
new Wrap(`[`, `]`, 'quote').hasClosing(']');

// Returns false.
new Wrap(`[`, `]`, 'quote').hasClosing('');

// Returns false.
new Wrap(`[`, ``, 'quote').hasClosing('');

// Returns false.
new Wrap(`[`, ``, 'quote').hasClosing(']');
```


# hasOpening()

Checks whether the primitive value of a specified object has the opening chars or given opening chars.

## `Wrap.prototype.hasOpening()`

Checks whether the [primitive value](/wrapper-draft/wrap/methods/valueof) of a specified object has the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars or given [`opening`](#opening-string) chars.

{% hint style="info" %}
If given `opening` chars in the constructor are the **empty** `string`, the method returns **`false`**.
{% endhint %}

{% code title="wrap.class.ts" %}

```typescript
public hasOpening(opening?: string): boolean {
  return (
    this.#opening.length >= 1 &&
    (typeof opening === 'string' ? this.#opening === opening : true)
  );
}
```

{% endcode %}

### Parameters

#### `opening?: string`

Optional opening chars of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to check if the [primitive value](/wrapper-draft/wrap/methods/valueof) contains them at the **beginning**.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the [primitive value](/wrapper-draft/wrap/methods/valueof) has the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars or given [`opening`](#opening-string) chars.

## Example usage

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

// Returns true.
new Wrap(`[`, `]`, 'quote').hasOpening();

// Returns false.
new Wrap(``, `]`, 'quote').hasOpening();
```

### Given `closing` chars

```typescript
// Example usage of given opening chars.
import { Wrap } from '@angular-package/wrapper';

// Returns true.
new Wrap(`[`, `]`, 'quote').hasOpening('[');

// Returns false.
new Wrap(`[`, `]`, 'quote').hasOpening('');

// Returns false.
new Wrap(``, `]`, 'quote').hasOpening('');

// Returns false.
new Wrap(``, `]`, 'quote').hasOpening('[');
```


# 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.

## `Wrap.prototype.hasText()`

The method checks whether the [`text`](/wrapper-draft/wrap/accessors/get-text) of a specified [`Wrap`](/wrapper-draft/wrap/overview) object is defined, which means it's a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) of at least one char and optionally equal to the given [`text`](#text-string).

{% code title="wrap.class.ts" %}

```typescript
public hasText(text?: string): boolean {
  return (
    this.#text.length >= 1 &&
    (typeof text === 'string' ? this.#text === text : true)
  );
}
```

{% endcode %}

### Parameters

#### `text`?`: string`

Optional text of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to check whether it's equal to the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrap`](/wrapper-draft/wrap/overview) object.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the [`text`](/wrapper-draft/wrap/accessors/get-text) is defined and optionally equal to the given [`text`](#text-string).

## Example usage

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

// Returns true.
new Wrap(`[`, `]`, 'quote').hasText();

// Returns false.
new Wrap(`[`, `]`).hasText();

// Returns false.
new Wrap(`[`, `]`, '').hasText();
```

### Given `text`

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

// Returns true.
new Wrap(`[`, `]`, 'quote').hasText('quote');

// Returns false.
new Wrap(`[`, `]`, '').hasText('');
```


# 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.

## `Wrap.prototype.isWrapped()`

The method checks whether the [primitive value](/wrapper-draft/wrap/methods/valueof) of the specified object is wrapped by the [opening](/wrapper-draft/wrap/accessors/get-opening) and [closing](/wrapper-draft/wrap/accessors/get-closing) chars of an instance or given [`opening`](#opening-string-this.-opening) and [`closing`](#closing-string-this.-closing) chars.

{% hint style="info" %}
If given `opening` or `closing` chars in the constructor are the **empty** `string`, the method returns **`false`**.
{% endhint %}

{% code title="wrap.class.ts" %}

```typescript
public isWrapped(
  opening: string = this.#opening,
  closing: string = this.#closing
): boolean {
  return this.hasOpening(opening) && this.hasClosing(closing);
}
```

{% endcode %}

### Parameters

#### `opening: string = this.#opening`

Optional opening chars of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to check if the [primitive value](/wrapper-draft/wrap/methods/valueof) contains them at the **beginning**. The default value is picked from the private [`#opening`](/wrapper-draft/wrap/properties/opening) property of an instance.

#### `closing: string = this.#closing`

Optional closing chars of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to check if the [primitive value](/wrapper-draft/wrap/methods/valueof) contains them at the **end**. The default value is picked from the private [`#closing`](/wrapper-draft/wrap/properties/closing) property of an instance.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the object has both [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars or given [`opening`](#opening-string-this.-opening) and [`closing`](#closing-string-this.-closing) chars.

## Example usage

### Basic

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

// Returns true. Checks `[]`.
new Wrap(`[`, `]`, 'quote').isWrapped();

// Returns false.
// It's not wrapped cause of opening chars are an empty string.
new Wrap(``, `]`, 'quote').isWrapped();

// Returns false.
// It's not wrapped cause of closing chars are an empty string.
new Wrap(`[`, ``, 'quote').isWrapped();

// Returns false.
new Wrap(``, ``, 'quote').isWrapped();
```

### Given `opening`

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

// Returns true. Checks `[]`.
new Wrap(`[`, `]`, 'quote').isWrapped('[');

// Returns false.
new Wrap(`[`, `]`, 'quote').isWrapped('[', '');

// Returns false. Checks `<]`.
new Wrap(`[`, `]`, 'quote').isWrapped('<');

// Returns false.
// It's not wrapped cause of opening chars are an empty string.
new Wrap(``, `]`, 'quote').isWrapped('<');

// Returns false.
// It's not wrapped cause of closing chars are an empty string.
new Wrap(`[`, ``, 'quote').isWrapped('[');

// Returns false.
// It's not wrapped cause of closing chars are an empty string.
new Wrap(`[`, ``, 'quote').isWrapped('[', ''),
```

### Given `closing`

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

// Returns true. Checks `[]`.
new Wrap(`[`, `]`, 'quote').isWrapped(undefined, ']');

// Returns false. Checks `[>`.
new Wrap(`[`, `]`, 'quote').isWrapped(undefined, '>');

// Returns false.
// It's not wrapped cause of opening chars are an empty string.
new Wrap(``, `]`, 'quote').isWrapped(undefined, ']');

// Returns false.
// It's not wrapped cause of opening chars are an empty string.
new Wrap(``, `]`, 'quote').isWrapped(``, ']');
```

### Given `opening` and `closing` chars

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

// Returns false.
new Wrap(`[`, `]`, 'quote').isWrapped('[', ']');

// Returns false.
new Wrap(`[`, `]`, 'quote').isWrapped('[', '>');

// Returns false.
new Wrap(`[`, `]`, 'quote').isWrapped('<', ']');

// Returns false.
new Wrap(`[`, `]`, 'quote').isWrapped('<', '>');

// Returns false.
new Wrap(``, ``, 'quote').isWrapped('', '');
```


# ★ replaceClosing()

Returns the primitive value with replaced closing chars.

## `Wrap.prototype.replaceClosing()`

Returns the [primitive value](/wrapper-draft/wrap/methods/valueof) with replaced [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars.

{% code title="wrap.class.ts" %}

```typescript
public replaceClosing<ReplaceClosing extends string = ''>(
  closing: ReplaceClosing
): `${Opening}${Text}${ReplaceClosing}` {
  return `${this.#opening}${this.#text}${String(closing) as ReplaceClosing}`;
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`ReplaceClosing`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`''`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`closing`](#closing-replaceclosing) indicates the `ReplaceClosing` type on the template of the [return type](#return-type).

### Parameters

#### `closing: replaceClosing`

The closing chars of a generic type variable [`ReplaceClosing`](#replaceclosingextendsstring) to replace the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars in the [primitive value](/wrapper-draft/wrap/methods/valueof).

### Return type

#### `${Opening}${Text}${ReplaceClosing}`

The **return type** is [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`ReplaceClosing`](#replaceclosingextendsstring).

### Returns

The **return value** is the [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf) with replaced [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of a generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`ReplaceClosing`](#replaceclosingextendsstring) on the template.

## Example usage

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

// Returns [quote}} of type "[quote}}".
new Wrap(`[`, `]`, 'quote').replaceClosing('}}');

// Returns [quote}} of "[quote}}".
new Wrap(`[`, ``, 'quote').replaceClosing('}}');

// Returns [quote> of "[quote>".
new Wrap(`[`, ``, 'quote').replaceClosing('>');
```


# ★ replaceOpening()

Returns the primitive value with replaced opening chars.

## `Wrap.prototype.replaceOpening()`

Returns the [primitive value](/wrapper-draft/wrap/methods/valueof) with replaced [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars.

{% code title="wrap.class.ts" %}

```typescript
public replaceOpening<ReplaceOpening extends string = ''>(
  opening: ReplaceOpening
): `${ReplaceOpening}${Text}${Closing}` {
  return `${opening}${this.#text}${this.#closing}`;
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`ReplaceOpening`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`''`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`opening`](#opening-replaceopening) indicates the `ReplaceOpening` type on the template of the [return type](#return-type).

### Parameters

#### `opening: ReplaceOpening`

The opening chars of a generic type variable [`ReplaceOpening`](#replaceopeningextendsstring) to replace the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars in the [primitive value](/wrapper-draft/wrap/methods/valueof).

### Return type

#### `${ReplaceOpening}${Text}${Closing}`

The **return type** is the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`ReplaceOpening`](#replaceopeningextendsstring), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).

### Returns

The **return value** is the [primitive value](/wrapper-draft/wrap/methods/valueof) with replaced [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars of a generic type variables in order [`ReplaceOpening`](#replaceopeningextendsstring), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing) on the template.

## Example usage

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

// Returns {{quote] of type "{{quote]".
new Wrap(`[`, `]`, 'quote').replaceOpening('{{');

// Returns {{quote] of "{{quote]".
new Wrap(``, `]`, 'quote').replaceOpening('{{');

// Returns <quote] of "<quote]".
new Wrap(``, `]`, 'quote').replaceOpening('<');
```


# ★ replaceText()

Returns the primitive value with replaced text.

## `Wrap.prototype.replaceText()`

Returns the [primitive value](/wrapper-draft/wrap/methods/valueof) with replaced [`text`](/wrapper-draft/wrap/accessors/get-text).

{% code title="wrap.class.ts" %}

```typescript
public replaceText<ReplaceText extends string = ''>(
  text: ReplaceText
): `${Opening}${ReplaceText}${Closing}` {
  return `${this.#opening}${text}${this.#closing}`;
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`ReplaceText`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`''`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`text`](#text-replacetext) indicates the `ReplaceText` type on the template of the [return type](#return-type).

### Parameters

#### `text: ReplaceText`

The text of a generic type variable [`ReplaceText`](#replacetext-extends-string) to replace the [`text`](/wrapper-draft/wrap/accessors/get-text) in the [primitive value](/wrapper-draft/wrap/methods/valueof).

### Return type

#### `${Opening}${ReplaceText}${Closing}`

The **return type** is the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`ReplaceText`](#replacetextextendsstring) and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).&#x20;

### Returns

The **return value** is the [primitive value](/wrapper-draft/wrap/methods/valueof) with replaced [`text`](/wrapper-draft/wrap/accessors/get-text) of a generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`ReplaceText`](#replacetextextendsstring) and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing) on the template.

## Example usage

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

// Returns [span] of type "[span]".
new Wrap(`[`, `]`, 'quote').replaceText('span');

// Returns [bold] of "[bold]".
new Wrap(`[`, `]`, '').replaceText('bold');

// Returns [u] of "[u]".
new Wrap(`[`, `]`).replaceText('u');

// Returns size] of "size]".
new Wrap(``, `]`).replaceText('size');

// Returns [size of "[size".
new Wrap(`[`, ``).replaceText('size');
```


# toString()

Gets the wrap, the primitive value of a specified Wrap object.

## `Wrap.prototype.toString()`

Gets the [wrap](/wrapper-draft/getting-started/basic-concepts#wrap), the [primitive value](/wrapper-draft/wrap/methods/valueof) of a specified [`Wrap`](/wrapper-draft/wrap/overview) object.

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toString>" %}

{% code title="wrap.class.ts" %}

```typescript
public toString(): `${Opening}${Text}${Closing}` {
  return super.toString() as `${Opening}${Text}${Closing}`;
}
```

{% endcode %}

### Return type

#### `${Opening}${Text}${Closing}`

The **return type** is the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).

### Returns

The **return value** is the wrap of generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than), and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing) on the template.

## Example usage

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

// Returns [quote] of type "[quote]".
new Wrap(`[`, `]`, 'quote').toString();
```


# valueOf()

Returns the wrap, primitive value of a specified Wrap object.

## `Wrap.prototype.valueOf()`

Returns the [wrap](/wrapper-draft/getting-started/basic-concepts#wrap), [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf) of a specified [`Wrap`](/wrapper-draft/wrap/overview) object.

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf>" %}

{% code title="wrap.class.ts" %}

```typescript
public valueOf(): `${Opening}${Text}${Closing}` {
  return super.valueOf() as `${Opening}${Text}${Closing}`;
}
```

{% endcode %}

### Return type

#### `${Opening}${Text}${Closing}`

The **return type** is the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing).

### Returns

The **return value** is the wrap of generic type variables in order [`Opening`](/wrapper-draft/wrap/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrap/methods/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than), and [`Closing`](/wrapper-draft/wrap/generic-type-variables#wrap-closing) on the template.

## Example usage

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

// Returns [quote] of type "[quote]".
new Wrap(`[`, `]`, 'quote').valueOf();
```


# Example usage

## BBCode tag

Let's create a wrap for the BBCode tag.

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

// Let's create a BBCode wrap.
class BBCode<Name extends string> extends Wrap<`[`, Name, `]`> {
  constructor(name: Name) {
    super(`[`, `]`, name);
  }
}

// Make a [quote] BBCode tag. Returns BBCode {'[quote]'} of type BBCode<"quote">
const quoteTag = new BBCode('quote');

quoteTag.opening; // Returns [
quoteTag.closing; // Returns ]
quoteTag.text; // Returns quote
quoteTag.valueOf(); // Returns [quote]
quoteTag.getClosing();  // Returns [
quoteTag.getOpening(); // Returns ]
quoteTag.getText();  // Returns quote

// Make a [img] BBCode tag. Returns BBCode {'[img]'} of type BBCode<"img">
const imgTag = new BBCode('img');
```

## Html tag

Let's create a wrap for the HTML tag.

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

// Let's create a Html wrap.
class Html<Name extends string> extends Wrap<`<`, Name, `>`> {
  constructor(name: Name) {
    super(`<`, `>`, name);
  }
}

// Make a <span> Html tag. Returns Html{'<span>'} of type Html<"span">
const spanTag = new Html('span');
spanTag.opening; // Returns <
spanTag.closing; // Returns >
spanTag.text; // Returns span
spanTag.valueOf(); // Returns <span>
spanTag.getClosing();  // Returns <
spanTag.getOpening(); // Returns >
spanTag.getText();  // Returns <span>

// Make a <img> Html tag. Returns Html{'<img>'} of type Html<"img">
const imgTag = new Html('img');
```


# Overview

## Wrapper {}

The [`Wrapper`](https://github.com/angular-package/wrapper/blob/main/src/lib/wrapper.class.ts) is an extension of the [`Wrap`](/wrapper-draft/wrap/overview) object, which means it represents the [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) wrap of the [opening](/wrapper-draft/getting-started/basic-concepts#opening) and [closing](/wrapper-draft/getting-started/basic-concepts#closing) with the additional main ability to use it to wrap strings.&#x20;

{% embed url="<https://github.com/angular-package/wrapper/blob/main/src/lib/wrapper.class.ts>" %}

## Instance

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/dIt0LA2PkvJjanvPskVn#symbol.tostringtag"><strong>​\[Symbol.toStringTag]</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrapper</code>.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public <a href="/pages/d21qDnBfyU77dU1rfFqm"><strong>isClosingIn()</strong></a><br>Determines whether the provided <a href="/pages/d21qDnBfyU77dU1rfFqm#text-string"><code>text</code></a> has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>end</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/IBwPUqKOAFDqfubAkCGH"><strong>isOpeningIn()</strong></a><br>Checks whether the provided <a href="/pages/IBwPUqKOAFDqfubAkCGH#text-string"><code>text</code></a> has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>beginning</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/9YbldIwnBrRHuqRn3Ekr"><strong>replaceClosingIn()</strong></a><br>Replaces the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object in the given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#text-string"><code>text</code></a> with a given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                                          |
| <p>public <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string"><strong>replaceOpeningIn()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#text-string"><code>text</code></a> with a given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                      |
| <p>public <a href="/pages/WVpq8VTHOJozPS19D6NM"><strong>removeWrapIn()</strong></a><br>Returns given <a href="/pages/WVpq8VTHOJozPS19D6NM#text-string"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/yJLLsLxEoVvdfSws5cFN"><strong>textReplaceClosing()</strong></a><br>Replaces the <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/yJLLsLxEoVvdfSws5cFN#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                |
| <p>public <a href="/pages/N7aDbyfgseigOkMY27ej"><strong>textReplaceOpening()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/N7aDbyfgseigOkMY27ej#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/zP95dShqIpnoCQ6qbOps"><strong>textUnwrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object without its <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.opening"><code>opening</code></a> and <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars or the given <a href="#opening-string"><code>opening</code></a> and <a href="#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                  |
| <p>public <a href="/pages/RieQNAg5fhTZm6EdBuIf"><strong>textWrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object wrapped by the given <a href="/pages/RieQNAg5fhTZm6EdBuIf#opening-textopening"><code>opening</code></a> and <a href="/pages/RieQNAg5fhTZm6EdBuIf#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                              |
| <p>public <a href="/pages/0bfdKmmJzsCWEBghlZSH"><strong>toArray()</strong></a><br>Returns an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"><code>array</code></a> consisting of the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars, <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/DsvHxsxvwveQscLtP0ZI"><strong>toWrap()</strong></a><br>Returns the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> instance consists of the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                  |
| <p>public <a href="/pages/J4YBGUI01fGt5Mk2oESt"><strong>unwrap()</strong></a><br>Returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p>public <a href="/pages/P82XvzmtBw8jttgtZaG3"><strong>unwrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> unwrapped from the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance or given <a href="/pages/P82XvzmtBw8jttgtZaG3#opening-string"><code>opening</code></a> and <a href="/pages/P82XvzmtBw8jttgtZaG3#closing-string"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/bVYiVYIgClIeuiRUmLQi"><strong>★ wrap()</strong></a><br>The method wraps the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object by its <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars, or the given <a href="/pages/bVYiVYIgClIeuiRUmLQi#opening-customopening"><code>opening</code></a> and <a href="/pages/bVYiVYIgClIeuiRUmLQi#closing-customclosing"><code>closing</code></a> chars.</p>                                                                                                                                                |
| <p>public <a href="/pages/HA4KMgni3JQhmXjFbfIa"><strong>★ wrapOn()</strong></a><br>The method wraps the given <a href="/pages/HA4KMgni3JQhmXjFbfIa#text-customtext"><code>text</code></a> with the wrap, the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/AO2JRfFReB5un4hz9RZ4"><strong>★ wrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> wrapped by given <a href="/pages/AO2JRfFReB5un4hz9RZ4#opening-textopening"><code>opening</code></a> and <a href="/pages/AO2JRfFReB5un4hz9RZ4#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                 |

## public Static

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/pages/LdfMlqMjsIsAnp4HA2j4"><strong>define()</strong></a><br>Defines a new <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance with the provided <a href="/pages/LdfMlqMjsIsAnp4HA2j4#opening-opening"><code>opening</code></a>, <a href="/pages/LdfMlqMjsIsAnp4HA2j4#closing-closing"><code>closing</code></a> chars, and optional <a href="/pages/LdfMlqMjsIsAnp4HA2j4#text-text"><code>text</code></a>.</p>                                                                                                     |
| <p>public static <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD"><strong>isWrapper()</strong></a><br>The method checks if the <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#value-any"><code>value</code></a> of any type is an instance of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> of any, or given <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#opening-opening"><code>opening</code></a>, <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#closing-closing"><code>closing</code></a> chars, and <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#text-text"><code>text</code></a>.</p> |
| <p>public static <a href="/pages/WujORpjDCkwlen8RXp9y"><strong>replaceClosing()</strong></a><br>Replaces given <a href="/pages/WujORpjDCkwlen8RXp9y#closing-string"><code>closing</code></a> chars with a given <a href="/pages/WujORpjDCkwlen8RXp9y#replacevalue-string">replacement value</a> at the end of the given <a href="/pages/WujORpjDCkwlen8RXp9y#text-string"><code>text</code></a>.</p>                                                                                                                                                              |
| <p>public static <a href="/pages/s59NO2tosKIlfFAKOlMk"><strong>replaceOpening()</strong></a><br>Replaces given <a href="/pages/s59NO2tosKIlfFAKOlMk#opening-string"><code>opening</code></a> chars with a given <a href="/pages/s59NO2tosKIlfFAKOlMk#replacevalue-string">replacement value</a> at the beginning of the given <a href="/pages/s59NO2tosKIlfFAKOlMk#text-string"><code>text</code></a>.</p>                                                                                                                                                        |
| <p>public static <a href="/pages/T1V7Dv14L1UkuelGTN26"><strong>unwrap()</strong></a><br>The method returns the given <a href="/pages/T1V7Dv14L1UkuelGTN26#text-string"><code>text</code></a> without the given <a href="/pages/T1V7Dv14L1UkuelGTN26#opening-string"><code>opening</code></a> and <a href="/pages/T1V7Dv14L1UkuelGTN26#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                         |


# Generic type variables

## `Wrapper<`<mark style="color:green;background-color:green;">`Opening`</mark>`,Text,Closing>` <a href="#wrap-opening" id="wrap-opening"></a>

#### <mark style="color:green;">**`Opening`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`string`**</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value captured from the provided [`opening`](/wrapper-draft/wrapper/constructor#opening-opening) indicates the opening type of a new [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

{% code title="wrapper.class.ts" %}

```typescript
class Wrapper<
  Opening extends string = string, // <--- Declare generic type variable Opening.
  Text extends string = '',
  Closing extends string = string
> extends Wrap<Opening, Text, Closing> {
  ...
  constructor(
    opening: Opening, // <--- Capture generic type variable Opening.
    closing: Closing,
    text: Text = '' as Text
  ) {
    super(opening, closing, text);
  }
  ...
}
```

{% endcode %}

## `Wrapper<Opening,`<mark style="color:green;background-color:green;">`Text`</mark>`,Closing>`

#### <mark style="color:green;">**`Text`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`''`**</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value captured from the provided [`text`](/wrapper-draft/wrapper/constructor#text-text) indicates the text type of a new [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

{% code title="wrapper.class.ts" %}

```typescript
class Wrapper<
  Opening extends string = string,
  Text extends string = '', // <--- Declare generic type variable Text.
  Closing extends string = string
> extends Wrap<Opening, Text, Closing> {
  ...
  constructor(
    opening: Opening,
    closing: Closing,
    text: Text = '' as Text // <--- Capture generic type variable Text.
  ) {
    super(opening, closing, text);
  }
  ...
}
```

{% endcode %}

## `Wrapper<Opening,Text,`<mark style="color:green;background-color:green;">`Closing`</mark>`>` <a href="#wrap-closing" id="wrap-closing"></a>

#### <mark style="color:green;">**`Closing`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>**`=`**<mark style="color:green;">**`string`**</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value captured from the provided [`closing`](/wrapper-draft/wrapper/constructor#closing-closing) indicates the closing type of a new [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

{% code title="wrapper.class.ts" %}

```typescript
class Wrapper<
  Opening extends string = string,
  Text extends string = '',
  Closing extends string = string // <--- Declare generic type variable Closing.
> extends Wrap<Opening, Text, Closing> {
  ...
  constructor(
    opening: Opening,
    closing: Closing, // <--- Capture generic type variable Closing.
    text: Text = '' as Text
  ) {
    super(opening, closing, text);
  }
  ...
}
```

{% endcode %}


# Constructor

## `Wrapper()`

Creates a new [`Wrapper`](/wrapper-draft/wrapper/overview) instance with the [`opening`](#opening-opening) and [`closing`](#closing-closing) chars and optional [`text`](#text-text).

{% code title="wrapper.class.ts" %}

```typescript
constructor(opening: Opening, closing: Closing, text: Text = '' as Text) {
  super(opening, closing, text);
}
```

{% endcode %}

### Parameters

#### `opening:`[<mark style="color:green;">`Opening`</mark>](/wrapper-draft/wrapper/generic-type-variables#wrap-opening)

The **opening** chars of a generic type variable [`Opening`](/wrapper-draft/wrapper/generic-type-variables#wrap-opening) placed before the given [`text`](#text-text).

#### `closing:`[<mark style="color:green;">`Closing`</mark>](/wrapper-draft/wrapper/generic-type-variables#closingextendsstring-string)

The **closing** chars of a generic type variable [`Closing`](/wrapper-draft/wrapper/generic-type-variables#wrap-closing) placed after the given [`text`](#text-text).

#### `text:`[<mark style="color:green;">`Text`</mark>](https://wrapper.angular-package.dev/wrapper-draft/wrapper/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than)

Optional **text** of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than) to wrap by given [`opening`](#opening-opening) and [`closing`](#closing-closing) chars.

### Returns

The **return value** is a new instance of [`Wrapper`](/wrapper-draft/wrapper/overview).

## Example usage

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

// Returns Wrapper {'{{}}'} of type Wrapper<"{{", "", "}}">
new Wrapper(`{{`, `}}`);

// Returns Wrapper {'{{variable}}'} of type Wrapper<"{{", "variable", "}}">
new Wrapper(`{{`, `}}`, 'variable');

// Returns Wrapper {'nullnull'} of typr Wrapper<any, "", any>
new Wrapper(null as any, null as any);
```


# Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public get <strong>​</strong><a href="/pages/dIt0LA2PkvJjanvPskVn"><strong>[Symbol.toStringTag](https://wrapper.angular-package.dev/wrapper-draft/wrapper): </strong><mark style="color:green;"><strong>string</strong></mark></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrapper</code>.</p> |


# get \[Symbol.toStringTag]\()

## `[Symbol.toStringTag]`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor [`toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) of the [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) changes the default tag `String` of the instance to the custom tag `Wrapper`. It can be read by the [`typeOf()`](https://type.angular-package.dev/v/type-draft/helper/typeof) function of [`@angular-package/type`](https://type.angular-package.dev/).

{% code title="wrapper.class.ts" %}

```typescript
public get [Symbol.toStringTag](): string {
  return 'Wrapper';
}
```

{% endcode %}

## Example usage

```typescript
// 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);
```


# Methods

## Static

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/pages/LdfMlqMjsIsAnp4HA2j4"><strong>define()</strong></a><br>Defines a new <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance with the provided <a href="/pages/LdfMlqMjsIsAnp4HA2j4#opening-opening"><code>opening</code></a>, <a href="/pages/LdfMlqMjsIsAnp4HA2j4#closing-closing"><code>closing</code></a> chars, and optional <a href="/pages/LdfMlqMjsIsAnp4HA2j4#text-text"><code>text</code></a>.</p>                                                                                                     |
| <p>public static <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD"><strong>isWrapper()</strong></a><br>The method checks if the <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#value-any"><code>value</code></a> of any type is an instance of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> of any, or given <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#opening-opening"><code>opening</code></a>, <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#closing-closing"><code>closing</code></a> chars, and <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#text-text"><code>text</code></a>.</p> |
| <p>public static <a href="/pages/WujORpjDCkwlen8RXp9y"><strong>replaceClosing()</strong></a><br>Replaces given <a href="/pages/WujORpjDCkwlen8RXp9y#closing-string"><code>closing</code></a> chars with a given <a href="/pages/WujORpjDCkwlen8RXp9y#replacevalue-string">replacement value</a> at the end of the given <a href="/pages/WujORpjDCkwlen8RXp9y#text-string"><code>text</code></a>.</p>                                                                                                                                                              |
| <p>public static <a href="/pages/s59NO2tosKIlfFAKOlMk"><strong>replaceOpening()</strong></a><br>Replaces given <a href="/pages/s59NO2tosKIlfFAKOlMk#opening-string"><code>opening</code></a> chars with a given <a href="/pages/s59NO2tosKIlfFAKOlMk#replacevalue-string">replacement value</a> at the beginning of the given <a href="/pages/s59NO2tosKIlfFAKOlMk#text-string"><code>text</code></a>.</p>                                                                                                                                                        |
| <p>public static <a href="/pages/T1V7Dv14L1UkuelGTN26"><strong>unwrap()</strong></a><br>The method returns the given <a href="/pages/T1V7Dv14L1UkuelGTN26#text-string"><code>text</code></a> without the given <a href="/pages/T1V7Dv14L1UkuelGTN26#opening-string"><code>opening</code></a> and <a href="/pages/T1V7Dv14L1UkuelGTN26#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                         |

## Instance

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public <a href="/pages/d21qDnBfyU77dU1rfFqm"><strong>isClosingIn()</strong></a><br>Determines whether the provided <a href="/pages/d21qDnBfyU77dU1rfFqm#text-string"><code>text</code></a> has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>end</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/IBwPUqKOAFDqfubAkCGH"><strong>isOpeningIn()</strong></a><br>Checks whether the provided <a href="/pages/IBwPUqKOAFDqfubAkCGH#text-string"><code>text</code></a> has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>beginning</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/9YbldIwnBrRHuqRn3Ekr"><strong>replaceClosingIn()</strong></a><br>Replaces the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object in the given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#text-string"><code>text</code></a> with a given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                                          |
| <p>public <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string"><strong>replaceOpeningIn()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#text-string"><code>text</code></a> with a given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                      |
| <p>public <a href="/pages/WVpq8VTHOJozPS19D6NM"><strong>removeWrapIn()</strong></a><br>Returns given <a href="/pages/WVpq8VTHOJozPS19D6NM#text-string"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/yJLLsLxEoVvdfSws5cFN"><strong>textReplaceClosing()</strong></a><br>Replaces the <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/yJLLsLxEoVvdfSws5cFN#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                |
| <p>public <a href="/pages/N7aDbyfgseigOkMY27ej"><strong>textReplaceOpening()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/N7aDbyfgseigOkMY27ej#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/zP95dShqIpnoCQ6qbOps"><strong>textUnwrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object without its <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.opening"><code>opening</code></a> and <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars or the given <a href="#opening-string"><code>opening</code></a> and <a href="#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                  |
| <p>public <a href="/pages/RieQNAg5fhTZm6EdBuIf"><strong>textWrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object wrapped by the given <a href="/pages/RieQNAg5fhTZm6EdBuIf#opening-textopening"><code>opening</code></a> and <a href="/pages/RieQNAg5fhTZm6EdBuIf#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                              |
| <p>public <a href="/pages/0bfdKmmJzsCWEBghlZSH"><strong>toArray()</strong></a><br>Returns an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"><code>array</code></a> consisting of the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars, <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/DsvHxsxvwveQscLtP0ZI"><strong>toWrap()</strong></a><br>Returns the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> instance consists of the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                  |
| <p>public <a href="/pages/J4YBGUI01fGt5Mk2oESt"><strong>unwrap()</strong></a><br>Returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p>public <a href="/pages/P82XvzmtBw8jttgtZaG3"><strong>unwrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> unwrapped from the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance or given <a href="/pages/P82XvzmtBw8jttgtZaG3#opening-string"><code>opening</code></a> and <a href="/pages/P82XvzmtBw8jttgtZaG3#closing-string"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/bVYiVYIgClIeuiRUmLQi"><strong>★ wrap()</strong></a><br>The method wraps the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object by its <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars, or the given <a href="/pages/bVYiVYIgClIeuiRUmLQi#opening-customopening"><code>opening</code></a> and <a href="/pages/bVYiVYIgClIeuiRUmLQi#closing-customclosing"><code>closing</code></a> chars.</p>                                                                                                                                                |
| <p>public <a href="/pages/HA4KMgni3JQhmXjFbfIa"><strong>★ wrapOn()</strong></a><br>The method wraps the given <a href="/pages/HA4KMgni3JQhmXjFbfIa#text-customtext"><code>text</code></a> with the wrap, the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/AO2JRfFReB5un4hz9RZ4"><strong>★ wrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> wrapped by given <a href="/pages/AO2JRfFReB5un4hz9RZ4#opening-textopening"><code>opening</code></a> and <a href="/pages/AO2JRfFReB5un4hz9RZ4#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                 |


# ↓ Static

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public static <a href="/pages/LdfMlqMjsIsAnp4HA2j4"><strong>define()</strong></a><br>Defines a new <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance with the provided <a href="/pages/LdfMlqMjsIsAnp4HA2j4#opening-opening"><code>opening</code></a>, <a href="/pages/LdfMlqMjsIsAnp4HA2j4#closing-closing"><code>closing</code></a> chars, and optional <a href="/pages/LdfMlqMjsIsAnp4HA2j4#text-text"><code>text</code></a>.</p>                                                                                                     |
| <p>public static <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD"><strong>isWrapper()</strong></a><br>The method checks if the <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#value-any"><code>value</code></a> of any type is an instance of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> of any, or given <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#opening-opening"><code>opening</code></a>, <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#closing-closing"><code>closing</code></a> chars, and <a href="/pages/qQhlZJ2CQYnZ1ZOU7zkD#text-text"><code>text</code></a>.</p> |
| <p>public static <a href="/pages/WujORpjDCkwlen8RXp9y"><strong>replaceClosing()</strong></a><br>Replaces given <a href="/pages/WujORpjDCkwlen8RXp9y#closing-string"><code>closing</code></a> chars with a given <a href="/pages/WujORpjDCkwlen8RXp9y#replacevalue-string">replacement value</a> at the end of the given <a href="/pages/WujORpjDCkwlen8RXp9y#text-string"><code>text</code></a>.</p>                                                                                                                                                              |
| <p>public static <a href="/pages/s59NO2tosKIlfFAKOlMk"><strong>replaceOpening()</strong></a><br>Replaces given <a href="/pages/s59NO2tosKIlfFAKOlMk#opening-string"><code>opening</code></a> chars with a given <a href="/pages/s59NO2tosKIlfFAKOlMk#replacevalue-string">replacement value</a> at the beginning of the given <a href="/pages/s59NO2tosKIlfFAKOlMk#text-string"><code>text</code></a>.</p>                                                                                                                                                        |
| <p>public static <a href="/pages/T1V7Dv14L1UkuelGTN26"><strong>unwrap()</strong></a><br>The method returns the given <a href="/pages/T1V7Dv14L1UkuelGTN26#text-string"><code>text</code></a> without the given <a href="/pages/T1V7Dv14L1UkuelGTN26#opening-string"><code>opening</code></a> and <a href="/pages/T1V7Dv14L1UkuelGTN26#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                         |


# static define()

## `Wrapper.define()`

Defines a new [`Wrapper`](/wrapper-draft/wrapper/overview) instance with the provided [`opening`](#opening-opening), [`closing`](#closing-closing) chars, and optional [`text`](#text-text).

{% code title="wrapper.class.ts" %}

```typescript
public static define<
  Opening extends string,
  Closing extends string,
  Text extends string = ''
>(
  opening: Opening,
  closing: Closing,
  text?: Text
): Wrapper<Opening, Text, Closing> {
  return new this(opening, closing, text);
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`Opening`**</mark>**`extends`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`opening`](#opening-opening) indicates the type of the opening in the [`Wrapper`](/wrapper-draft/wrapper/overview) via [return type](#return-type).

#### <mark style="color:green;">**`Closing`**</mark>**`extends`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`closing`](#closing-closing) indicates the type of the closing in the [`Wrapper`](/wrapper-draft/wrapper/overview) via [return type](#return-type).

#### <mark style="color:green;">**`Text`**</mark>**`extends`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)**`=`**<mark style="color:green;">**`''`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`text`](#text-text) indicates the type of the text in the [`Wrapper`](/wrapper-draft/wrapper/overview) via [return type](#return-type).

### Parameters

#### `opening:`[<mark style="color:green;">`Opening`</mark>](#openingextendsstring)

The **opening** chars of generic type variable [`Opening`](#openingextendsstring) for new [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `closing:`[<mark style="color:green;">`Closing`</mark>](#closingextendsstring)

The **closing** chars of generic type variable [`Closing`](#closingextendsstring) for new [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `text?:`[<mark style="color:green;">`Text`</mark>](#textextendsstring)

An optional **text** of generic type variable [`Text`](#textextendsstring) for new [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Return type

#### `Wrapper<Opening, Text, Closing>`

The **return type** is the [`Wrapper`](/wrapper-draft/wrapper/overview) object that takes generic type variables [`Opening`](#openingextendsstring), [`Text`](#textextendsstring), and [`Closing`](#closingextendsstring).

### Returns

The **return value** is the [`Wrapper`](/wrapper-draft/wrapper/overview) instance of given [`opening`](#opening-opening), [`closing`](#closing-closing) chars, and optional [`text`](#text-text).

## Example usage

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

// Returns Wrapper {'()'}
// of type Wrapper<"(", "", ")">
Wrapper.define('(', ')');

// Returns Wrapper {'!!'}
// of type Wrapper<"!", "", "!">
Wrapper.define('!', '!');

// Returns Wrapper {'"This is quoted text"'}
// of type Wrapper<"\"", "This is quoted text", "\"">
Wrapper.define('"', '"', 'This is quoted text');
```


# static isWrapper()

## `Wrapper.isWrapper()`

The method checks if the [`value`](#value-any) of any type is an instance of the [`Wrapper`](/wrapper-draft/wrapper/overview) of any, or given [`opening`](#opening-opening), [`closing`](#closing-closing) chars, and [`text`](#text-text).

{% code title="wrapper.class.ts" %}

```typescript
public static isWrapper<
  Opening extends string,
  Closing extends string,
  Text extends string = string
>(
  value: any,
  opening?: Opening,
  closing?: Closing,
  text?: Text
): value is Wrapper<Opening, Text, Closing> {
  return (
    typeof value === 'object' &&
    value instanceof this &&
    super.isWrap(value, opening, closing, text)
  );
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`Opening`**</mark>**`extends`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`opening`](#opening-opening) indicates the type of the opening in the [`Wrapper`](/wrapper-draft/wrapper/overview) via [return type](#return-type).

#### <mark style="color:green;">**`Closing`**</mark>**`extends`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`closing`](#closing-closing) indicates the type of the closing in the [`Wrapper`](/wrapper-draft/wrapper/overview) via [return type](#return-type).

#### <mark style="color:green;">**`Text`**</mark>**`extends`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)**`=`**[<mark style="color:green;">**`string`**</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`text`](#text-text) indicates the type of the text in the [`Wrapper`](/wrapper-draft/wrapper/overview) via [return type](#return-type).

### Parameters

#### `value:`[<mark style="color:green;">`any`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#any)

The **value** of any type to test against the instance of [`Wrapper`](/wrapper-draft/wrapper/overview).

#### `opening?:`[<mark style="color:green;">`Opening`</mark>](#openingextendsstring)

Optional **opening** chars of a generic type variable [`Opening`](#openingextendsstring) to check if the given [`value`](#value-any) contains.

#### `closing?:`[<mark style="color:green;">`Closing`</mark>](#closingextendsstring)

Optional **closing** chars of a generic type variable [`Closing`](#closingextendsstring) to check if the given [`value`](#value-any) contains.

#### `text?:`[<mark style="color:green;">`Text`</mark>](#textextendsstring-string)

An optional **text** of generic type variable [`Text`](#textextendsstring-string) to check if the given [`value`](#value-any) contains.

### Return type

**`value is Wrapper<Opening, Text, Closing>`**

The **return type** is a [boolean](https://www.typescriptlang.org/docs/handbook/basic-types.html#boolean) that indicates the [`value`](#value-any) is the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) type indicating whether the [`value`](#value-any) is an instance of [`Wrapper`](/wrapper-draft/wrapper/overview) of any, or the given [`opening`](#opening-opening), [`closing`](#closing-closing) chars, and [`text`](#text-text).

## Example usage

### Returns `true`

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

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

// Returns true confirming the type Wrapper<string, string, string>
Wrapper.isWrapper(tagWrapper);

// Returns true confirming the type Wrapper<"[", string, string>
Wrapper.isWrapper(tagWrapper, '[');

// Returns true confirming the type Wrapper<"[", string, "]">
Wrapper.isWrapper(tagWrapper, '[', ']');

// Returns true confirming the type Wrapper<"[", "quote", "]">
Wrapper.isWrapper(tagWrapper, '[', ']', 'quote');

// Returns true confirming the type Wrapper<string, "quote", "]">
Wrapper.isWrapper(tagWrapper, undefined, ']', 'quote');

// Returns true confirming the type Wrapper<"[", "quote", string>
Wrapper.isWrapper(tagWrapper, '[', undefined, 'quote');

// Returns true confirming the type Wrapper<string, "quote", string>
Wrapper.isWrapper(tagWrapper, undefined, undefined, 'quote');

// Returns true confirming the type Wrapper<string, string, "]">
Wrapper.isWrapper(tagWrapper, undefined, ']');

// Returns true confirming the type Wrapper<"[", string, "]">
Wrapper.isWrapper<'[', ']'>(tagWrapper);
```

### Return `false`

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

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

// Returns false denying the type Wrapper<"<", string, string>
Wrapper.isWrapper(tagWrapper, '<');

// Returns false denying the type Wrapper<"<", string, ">">
Wrapper.isWrapper(tagWrapper, '<', '>');

// Returns false denying the type Wrapper<"<", "quote", ">">
Wrapper.isWrapper(tagWrapper, '<', '>', 'quote');

// Returns false denying the type Wrapper<string, "quote", ">">
Wrapper.isWrapper(tagWrapper, undefined, '>', 'quote');

// Returns false denying the type Wrapper<"<", "quote", string>
Wrapper.isWrapper(tagWrapper, '<', undefined, 'quote');

// Returns false denying the type Wrapper<string, "no-quote", string>
Wrapper.isWrapper(tagWrapper, undefined, undefined, 'no-quote');

// Returns false denying the type Wrapper<string, string, ">">
Wrapper.isWrapper(tagWrapper, undefined, '>');

// Returns false denying the type Wrapper<"[", "", "]">
Wrapper.isWrapper<'[', ']'>(null as any);
```

### Confirms the wrong type

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

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

// Returns true confirming the type Wrapper<"<", string, ">">
Wrapper.isWrapper<'<', '>'>(tagWrapper);
```


# static replaceClosing()

## `Wrapper.replaceClosing()`

Replaces given [`closing`](#closing-string) chars with a given [replacement value](#replacevalue-string) at the end of the given [`text`](#text-string).

{% code title="wrapper.class.ts" %}

```typescript
public static replaceClosing(
  text: string,
  closing: string,
  replaceValue: string
): string {
  return this.hasClosing(text, closing)
    ? text.slice(0, -closing.length) + replaceValue
    : text;
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type in which given [`closing`](#closing-string) characters are replaced by a given replacement [value](#replacevalue-string).

#### `closing: string`

The **closing** chars of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to replace by a given replacement value at the end of the given [`text`](#text-string).

#### `replaceValue: string`

The replacement value of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type for the given [`closing`](#closing-string) characters in the given [`text`](#text-string).

### Returns

The **return value** is the given [`text`](#text-string) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with a replaced [`closing`](#closing-string) chars by a given [replacement value](#replacevalue-string) or the specified [`text`](#text-string) unchanged if it does not contain the given [`closing`](#closing-string) chars.

## Example usage

### Single bracket

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

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

// Returns [quote> of string.
Wrapper.replaceClosing(quote.valueOf(), ']', '>');

// Returns [quote}} of string.
Wrapper.replaceClosing(quote.valueOf(), ']', '}}');
```

### Triple bracket

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

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

// Returns [[[quote]]> of string.
Wrapper.replaceClosing(quote.valueOf(), ']', '>');

// Returns [[[quote]]}} of string.
Wrapper.replaceClosing(quote.valueOf(), ']', '}}');

// Returns [[[quote} of string.
Wrapper.replaceClosing(quote.valueOf(), ']]]', '}');

// Returns [[[quote] style="" of string.
Wrapper.replaceClosing(quote.valueOf(), quote.closing, ' style=""');
```


# static replaceOpening()

## `Wrapper.replaceOpening()`

Replaces given [`opening`](#opening-string) chars with a given [replacement value](#replacevalue-string) at the beginning of the given [`text`](#text-string).

{% code title="wrapper.class.ts" %}

```typescript
public static replaceOpening(
  text: string,
  opening: string,
  replaceValue: string
): string {
  return this.hasOpening(text, opening)
    ? text.replace(opening, String(replaceValue))
    : text;
}
```

{% endcode %}

### Parameters

#### `text: string`

The text of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type in which the given [`opening`](#opening-string) chars are replaced by a given [replacement value](#replacevalue-string).

#### `opening: string`

The opening chars of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to replace by a given [replacement value](#replacevalue-string) at the beginning of the given [`text`](#text-string).

#### `replaceValue: string`

The replacement value of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type for the given [`opening`](#opening-string) characters in the given [`text`](#text-string).

### Returns

The **return value** is the given [`text`](#text-string) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with a replaced [`opening`](#opening-string) chars by a given [replacement value](#replacevalue-string) or the specified [`text`](#text-string) unchanged if it does not contain the given [`opening`](#opening-string) chars.

## Example usage

### Single bracket

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

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

// Returns <quote] of string.
Wrapper.replaceOpening(quote.valueOf(), '[', '<');

// Returns {{quote] of string.
Wrapper.replaceOpening(quote.valueOf(), '[', '{{');
```

### Triple bracket

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

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

// Returns <[[quote]]] of string.
Wrapper.replaceOpening(quote.valueOf(), '[', '<');

// Returns {{[[quote]]] of string.
Wrapper.replaceOpening(quote.valueOf(), '[', '{{');

// Returns {quote]]] of string.
Wrapper.replaceOpening(quote.valueOf(), '[[[', '{');

// Returns style=""[quote]]] of string.
Wrapper.replaceOpening(quote.valueOf(), quote.opening, ' style=""');
```


# static unwrap()

## `Wrapper.unwrap()`

The method returns the given [`text`](#text-string) without the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

{% code title="wrapper.class.ts" %}

```typescript
public static unwrap(text: string, opening = '', closing = ''): string {
  return (
    (text = this.replaceClosing(text, closing, '')),
    (text = this.replaceOpening(text, opening, '')),
    text
  );
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) from which given [`opening`](#opening-string) and [`closing`](#closing-string) chars are removed.

#### `opening: string`

The **opening** chars of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to be removed in the given [`text`](#text-string).

#### `closing: string`

The **closing** chars of the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to be removed in the given [`text`](#text-string).

### Returns

The **return value** is the given [`text`](#text-string) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type without the given [`opening`](#opening-string) and [`closing`](#closing-string) chars or unchanged [`text`](#text-string) if it does not contain the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

## Example usage

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

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

// Returns quote of string.
Wrapper.unwrap(quote.valueOf(), '[', ']');

// Returns [quote] of string.
Wrapper.unwrap(quote.valueOf(), '[[', ']]');
```


# ↓ Instance

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>public <a href="/pages/d21qDnBfyU77dU1rfFqm"><strong>isClosingIn()</strong></a><br>Determines whether the provided <a href="/pages/d21qDnBfyU77dU1rfFqm#text-string"><code>text</code></a> has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>end</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/IBwPUqKOAFDqfubAkCGH"><strong>isOpeningIn()</strong></a><br>Checks whether the provided <a href="/pages/IBwPUqKOAFDqfubAkCGH#text-string"><code>text</code></a> has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object at the <strong>beginning</strong>.</p>                                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/9YbldIwnBrRHuqRn3Ekr"><strong>replaceClosingIn()</strong></a><br>Replaces the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object in the given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#text-string"><code>text</code></a> with a given <a href="/pages/9YbldIwnBrRHuqRn3Ekr#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                                          |
| <p>public <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string"><strong>replaceOpeningIn()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#text-string"><code>text</code></a> with a given <a href="/pages/r0ktt8Z6NQYoJvssaWgS#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                                                      |
| <p>public <a href="/pages/WVpq8VTHOJozPS19D6NM"><strong>removeWrapIn()</strong></a><br>Returns given <a href="/pages/WVpq8VTHOJozPS19D6NM#text-string"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                                        |
| <p>public <a href="/pages/yJLLsLxEoVvdfSws5cFN"><strong>textReplaceClosing()</strong></a><br>Replaces the <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/yJLLsLxEoVvdfSws5cFN#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                |
| <p>public <a href="/pages/N7aDbyfgseigOkMY27ej"><strong>textReplaceOpening()</strong></a><br>Replaces the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object in the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with the given <a href="/pages/N7aDbyfgseigOkMY27ej#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                       |
| <p>public <a href="/pages/zP95dShqIpnoCQ6qbOps"><strong>textUnwrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object without its <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.opening"><code>opening</code></a> and <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars or the given <a href="#opening-string"><code>opening</code></a> and <a href="#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                  |
| <p>public <a href="/pages/RieQNAg5fhTZm6EdBuIf"><strong>textWrap()</strong></a><br>The method returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object wrapped by the given <a href="/pages/RieQNAg5fhTZm6EdBuIf#opening-textopening"><code>opening</code></a> and <a href="/pages/RieQNAg5fhTZm6EdBuIf#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                              |
| <p>public <a href="/pages/0bfdKmmJzsCWEBghlZSH"><strong>toArray()</strong></a><br>Returns an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"><code>array</code></a> consisting of the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars, <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/DsvHxsxvwveQscLtP0ZI"><strong>toWrap()</strong></a><br>Returns the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> instance consists of the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>, <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                  |
| <p>public <a href="/pages/J4YBGUI01fGt5Mk2oESt"><strong>unwrap()</strong></a><br>Returns the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p>public <a href="/pages/P82XvzmtBw8jttgtZaG3"><strong>unwrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> unwrapped from the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> instance or given <a href="/pages/P82XvzmtBw8jttgtZaG3#opening-string"><code>opening</code></a> and <a href="/pages/P82XvzmtBw8jttgtZaG3#closing-string"><code>closing</code></a> chars.</p> |
| <p>public <a href="/pages/bVYiVYIgClIeuiRUmLQi"><strong>★ wrap()</strong></a><br>The method wraps the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object by its <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars, or the given <a href="/pages/bVYiVYIgClIeuiRUmLQi#opening-customopening"><code>opening</code></a> and <a href="/pages/bVYiVYIgClIeuiRUmLQi#closing-customclosing"><code>closing</code></a> chars.</p>                                                                                                                                                |
| <p>public <a href="/pages/HA4KMgni3JQhmXjFbfIa"><strong>★ wrapOn()</strong></a><br>The method wraps the given <a href="/pages/HA4KMgni3JQhmXjFbfIa#text-customtext"><code>text</code></a> with the wrap, the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a>, and <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars of the <a href="/pages/O5zJvtCr0bk2EDs7sRGG"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                                                   |
| <p>public <a href="/pages/AO2JRfFReB5un4hz9RZ4"><strong>★ wrapText()</strong></a><br>The method returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the <a href="/pages/F5qTcvzvEydfKeCd4pxX"><code>Wrapper</code></a> object with <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> wrapped by given <a href="/pages/AO2JRfFReB5un4hz9RZ4#opening-textopening"><code>opening</code></a> and <a href="/pages/AO2JRfFReB5un4hz9RZ4#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                 |


# isClosingIn()

## `Wrapper.prototype.isClosingIn()`

Determines whether the provided [`text`](#text-string) has the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the specified [`Wrapper`](/wrapper-draft/wrapper/overview) object at the **end**.

{% code title="wrapper.class.ts" %}

```typescript
public isClosingIn(text: string): boolean {
  return Wrapper.hasClosing(text, this.closing);
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to test for the existence of the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars at the **end** of it.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the given [`text`](#text-string) has the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the wrap.

## Example usage

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

const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;

// Returns true.
longText.isClosingIn(`${text}${longText.closing}`);

// Returns false.
longText.isClosingIn(text);

// Returns false.
longText.isClosingIn(`${longText.closing}${text}`);
```


# isOpeningIn()

## `Wrapper.prototype.isOpeningIn()`

Checks whether the provided [`text`](#text-string) has the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars of a specified [`Wrapper`](/wrapper-draft/wrapper/overview) object at the **beginning**.

{% code title="wrapper.class.ts" %}

```typescript
public isOpeningIn(text: string): boolean {
  return Wrapper.hasOpening(text, this.opening);
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to test for the existence of the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars at the **beginning** of it.

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the given [`text`](#text-string) has the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars  of the wrap.

### Example usage

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

const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;

// Returns false.
longText.isOpeningIn(`${text}${longText.opening}`);

// Returns false.
longText.isOpeningIn(text);

// Returns true.
longText.isOpeningIn(`${longText.opening}${text}`);
```


# replaceClosingIn()

## `Wrapper.prototype.replaceClosingIn()`

Replaces the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object in the given [`text`](#text-string) with a given [replacement value](#replacevalue-string).

{% hint style="info" %}
The replacement succeeds if the closing characters exist at the end of the text.
{% endhint %}

{% code title="wrapper.class.ts" %}

```typescript
public replaceClosingIn(text: string, replaceValue: string): string {
  return Wrapper.replaceClosing(text, this.closing, replaceValue);
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type in which the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars are replaced by given [replacement value](#replacevalue-string).

#### `replaceValue: string`

The value of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type as a replacement for the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars at the **end** of the given [`text`](#text-string).

### Returns

The **return value** is the given text of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with replaced [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars by given [replacement value](#replacevalue-string).

## Example usage

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

const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;

// Returns Lorem ipsum and more??.
longText.replaceClosingIn(`${text}${longText.closing}`, '??');

// Returns }}Lorem ipsum and more.
longText.replaceClosingIn(`${longText.closing}${text}`, '??');
```


# replaceOpeningIn()

## `Wrapper.prototype.replaceOpeningIn()`

Replaces the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object in the given [`text`](#text-string) with a given [replacement value](#replacevalue-string).

{% hint style="info" %}
The replacement succeeds if the opening characters exist at the beginning of the text.
{% endhint %}

{% code title="wrapper.class.ts" %}

```typescript
public replaceOpeningIn(text: string, replaceValue: string): string {
  return Wrapper.replaceOpening(text, this.opening, replaceValue);
}
```

{% endcode %}

### Parameters

#### `text: string`

The text of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type in which the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars are replaced by given [replacement value](#replacevalue-string).

#### `replaceValue: string`

The value of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type as a replacement for the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars at the **beginning** of the given [`text`](#text-string).

### Returns

The **return value** is the given [`text`](#text-string) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with replaced [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars by given [replacement value](#replacevalue-string).

## Example usage

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

const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;

// Returns 1. Lorem ipsum and more.
longText.replaceOpeningIn(`${longText.opening}${text}`, '1. ');

// Returns Lorem ipsum and more{{.
longText.replaceOpeningIn(`${text}${longText.opening}`, '??');
```


# removeWrapIn()

## `Wrapper.prototype.removeWrapIn()`

Returns given [`text`](#text-string) without the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

{% code title="wrapper.class.ts" %}

```typescript
public removeWrapIn(text: string): string {
  return (
    (text = this.replaceClosingIn(text, '')),
    (text = this.replaceOpeningIn(text, '')),
    text
  );
}
```

{% endcode %}

### Parameters

#### `text: string`

The **text** of a [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to unwrap from the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

### Returns

The **return value** is the **text** of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type unwrapped from the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

## Example usage

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

const longText = new Wrapper('{{', '}}', 'This is a long text');
const text = `Lorem ipsum and more`;

// Returns Lorem ipsum and more.
longText.removeWrapIn(`${longText.opening}${text}${longText.closing}`);

// Returns }}Lorem ipsum and more{{.
longText.removeWrapIn(`${longText.closing}${text}${longText.opening}`);
```


# textReplaceClosing()

## `Wrapper.prototype.textReplaceClosing()`

Replaces the [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object in the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object with the given [`closing`](#closing-string) chars.

{% hint style="info" %}
The replacement succeeds if the closing characters exist at the end of the text.
{% endhint %}

{% code title="wrapper.class.ts" %}

```typescript
public textReplaceClosing(closing: string): string {
  return Wrapper.replaceClosing(this.text, this.closing, closing);
}
```

{% endcode %}

### Parameters

#### `closing: string`

The **closing** chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to replace in the [`text`](/wrapper-draft/wrap/accessors/get-text)(part of the primitive value).

### Returns

The **return value** is the [`text`](/wrapper-draft/wrap/accessors/get-text) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with replaced [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{This is a long text}}.
longText.valueOf();

// Returns {This is a long text.
longText.textReplaceClosing('');

// Returns {This is a long text}}.
longText.textReplaceClosing('}}');
```


# textReplaceOpening()

## `Wrapper.prototype.textReplaceOpening()`

Replaces the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object in the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object with the given [`opening`](#opening-string) chars.

{% hint style="info" %}
The replacement succeeds if the opening characters exist at the beginning of the text.
{% endhint %}

{% code title="wrapper.class.ts" %}

```typescript
public textReplaceOpening(opening: string): string {
  return Wrapper.replaceOpening(this.text, this.opening, opening);
}
```

{% endcode %}

### Parameters

#### `opening: string`

The **opening** chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) to replace in the [`text`](/wrapper-draft/wrap/accessors/get-text)(part of the primitive value).

### Returns

The **return value** is the [`text`](/wrapper-draft/wrap/accessors/get-text) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with replaced [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{This is a long text}}.
longText.valueOf();

// Returns This is a long text}.
longText.textReplaceOpening('');

// Returns {{This is a long text}.
longText.textReplaceOpening('{{');
```


# ⚠  textHasClosing()

{% hint style="danger" %}
The method does not yet exist.
{% endhint %}

### `Wrapper.prototype.textHasClosing()`

Checks if the provided `text` has the closing of specified [`Wrapper`](/wrapper-draft/wrapper/overview) object at the end of the text.

{% code title="wrapper.class.ts" %}

```typescript
public textHasClosing(text: string): boolean {
  return (
    isStringType(text) && text.slice(-this.closing.length) === this.closing
  );
}
```

{% endcode %}

### Parameters

<table><thead><tr><th width="173.44477578337126">Name: type</th><th>Description</th></tr></thead><tbody><tr><td><code>text: string</code></td><td>The text of a <code>string</code> to test against the existence of the <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing"><code>closing</code></a> chars.</td></tr></tbody></table>

### Returns

The return value is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the given `text` has the closing of the wrap.

### Example usage

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

// Returns true of boolean.
new Wrapper(`[`, `]`).textHasClosing(`[quote]`);

// Returns false of boolean.
new Wrapper(`{{`, `}}`).textHasClosing(`{{variable`);
```


# ⚠  textHasOpening()

{% hint style="danger" %}
The method does not yet exist.&#x20;
{% endhint %}

### `Wrapper.prototype.textHasOpening()`

Checks if the provided `text` has the opening of the specified [`Wrapper`](broken://pages/OnxhYXL7HocXsHa9qO3M) object at the beginning of the text.

{% code title="wrapper.class.ts" %}

```typescript
public textHasOpening(text: string): boolean {
  return (
    isStringType(text) && text.slice(0, this.opening.length) === this.opening
  );
}
```

{% endcode %}

### Parameters

<table><thead><tr><th width="173.44477578337126">Name: type</th><th>Description</th></tr></thead><tbody><tr><td><code>text: string</code></td><td>The text of a <code>string</code> to test against the existence of the <a href="/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.opening"><code>opening</code></a> chars.</td></tr></tbody></table>

### Returns

The **return value** is a [`boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) indicating whether the given `text` has the opening of the wrap.

### Example usage

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

// Returns true of boolean.
new Wrapper(`[`, `]`).textHasOpening(`[quote]`);
```


# textUnwrap()

## `Wrapper.prototype.textUnwrap()`

The method returns the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object without its [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars or the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

{% hint style="info" %}
The default values for the `opening` and `closing` parameters are taken from the `Wrapper` object.
{% endhint %}

{% code title="wrapper.class.ts" %}

```typescript
public textUnwrap(
  opening: string = this.opening,
  closing: string = this.closing
): string {
  return Wrapper.unwrap(this.text, opening, closing);
}
```

{% endcode %}

### Parameters

#### `opening: string`

Optional **opening** chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to remove from the **beginning** of the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `closing: string`

Optional **closing** chars of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type to remove from the **end** of the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Returns

The **return value** is the [`text`](/wrapper-draft/wrap/accessors/get-text) of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type without the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object or given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{This is a long text}}.
longText.valueOf();

// Returns This is a long text.
longText.textUnwrap();

// Returns {This is a long text}.
longText.textUnwrap('', '');

// Returns This is a long text}.
longText.textUnwrap('{', '');

// Returns This is a long text.
longText.textUnwrap('{', undefined);

// Returns {This is a long text.
longText.textUnwrap('', '}');

// Returns This is a long text.
longText.textUnwrap(undefined, '}');
```


# textWrap()

## `Wrapper.prototype.textWrap()`

The method returns the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object wrapped by the given [`opening`](#opening-textopening) and [`closing`](#closing-textclosing) chars.

{% code title="wrapper.class.ts" %}

```typescript
public textWrap<TextOpening extends string, TextClosing extends string>(
  opening: TextOpening,
  closing: TextClosing
): Wrapped<TextOpening, Text, TextClosing> {
  return new Wrap(opening, closing, this.text).valueOf();
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">**`TextOpening`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`opening`](#opening-textopening) indicates the type of the opening chars in generic type [`Wrapped`](/wrapper-draft/type/wrapped)  via [return type](#return-type).

#### <mark style="color:green;">**`TextClosing`**</mark>**`extends`**<mark style="color:green;">**`string`**</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value captured from the provided [`closing`](#closing-textclosing) indicates the type of the closing chars in generic type [`Wrapped`](/wrapper-draft/type/wrapped) via [return type](#return-type).

### Parameters

#### `opening: TextOpening`

The **opening** chars of a generic type variable [`TextOpening`](#textopeningextendsstring) to wrap the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `closing: TextClosing`

The **closing** chars of a generic type variable [`TextClosing`](#textclosingextendsstring) to wrap the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Return type

#### `Wrapped<TextOpening, Text, TextClosing>`

The **return type** is generic type [`Wrapped`](/wrapper-draft/type/wrapped) that takes generic type variables [`TextOpening`](#textopeningextendsstring), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/methods/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than) and [`TextClosing`](#textclosingextendsstring).

### Returns

The **return value** is the [`text`](/wrapper-draft/wrap/accessors/get-text) wrapped by given [`opening`](#opening-textopening) and [`closing`](#closing-textclosing) chars of generic type [`Wrapped`](/wrapper-draft/type/wrapped).

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{This is a long text}}.
longText.valueOf();

// Returns {This is a long text}.
longText.textWrap('', '');

// Returns {{This is a long text}.
longText.textWrap('{', '');

// Returns {This is a long text}}.
longText.textWrap('', '}');

// Returns {{This is a long text}}.
longText.textWrap('{', '}');
```


# toArray()

## `Wrapper.prototype.toArray()`

Returns an [`array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) consisting of the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars, [`text`](/wrapper-draft/wrap/accessors/get-text), and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars.

{% code title="wrapper.class.ts" %}

```typescript
public toArray(): readonly [Opening, Text, Closing] {
  return [this.opening, this.text, this.closing];
}
```

{% endcode %}

### Return type

#### `readonly [`<mark style="color:green;">`Opening`</mark>`,`<mark style="color:green;">`Text`</mark>`,`<mark style="color:green;">`Closing`</mark>`]`

The **return type** is a **read-only** [`array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of generic type variables in order [`Opening`](/wrapper-draft/wrapper/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/methods/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than) and [`Closing`](/wrapper-draft/wrapper/generic-type-variables#wrap-closing).

### Returns

The **return value** is a **read-only** [`array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) consisting of the [`opening`](/wrapper-draft/wrap/accessors/get-opening) chars, [`text`](/wrapper-draft/wrap/accessors/get-text), and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns ['{', '{This is a long text}', '}'].
longText.toArray();
```


# toWrap()

## `Wrapper.prototype.toWrap()`

Returns the [`Wrap`](/wrapper-draft/wrap/overview) instance consists of the [`text`](/wrapper-draft/wrap/accessors/get-text), [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

{% code title="wrapper.class.ts" %}

```typescript
public toWrap(): Wrap<Opening, Text, Closing> {
  return new Wrap(this.opening, this.closing, this.text);
}
```

{% endcode %}

### Return type

#### `Wrap<`<mark style="color:green;">`Opening`</mark>`,`<mark style="color:green;">`Text`</mark>`,`<mark style="color:green;">`Closing`</mark>`>`

The **return type** is the [`Wrap`](/wrapper-draft/wrap/overview) object that takes generic type variables [`Opening`](/wrapper-draft/wrapper/generic-type-variables#wrap-opening), [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/methods/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than) and [`Closing`](/wrapper-draft/wrapper/generic-type-variables#wrap-closing).

### Returns

The **return value** is an instance of [`Wrap`](/wrapper-draft/wrap/overview) consisting of the [`text`](/wrapper-draft/wrap/accessors/get-text), [`opening`](/wrapper-draft/wrap/accessors/get-opening), and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns Wrap {'{{This is a long text}}'}.
longText.toWrap();
```


# unwrap()

## `Wrapper.prototype.unwrap()`

Returns the [`text`](/wrapper-draft/wrap/accessors/get-text) without the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars.

{% code title="wrapper.class.ts" %}

```typescript
public unwrap(): Text {
  return this.text;
}
```

{% endcode %}

### Returns

The **return value** is the [`text`](/wrapper-draft/wrap/accessors/get-text) of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/methods/pages/8pklXCrH2XMJA5SN1dLm#wrapper-less-than...-text-...greater-than).

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {This is a long text}.
longText.unwrap();
```


# unwrapText()

## `Wrapper.prototype.unwrapText()`

The method returns the [primitive value](/wrapper-draft/wrap/methods/valueof) of a specified [`Wrapper`](/wrapper-draft/wrapper/overview) object with [`text`](/wrapper-draft/wrap/accessors/get-text) unwrapped from the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance or given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

{% code title="wrapper.class.ts" %}

```typescript
public unwrapText(
  opening: string = this.opening,
  closing: string = this.closing
): string {
  return `${this.opening}${Wrapper.unwrap(this.text, opening, closing)}${
    this.closing
  }`;
} 
```

{% endcode %}

### Parameters

#### `opening: string`

Optional opening chars of [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) type to remove from the **beginning** of the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `closing: string`

Optional closing chars of [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) type to remove from the **end** of the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Returns

The **return value** is the [primitive value](/wrapper-draft/wrap/methods/valueof) of [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) type with [`text`](/wrapper-draft/wrap/accessors/get-text) unwrapped from the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object or the given [`opening`](#opening-string) and [`closing`](#closing-string) chars.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {This is a long text}.
longText.unwrapText();

// Returns {{This is a long text}}.
longText.unwrapText('', '');

// Returns {This is a long text}}.
longText.unwrapText('{', '');

// Returns {{This is a long text}.
longText.unwrapText('', '}');

// Returns {{This is a long text}}.
longText.unwrapText('{{', '}}');
```


# ★ wrap()

## `Wrapper.prototype.wrap()`

The method wraps the [primitive value](/wrapper-draft/wrap/methods/valueof) of a specified [`Wrapper`](/wrapper-draft/wrapper/overview) object by its [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars, or the given [`opening`](#opening-customopening) and [`closing`](#closing-customclosing) chars.

{% code title="wrapper.class.ts" %}

```typescript
public wrap<
  CustomOpening extends string = Opening,
  CustomClosing extends string = Closing
>(
  opening: CustomOpening = this.opening as any,
  closing: CustomClosing = this.closing as any
): Wrapped<CustomOpening, Wrapped<Opening, Text, Closing>, CustomClosing> {
  return new Wrap(opening, closing, this.valueOf()).valueOf();
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">`CustomOpening`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`Opening`</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) indicates the captured type of the supplied [`opening`](#opening-customopening) parameter and the [`Opening`](/wrapper-draft/type/wrapped#openingextendsstring) type in the generic type [`Wrapped`](/wrapper-draft/type/wrapped) via [return type](#undefined), by default generic type variable [`Opening`](/wrapper-draft/wrapper/generic-type-variables#wrap-opening) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

#### <mark style="color:green;">`CustomClosing`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`Closing`</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) indicates the captured type of the supplied [`closing`](#closing-customclosing) parameter and the [`Closing`](/wrapper-draft/type/wrapped#closingextendsstring) type in the generic type [`Wrapped`](/wrapper-draft/type/wrapped) via [return type](#undefined), by default generic type variable [`Closing`](/wrapper-draft/wrapper/generic-type-variables#wrap-closing) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

### Parameters

#### `opening:`[<mark style="color:green;">`CustomOpening`</mark>](#customopeningextendsstring-opening)

Optional opening chars of a generic type variable [`CustomOpening`](#customopeningextendsstring-opening) to wrap the [primitive value](/wrapper-draft/wrap/methods/valueof) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `closing:`[<mark style="color:green;">`CustomClosing`</mark>](#customclosingextendsstring-closing)

Optional closing chars of a generic type variable [`CustomClosing`](#customclosingextendsstring-closing) to wrap the [primitive value](/wrapper-draft/wrap/methods/valueof) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Return type

#### `Wrapped<CustomOpening, Wrapped<Opening, Text, Closing>, CustomClosing>`&#x20;

The **return type** is the generic type [`Wrapped`](/wrapper-draft/type/wrapped) that takes generic type variables [`Opening`](/wrapper-draft/type/wrapped#openingextendsstring), [`Text`](/wrapper-draft/type/wrapped#textextendsstring) and [`Closing`](/wrapper-draft/type/wrapped#closingextendsstring).

### Returns

The **return value** is a [primitive value](/wrapper-draft/wrap/methods/valueof) wrapped by the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance or the given [`opening`](#opening-customopening) and [`closing`](#closing-customclosing) chars.

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{{This is a long text}}}.
longText.wrap();

// Returns {{This is a long text}}.
longText.wrap('', '');
```


# ★ wrapOn()

## `Wrapper.prototype.wrapOn()`

The method wraps the given [`text`](#text-customtext) with the wrap, the [`opening`](/wrapper-draft/wrap/accessors/get-opening), and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object.

{% code title="wrapper.class.ts" %}

```typescript
public wrapOn<CustomText extends string = ''>(
  text: CustomText
): Wrapped<Opening, CustomText, Closing> {
  return new Wrap(this.opening, this.closing, text).valueOf();
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">`CustomText`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`''`</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) indicates the captured type of the supplied [`text`](#text-customtext) parameter and the value of the generic type variable [`Text`](/wrapper-draft/type/wrapped#textextendsstring) in the  generic type [`Wrapped`](/wrapper-draft/type/wrapped) via [return type](#return-type), by default an empty [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string).

### Parameters

#### `text:`[<mark style="color:green;">`CustomText`</mark>](#customtextextendsstring)

The text of generic type variable [`CustomText`](#customtext-extends-string) to wrap by the [`opening`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/methods/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.opening) and [`closing`](https://wrapper.angular-package.dev/wrapper-draft/wrapper/methods/pages/QTYxQh3MKwTJRj5pYA28#wrap.prototype.closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Return type

#### `Wrapped<Opening, CustomText, Closing>`

The **return type** is generic type [`Wrapped`](/wrapper-draft/type/wrapped) that takes generic type variables [`Opening`](/wrapper-draft/wrapper/generic-type-variables#wrap-opening), [`CustomText`](#customtextextendsstring) and [`Closing`](/wrapper-draft/wrapper/generic-type-variables#wrap-closing).

### Returns

The **return value** is the given [`text`](#text-customtext) wrapped by the [`opening`](/wrapper-draft/wrap/accessors/get-opening) and [`closing`](/wrapper-draft/wrap/accessors/get-closing) chars of the [`Wrapper`](/wrapper-draft/wrapper/overview) object of the generic type [`Wrapped`](/wrapper-draft/type/wrapped).

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{This is a long text}}.
longText.wrapOn('{This is a long text}');

// Returns <span color="red">.
new Wrapper('<', '>').wrapOn('span color="red"');
```


# ★ wrapText()

## `Wrapper.prototype.wrapText()`

The method returns the [primitive value](/wrapper-draft/wrap/methods/valueof) of the [`Wrapper`](/wrapper-draft/wrapper/overview) object with [`text`](/wrapper-draft/wrap/accessors/get-text) wrapped by given [`opening`](#opening-textopening) and [`closing`](#closing-textclosing) chars.

{% code title="wrapper.class.ts" %}

```typescript
public wrapText<
  TextOpening extends string = '',
  TextClosing extends string = ''
>(
  opening: TextOpening,
  closing: TextClosing
): Wrapped<Opening, Wrapped<TextOpening, Text, TextClosing>, Closing> {
  return `${this.opening}${this.textWrap(opening, closing)}${this.closing}`;
}
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">`TextOpening`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`''`</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) indicates the captured type of the supplied [`opening`](#opening-textopening) parameter and the [`Opening`](/wrapper-draft/type/wrapped#openingextendsstring) type in the generic type [`Wrapped`](/wrapper-draft/type/wrapped) via [return type](#return-type), by default an empty [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string).

#### <mark style="color:green;">`TextClosing`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`''`</mark>

A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) indicates the captured type of the supplied [`closing`](#closing-textclosing) parameter and the [`Closing`](/wrapper-draft/type/wrapped#closingextendsstring) type in the generic type [`Wrapped`](/wrapper-draft/type/wrapped) via [return type](#return-type), by default an empty [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string).

### Parameters

#### `opening:`[<mark style="color:green;">`TextOpening`</mark>](#textopeningextendsstring)

The opening chars of a generic type variable [`TextOpening`](#textopeningextendsstring) to wrap the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

#### `closing:`[<mark style="color:green;">`TextClosing`</mark>](#textclosingextendsstring)

The closing chars of a generic type variable [`TextClosing`](#textclosingextendsstring) to wrap the [`text`](/wrapper-draft/wrap/accessors/get-text) of the [`Wrapper`](/wrapper-draft/wrapper/overview) instance.

### Return type

#### `Wrapped<Opening, Wrapped<TextOpening, Text, TextClosing>, Closing>`

The return type is the generic type [`Wrapped`](/wrapper-draft/type/wrapped) that takes generic type variables [`Opening`](/wrapper-draft/type/wrapped#openingextendsstring), [`Text`](/wrapper-draft/type/wrapped#textextendsstring) and [`Closing`](/wrapper-draft/type/wrapped#closingextendsstring).

### Returns

The **return value** is the [primitive value](/wrapper-draft/wrap/methods/valueof) with [`text`](/wrapper-draft/wrap/accessors/get-text) wrapped by given [`opening`](#opening-textopening) and [`closing`](#closing-textclosing) characters of generic type [`Wrapped`](/wrapper-draft/type/wrapped).

## Example usage

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

const longText = new Wrapper('{', '}', '{This is a long text}');

// Returns {{{This is a long text}}} of "{{{This is a long text}}}".
longText.wrapText('{', '}');

// Returns {<{This is a long text}>} of "{<{This is a long text}>}".
longText.wrapText('<', '>');
```


# Example usage

## `HtmlWrap`

Let's create a new `HtmlWrap` object extending it with the `Wrapper` to make an immutable `<span>` tag.

```typescript
// Example usage.
import { Wrapper } from '@angular-package/wrapper';
 
// Define HtmlWrap class.
class HtmlWrap extends Wrapper<`<`, `>`> {
  constructor() {
    super(`<`, `>`);
  }
}

// Create the html tag '<span>'.
new HtmlWrap().wrap(`span`);
```

## `OfType`

Create a  new object `OfType` to make an immutable string indicating of type `: Opening`.

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

class OfType extends String {
  constructor(name: string) {
    super(new Wrapper<`:`, ``>(`:`, ``).wrap(` ${name}`));
  }
}

// Returns OfType{': Opening'}.
const ofOpening = new OfType(`Opening`);

// Returns ': Opening'.
ofOpening.valueOf();
```


# Wrapped

## `Wrapped<`<mark style="color:green;">`Opening`</mark>`,`<mark style="color:green;">`Text`</mark>`,`<mark style="color:green;">`Closing`</mark>`>`

The `Wrapped` type indicates the text wrapped by the opening characters at the **beginning** and the closing characters at the **end** of the text. It's built from generic type variables in order [`Opening`](#openingextendsstring), [`Text`](#textextendsstring) and [`Closing`](#closingextendsstring) on the template `${Opening}${Text}${Closing}`.

{% code title="wrapped.type.ts" %}

```typescript
export type Wrapped<
  Opening extends string = '',
  Text extends string = '',
  Closing extends string = ''
> = `${Opening}${Text}${Closing}`;
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">`Opening`</mark>`extends`[<mark style="color:green;">`string`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)`=`<mark style="color:green;">`''`</mark>

A generic type variable determines the opening characters placed before the text on the template `${Opening}${Text}${Closing}`.

#### <mark style="color:green;">`Text`</mark>`extends`[<mark style="color:green;">`string`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)`=`<mark style="color:green;">`''`</mark>

A generic type variable determines the text between the opening and closing characters on the template `${Opening}${Text}${Closing}`.

#### <mark style="color:green;">`Closing`</mark>`extends`[<mark style="color:green;">`string`</mark>](https://www.typescriptlang.org/docs/handbook/basic-types.html#string)`=`<mark style="color:green;">`''`</mark>

A generic type variable determines the closing characters placed after the text on the template `${Opening}${Text}${Closing}`.

### Returns

The type returns [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) of generic type variables in order [`Opening`](#openingextendsstring), [`Text`](#textextendsstring) and [`Closing`](#closingextendsstring) indicating wrapped text.


# Keep a changelog

The **changelog** of this package is based on [*keep a changelog*](https://keepachangelog.com/en/1.0.0/). To read it, click on the [CHANGELOG.md](https://github.com/angular-package/wrapper/blob/main/CHANGELOG.md) link.

> A changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project. - [*keep a changelog*](https://keepachangelog.com/en/1.0.0/)


# v1.0.0

## 2022-02-02

### Changed

* Changed the parameters default values of `isWrapped()` instance method to private `#opening` and `#closing`. [44bd1f5](https://github.com/angular-package/wrapper/commit/44bd1f54d82700440012caa5414a02ff8687ffb2)
* Changed the default values of the `opening` and `closing` parameters in the static `unwrap()` method by removing them. [d8d0f4b](https://github.com/angular-package/wrapper/commit/d8d0f4bb029395a2de180fc38246a9ea81d7eb58)
* Changed the default value for the generic type variable `Text` of the `isWrapper()` static method to `string`. [d8d0f4b](https://github.com/angular-package/wrapper/commit/d8d0f4bb029395a2de180fc38246a9ea81d7eb58)
* Changed the `toStringTag` name from the `wrapper` to `Wrapper`. [d8d0f4b](https://github.com/angular-package/wrapper/commit/d8d0f4bb029395a2de180fc38246a9ea81d7eb58)
* Changed the `toStringTag` name from the `wrap` to `Wrap`. [4049e2e](https://github.com/angular-package/wrapper/commit/4049e2ea09104ac155bf7b385789b40ca7b923c1)


# Commit

### AngularJS Git Commit Message Conventions

{% embed url="<https://gist.github.com/stephenparish/9941e89d80e2bc58a153>" %}

### Karma Git Commit Msg

{% embed url="<http://karma-runner.github.io/0.10/dev/git-commit-msg.html>" %}

### Conventional Commits

{% embed url="<https://www.conventionalcommits.org/en/v1.0.0>" %}


# Semantic Versioning

## Semantic versioning 2.0.0

**Given a version number MAJOR.MINOR.PATCH, increment the:**

* MAJOR version when you make incompatible API changes,
* MINOR version when you add functionality in a backwards-compatible manner, and
* PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

**FAQ** How should I deal with revisions in the 0.y.z initial development phase?

> The simplest thing to do is start your initial development release at 0.1.0 and then increment the minor version for each subsequent release.

How do I know when to release 1.0.0?

> If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backwards compatibility, you should probably already be 1.0.0.

{% embed url="<http://semver.org>" %}


# ⋯ Chat

## Discord

Feel free to ask any questions about the **angular package** project in a general chat room on the discord.

{% embed url="<https://discord.com/channels/925168966098386944/925168966098386948>" %}
Discord general
{% endembed %}

## Gitter

Feel free to ask any questions about the **angular package** project in a dedicated chat room on the gitter [here](https://gitter.im/angularpackage/Lobby).

{% embed url="<https://gitter.im/angularpackage/Lobby>" %}
Gitter chat
{% endembed %}


# @ Email

## Email

[contact@angular-package.dev](#email)


# ✆ Phone

## Mobile phone

+48 883322727


# ฿ Cryptocurrency

Become a sponsor to the angular-package by sending the cryptocurrency

## Bitcoin (BTC)

{% hint style="success" %}
My Public Address to Receive BTC

bc1qnf709336tfl57ta5mfkf4t9fndhx7agxvv9svn
{% endhint %}

Pay me via Trust Wallet: <https://link.trustwallet.com/send?coin=0&address=bc1qnf709336tfl57ta5mfkf4t9fndhx7agxvv9svn>

## Ethereum (ETH)&#x20;

{% hint style="success" %}
My Public Address to Receive ETH

0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94
{% endhint %}

Pay me via Trust Wallet: <https://link.trustwallet.com/send?coin=60&address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94>

## Smart Chain (BNB)

{% hint style="success" %}
My Public Address to Receive BNB

0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94
{% endhint %}

Pay me via Trust Wallet: <https://link.trustwallet.com/send?coin=20000714&address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94>

## Tether USDT (BEP20)

{% hint style="success" %}
My Public Address to Receive USDT

0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94
{% endhint %}

Pay me via Trust Wallet: <https://link.trustwallet.com/send?coin=20000714&address=0xA0c22A2bc7E37C1d5992dFDFFeD5E6f9298E1b94&token_id=0x55d398326f99059fF775485246999027B3197955>

## Stellar (XLM)

{% hint style="success" %}
My Public Address to Receive XLM

GAFFFB7H3LG42O6JA63FJDRK4PP4JCNEOPHLGLLFH625X2KFYQ4UYVM4
{% endhint %}

Pay me via Trust Wallet: <https://link.trustwallet.com/send?coin=148&address=GAFFFB7H3LG42O6JA63FJDRK4PP4JCNEOPHLGLLFH625X2KFYQ4UYVM4>


# $ Fiat

## DonorBox

Become a sponsor to the **angular package** by using DonorBox sponsor [page](https://donorbox.org/become-a-sponsor-to-the-angular-package?default_interval=o).

{% embed url="<https://donorbox.org/become-a-sponsor-to-the-angular-package?default_interval=o>" %}

## GitHub

Become a sponsor to the **angular package** by using the **GitHub** sponsor [page](https://github.com/sponsors/angular-package).

{% embed url="<https://github.com/sponsors/angular-package>" %}

## Patreon

Become a sponsor to the **angular package** through my private sciborrudnicki account on the Patreon [page](https://www.patreon.com/sciborrudnicki).

{% embed url="<https://www.patreon.com/sciborrudnicki>" %}


# Introduction

## angular-package/wrapper

Wrap the text with the opening and closing chars.

### Idea

The idea behind the `Wrapper` is to have an object that creates a tag of string type, not a specific tag like Html, or BBCode but any tag of a string with preserved exact type.


# ❤ Benefits

Under the hood of some packages are [primitive wrapper objects](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript), and below is a list containing some **pros** of using them and of important design benefits.

* [**Immutable**](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) primitive value of [primitive wrapper objects](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript).
* A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value is divided into private properties of [generic type variables](https://www.typescriptlang.org/docs/handbook/2/generics.html).&#x20;
* A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value type is built of generic type variables on the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), which results in the **exact return type** rather than just a `string`.
* The **ability** to get part of the primitive value of the exact return type.
* Specific functionality objects with generic type variables(which preserves exact type) act as **precise** types.
* The most **important** functionalities for a **specific** name.
* General and [**intuitive**](/general-concepts#intuitive) object names.

All this above is in a **minimal**, **simple** to use, and **ease-extendable** form of objects.

<details>

<summary>Immutability</summary>

[**Immutable**](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) primitive value of [primitive wrapper objects](https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript).

Some methods return converted primitive value to a form of an [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) object or array.

Use the [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessors to return parts of the [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value of a specified object.

</details>

<details>

<summary>Partial primitive value with the exact return type</summary>

A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value is divided into private properties of [generic type variables](https://www.typescriptlang.org/docs/handbook/2/generics.html). &#x20;

A [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive) value type is built of generic type variables on the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html), which results in the **exact return type** rather than just a `string`.

The **ability** to get part of the primitive value of the exact return type.

</details>

<details>

<summary>Object as types</summary>

Specific in functionality objects with generic type variables(which preserves type), act as **precise** types.

Objects have changed a [`Symbol.toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) to **unique immutable** names.

Type of the objects can be detected by the [`Object.prototype.toString.call()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call). because of its **uniqueness** and **immutability**.&#x20;

There is `typeOf()` function of `angular-package/type` to detect these objects type.

</details>

<details>

<summary>Functionality <strong>follows</strong> the type</summary>

The most **important** functionalities, dedicated to a **specific** name.

Objects have functionalities that use their parts of [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) primitive values.

</details>

<details>

<summary>Intuitiveness</summary>

General and [**intuitive**](/general-concepts#intuitive) object names.

[Intuitive](/general-concepts#intuitive) names of generic type variables.

[Intuitive](/general-concepts#intuitive) accessor and property names.

[Intuitive](/general-concepts#intuitive) method names.

</details>

<details>

<summary>Minimalism and simplicity</summary>

**Minimal**, **simple** to use and an **ease-extendable** objects.

</details>


# Explanation

### Partial primitive value with the exact return type

This example explains what **partial primitive value** and the **exact return type** means in the [`Wrap`](/wrap/overview) `string` object.

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

// Define tag [quote].
const quoteTag = new Wrap(
  // quoteTag.opening;
  `[`,
  // quoteTag.closing;
  `]`,
  // quoteTag.content;
  'quote'
);

// The opening is of a generic type variable Opening in this case it's [.
quoteTag.opening;

// The closing is of a generic type variable Closing in this case it's ].
quoteTag.closing;

// The content is of a generic type variable Content in this case it's quote.
quoteTag.content;

```

To create primitive value of [`Wrap`](/wrap/overview) object there is the need to provide three parameters in order `opening`, `closing`, and optional `content`. They are stored in separate private properties which are accessible with the help of accessors, and because of this, access to **parts of the primitive value** is achieved. More, each parameter is of a generic type variable that detects the type of given value, and because of this, the **exact return type** of **primitive value** and its **parts** is achieved.

#### Immutability

All the parts that make up the primitive value of the [`Wrap`](/wrap/overview) object are **immutable** because they are accessible only by the `get` accessors. There is no possibility to change any part of the primitive value of the `quoteTag` object and any try to change e.g. `opening` results in the error message "*Cannot assign to 'opening' because it is a read-only property*".&#x20;

```typescript

// Cannot assign to 'opening' because it is a read-only property
// and the opening is of a generic type variable Opening in this case it's `[`.
quoteTag.opening = ; 

```

### Object as types

There is possibility to check whether the object is the `wrapper` with the help of `typeOf()` function. The name of `bbCodeWrapper` object cannot be changed in the example below.

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

class CustomWrap {
  bbCode: Wrapper<`[`, `]`> = new Wrapper(`[`, `]`);
  html: Wrapper<'<', '>'> = new Wrapper(`<`, `>`);
}

// Returns [quote] of type "[quote]".
new CustomWrap().bbCode.wrap('quote');

// Returns <span> of type "<span>".
new CustomWrap().html.wrap('span');

// Checks the object type. Returns 'wrapper'.
const bbCodeWrapper = new Wrapper('[', ']');

// Returns 'wrapper'.
typeOf(bbCodeWrapper);

// Symbol.toStringTag is immutable. Can't be changed.
// Uncaught TypeError: Cannot set property Symbol(Symbol.toStringTag) of [object Object] which has only a getter
Object.assign(bbCodeWrapper, {
  [Symbol.toStringTag]: 'custom'
});

```


# General concepts

Explanation of common terms for all packages.

### ⚠

The warning sign indicates the element is **not** **available**.

### ★

The element starred as most **useful**.

### **Checks**

It's to **check** the provided value to be the same as **expected**.

### **Guards**

It's a **combination** of both above, **constrains** the type of the parameter in the **code editor**, and checks its provided argument.

### **Defines**

Returns defined value from a method of an object.

Defines new value in an object and returns a defined value.

### **Gets**

Returns a value from an object.

### **Sets**

Adds or updates an element with a specified key and a value to an object and returns an object.

### Intuitive

Having the ability to know or understand things without any proof or evidence. E.g. some of the accessor names indicate directly its role.

### General

Relating to the main or major parts of something rather than the details. E.g. some of the accessor names don't indicate the specific role in the object.


# Skeleton

The package was generated by the [library skeleton](https://github.com/angular-package/skeleton) which was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.&#x20;

Copy package to the `packages/wrapper` folder of the [library skeleton](https://github.com/angular-package/skeleton) then run the commands below.

### Code scaffolding

Run `ng generate component component-name --project wrapper` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project wrapper`.

> Note: Don't forget to add `--project wrapper` or else it will be added to the default project in your `angular.json` file.

### Build

Run `ng build wrapper` to build the project. The build artifacts will be stored in the `dist/` directory.

### **Publishing**

After building your library with `ng build wrapper`, go to the dist folder `cd dist/wrapper` and run `npm publish`.

### **Running unit tests**

Before the test can be performed install `@angular-package/testing` with command:&#x20;

```bash
npm i @angular-package/testing --no-save
```

Run `ng test wrapper` to execute the unit tests via [Karma](https://karma-runner.github.io).

### Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.


# Installation

The package can be installed into your project via [NPM](https://www.npmjs.com/), or [yarn](https://yarnpkg.com/getting-started/install).

{% tabs %}
{% tab title="npm" %}

```bash
npm install @angular-package/wrapper --save
```

{% endtab %}

{% tab title="yarn" %}

```
yarn add @angular-package/wrapper
```

{% endtab %}
{% endtabs %}


# Public API

Public features that can be imported.

```typescript
import {
  // Wrapper
  Wrap,
  Wrapper,
  // Type.
  Wrapped
} from '@angular-package/wrapper';
```


# Basic concepts

Explanation of terms specific to wrapper.

### Closing

The characters indicate the [wrap](#wrap) closing used at the **end** of the [wrapped text](#wrapped).

### Text <a href="#wrap-content" id="wrap-content"></a>

The text without the [opening](#opening) and [closing](#closing) characters.

### Opening

The characters indicate the [wrap](#wrap) opening used at the **beginning** of the [wrapped text](#wrapped).

### Wrap

As a **noun**, wrap consists of the **opening** and **closing** characters.

As a **verb**, wraps the specified text around with the opening chars **before** and the closing **after** the text.

### Wrapped text

The [text](#text) consists of [opening](#opening) characters at the **beginning** and [closing](#closing) at the **end**.

### Wrapper

A wrapper is an object consisting of a [wrap](#wrap), which uses it to wrap the specified [text](#text) around.


# Overview

## Wrap {}

The [`Wrap`](https://github.com/angular-package/wrapper/blob/main/src/lib/wrap.class.ts) object is based on the [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) object and represents the [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) [primitive value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf) of the [text](/getting-started/basic-concepts#wrap-content) wrapped by the [opening](/getting-started/basic-concepts#opening) and [closing](/getting-started/basic-concepts#closing) chars. It is designed to preserve the type names of the supplied opening, text, and closing chars by using the generic type variables.

{% embed url="<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_primitives_and_string_objects>" %}

{% embed url="<https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html>" %}

## Instance

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/y486cVc4dkfJSdWG82YB"><strong>closing</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> of the wrap by returning the <a href="/pages/oKLZ9AUvVxrQOUBye2mp"><code>#closing</code></a> property of the specified object.</p>                                                                                                                                                                                          |
| <p><a href="/pages/FVgRIdWWBG2tK8BmBSXg"><strong>opening</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> of the wrap by returning the <a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><code>#opening</code></a> property of the specified object.</p>                                                                                                                                                                                          |
| <p><a href="/pages/dVcsuee2Tiyg6m9Naczl">t<strong>ext</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the text of the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object.</p>                                                                                                                                                                                                |
| <p><a href="/pages/LjT4vPzcCOLRlNlnXHEK"><strong>\[Symbol.toStringTag]</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrap</code>.</p> |

### Properties

|                                                                                                                                                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/oKLZ9AUvVxrQOUBye2mp"><strong>#closing</strong></a><br>Private property of the closing chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-closing"><code>Closing</code></a>.</p>        |
| <p><a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><strong>#opening</strong></a><br>Private property of the opening chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-opening"><code>Opening</code></a>.</p>        |
| <p><a href="/pages/oDUSz67aGEA6VGbBULlE"><strong>#text</strong></a><br>Private property of text of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than"><code>Text</code></a>.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/DO4ArQjbDGnDv1Ta74Yy"><strong>getClosing()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#closing-closing"><code>#closing</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p><a href="/pages/sMY677pZekEiwLxaWOT8"><strong>getOpening()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> chars of the wrap by returning the <a href="/pages/GWnWPzSqNz97LBWzdDog#opening-opening"><code>#opening</code></a> property of a specified object.</p>                                                                                                                                                                                                                                                     |
| <p><a href="/pages/LoemdYYF2nsxY7XYurnU"><strong>getText()</strong></a><br>Gets the text of the wrap by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object, without the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of the <a href="/pages/vlRmumtdkPHxEUrU51WO"><code>Wrap</code></a>.</p>                                                                                                                                        |
| <p><a href="/pages/SwVbIKxEQyWEUHmJcqB7"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars or given <a href="/pages/SwVbIKxEQyWEUHmJcqB7#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                             |
| <p><a href="/pages/AXIumFXCrM0Gvjvp6Ygz"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified object has the <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars or given <a href="/pages/AXIumFXCrM0Gvjvp6Ygz#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                             |
| <p><a href="/pages/EPu74cDYJe28Jt8YJlfl"><strong>hasText()</strong></a><br>The method checks whether the <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object is defined, which means it's a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> of at least one char and optionally equal to the given <a href="/pages/EPu74cDYJe28Jt8YJlfl#text-string"><code>text</code></a>.</p>         |
| <p><a href="/pages/VDTORK00NPJgmbN7aELv"><strong>isWrapped()</strong></a><br>The method checks whether the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of the specified object is wrapped by the <a href="/pages/FVgRIdWWBG2tK8BmBSXg">opening</a> and <a href="/pages/y486cVc4dkfJSdWG82YB">closing</a> chars of an instance or given <a href="/pages/VDTORK00NPJgmbN7aELv#opening-string-this.-opening"><code>opening</code></a> and <a href="/pages/VDTORK00NPJgmbN7aELv#closing-string-this.-closing"><code>closing</code></a> chars.</p> |
| <p><a href="/pages/VqVru4aHNREMRPPI7C7x"><strong>★ replaceClosing()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/y486cVc4dkfJSdWG82YB"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p><a href="/pages/zKADrcHiPoJayJd5LR4Q"><strong>★ replaceOpening()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/FVgRIdWWBG2tK8BmBSXg"><code>opening</code></a> chars.</p>                                                                                                                                                                                                                                                                                                           |
| <p><a href="/pages/2khbXB2F6Yiq7r6I68nu"><strong>★ replaceText()</strong></a><br>Returns the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> with replaced <a href="/pages/dVcsuee2Tiyg6m9Naczl"><code>text</code></a>.</p>                                                                                                                                                                                                                                                                                                                       |
| <p><a href="/pages/6nAq7tnHWOAKno0FtVIY"><strong>toString()</strong></a><br>Gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, the <a href="/pages/K32cdMdrpsCcE0oMk8Ek">primitive value</a> of a specified <a href="#wrap"><code>Wrap</code></a> object.</p>                                                                                                                                                                                                                                                                                    |
| <p><a href="/pages/K32cdMdrpsCcE0oMk8Ek"><strong>valueOf()</strong></a><br>Returns the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap">wrap</a>, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/valueOf">primitive value</a> of a specified <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> object.</p>                                                                                                                                                                                            |

## Static

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/KqCEKG6pfYooFvLJylRi"><strong>hasClosing()</strong></a><br>Checks whether the <a href="/pages/KqCEKG6pfYooFvLJylRi#text-string"><code>text</code></a> has given <a href="/pages/KqCEKG6pfYooFvLJylRi#closing-string"><code>closing</code></a> chars at the end.</p>                                                                                                                                                        |
| <p><a href="/pages/5ZNZc77RcMzT5lXjVIQN"><strong>hasOpening()</strong></a><br>Checks whether the <a href="/pages/5ZNZc77RcMzT5lXjVIQN#text-string"><code>text</code></a> has given <a href="/pages/5ZNZc77RcMzT5lXjVIQN#opening-string"><code>opening</code></a> chars at the beginning.</p>                                                                                                                                                  |
| <p><a href="/pages/tMC6jpWbwyHbTibV7FVb"><strong>isWrap()</strong></a><br>The method checks whether the <a href="/pages/tMC6jpWbwyHbTibV7FVb#value-any"><code>value</code></a> of any type is the <a href="#wrap"><code>Wrap</code></a> instance of any or given <a href="/pages/tMC6jpWbwyHbTibV7FVb#opening-opening"><code>opening</code></a> and <a href="/pages/tMC6jpWbwyHbTibV7FVb#closing-closing"><code>closing</code></a> chars.</p> |


# Generic type variables

## `Wrap<`<mark style="color:green;">`Opening`</mark>`, ...>` <a href="#wrap-opening" id="wrap-opening"></a>

#### <mark style="color:green;">`Opening`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`string`</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value **captured** from the provided [`opening`](/wrap/constructor#opening-opening) indicates the opening type of a new [`Wrap`](/wrap/overview) instance.

{% code title="wrap.class.ts" %}

```typescript
class Wrap<
  Opening extends string = string, // <--- Declare generic type variable Opening.
  Text extends string = ``,
  Closing extends string = string
> extends String {
  ...
  constructor(
    opening: Opening, // <--- Capture generic type variable Opening.
    closing: Closing,
    text: Text = '' as Text
  ) { ... }
  ...
}
```

{% endcode %}

## `Wrap<...,`<mark style="color:green;">`Text`</mark>`, ...>`

#### <mark style="color:green;">`Text`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">` `` `</mark>

​A generic type variable constrained by the [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), by default of the value **captured** from the provided [`text`](/wrap/constructor#text-text) indicates the text type of a new [`Wrap`](/wrap/overview) instance.

{% hint style="info" %}
The constructor **`text`** parameter is optional, and if not provided, the default value of the generic type variable [`Text`](#wrap-less-than...-text-...greater-than) is not captured, but it's an empty [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string) from the declaration.
{% endhint %}

{% code title="wrap.class.ts" %}

```typescript
class Wrap<
  Opening extends string = string,
  Text extends string = ``, // <--- Declare generic type variable Text.
  Closing extends string = string
> extends String {
  ...
  constructor(
    opening: Opening,
    closing: Closing,
    text: Text = '' as Text  // <--- Capture generic type variable Text.
  ) { ... }
  ...
}
```

{% endcode %}

## `Wrap<...,`<mark style="color:green;">`Closing`</mark>`>` <a href="#wrap-closing" id="wrap-closing"></a>

#### <mark style="color:green;">`Closing`</mark>`extends`<mark style="color:green;">`string`</mark>`=`<mark style="color:green;">`string`</mark>

​A generic type variable constrained by the [`string`](https://www.typescriptlang.org/docs/handbook/basic-types.html#string), by default of the value **captured** from the provided [`closing`](/wrap/constructor#closing-closing) indicates the closing type of a new [`Wrap`](/wrap/overview) instance.

{% code title="wrap.class.ts" %}

```typescript
class Wrap<
  Opening extends string = string,
  Text extends string = ``,
  Closing extends string = string // <--- Declare generic type variable Closing.
> extends String {
  ...
  constructor(
    opening: Opening,
    closing: Closing, // <--- Capture generic type variable Closing.
    text: Text = '' as Text
  ) { ... }
  ...
}
```

{% endcode %}


# ★ Constructor

## `Wrap()`

Creates a new [`Wrap`](/wrap/overview) instance of the [`opening`](#opening-opening) and [`closing`](#closing-closing) chars and optional [`text`](#text-text) to wrap.&#x20;

{% code title="wrap.class.ts" %}

```typescript
constructor(opening: Opening, closing: Closing, text: Text = '' as Text) {
  super(`${opening}${text}${closing}`);
  this.#closing = String(closing) as Closing;
  this.#text = String(text) as Text;
  this.#opening = String(opening) as Opening;
}
```

{% endcode %}

### Parameters

#### `opening:`[<mark style="color:green;">`Opening`</mark>](/wrap/generic-type-variables#wrap-opening)

Opening characters of the generic type variable [`Opening`](/wrap/generic-type-variables#wrap-opening) placed before the given [`text`](#text-text). An empty [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) indicates that for the [`hasOpening()`](https://wrapper.angular-package.dev/wrap/pages/AXIumFXCrM0Gvjvp6Ygz#wrap.prototype.hasopening) and [`isWrapped()`](/wrap/methods/instance/iswrapped) methods, the [`opening`](/wrap/accessors/opening) chars are [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined), returning `false`.

#### `closing:`[<mark style="color:green;">`Closing`</mark>](/wrap/generic-type-variables#wrap-closing)

Closing characters of the generic type variable [`Closing`](/wrap/generic-type-variables#wrap-closing) placed after the given [`text`](#text-text). An empty [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) indicates that for the [`hasClosing()`](/wrap/methods/instance/hasclosing) and [`isWrapped()`](/wrap/methods/instance/iswrapped) methods, the [`closing`](/wrap/accessors/closing) chars are [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined), returning `false`.

#### `text:`[<mark style="color:green;">`Text`</mark>](https://wrapper.angular-package.dev/wrap/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than)`=`<mark style="color:green;">`''`</mark>

An optional text placed between the given [`opening`](#opening-opening) and [`closing`](#closing-closing) chars on the [template literal](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html) `${Opening}${Text}${Closing}`.

### Returns

The **return value** is a new instance of [`Wrap`](/wrap/overview) with the [primitive value](/wrap/methods/instance/valueof) of the provided [`opening`](#opening-opening), [`closing`](#closing-closing), and the optional [`text`](#text-text).

## Example usage

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

// Returns Wrap{'[]'}
new Wrap('[', ']');

// Returns Wrap{'nullnull'}
new Wrap(null as any, null as any);
```


# Accessors

## Public

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/y486cVc4dkfJSdWG82YB"><strong>closing</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#closing">closing</a> of the wrap by returning the <a href="/pages/oKLZ9AUvVxrQOUBye2mp"><code>#closing</code></a> property of the specified object.</p>                                                                                                                                                                                          |
| <p><a href="/pages/FVgRIdWWBG2tK8BmBSXg"><strong>opening</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#opening">opening</a> of the wrap by returning the <a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><code>#opening</code></a> property of the specified object.</p>                                                                                                                                                                                          |
| <p><a href="/pages/dVcsuee2Tiyg6m9Naczl">t<strong>ext</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#wrap-content">text</a> of the <a href="/pages/ynTr7YIdKgv6qw68JPND"><code>Wrap</code></a> by returning the <a href="/pages/oDUSz67aGEA6VGbBULlE"><code>#text</code></a> property of a specified object.</p>                                                                                                                                         |
| <p><a href="/pages/LjT4vPzcCOLRlNlnXHEK"><strong>\[Symbol.toStringTag]</strong></a><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a> of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol"><code>Symbol</code></a> changes the default tag <code>String</code> of the instance to the custom tag <code>Wrap</code>.</p> |


# closing

## `Wrap.prototype.closing`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor gets the [closing](/getting-started/basic-concepts#closing) of the wrap by returning the [`#closing`](/wrap/properties/closing) property of the specified object.

{% code title="wrap.class.ts" %}

```typescript
public get closing(): Closing {
  return this.#closing;
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Closing`</mark>

The **return type** is the generic type variable [`Closing`](/wrap/generic-type-variables#wrap-closing) declared in the [`Wrap`](/wrap/overview) class.

### Returns

The **return value** is [closing](/getting-started/basic-concepts#closing) of the wrap of a generic type variable [`Closing`](/wrap/generic-type-variables#wrap-closing).

## Example usage

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

// Returns ] of type "]".
new Wrap(`[`, `]`, 'quote').closing;
```


# opening

## `Wrap.prototype.opening`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor gets the [opening](/getting-started/basic-concepts#opening) of the wrap by returning the [`#opening`](/wrap/properties/opening) property of the specified object.

{% code title="wrap.class.ts" %}

```typescript
public get opening(): Opening {
  return this.#opening;
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Opening`</mark>

The **return type** is the generic type variable [`Opening`](/wrap/generic-type-variables#wrap-opening) declared in the [`Wrap`](/wrap/overview) class.

### Returns

The **return value** is the [opening](/getting-started/basic-concepts#opening) of the wrap of a generic type variable [`Opening`](/wrap/generic-type-variables#wrap-opening).

## Example usage

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

// Returns [ of type "[".
new Wrap(`[`, `]`, 'quote').opening;
```


# text

## `Wrap.prototype.text`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor gets the text of the [`Wrap`](/wrap/overview) by returning the [`#text`](/wrap/properties/text) property of a specified object.

{% code title="wrap.class.ts" %}

```typescript
public get text(): Text {
  return this.#text;
}
```

{% endcode %}

### Return type

#### <mark style="color:green;">`Text`</mark>

The **return type** is the generic type variable [`Text`](https://wrapper.angular-package.dev/wrap/accessors/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than) declared in the [`Wrap`](/wrap/overview) class.

### Returns

The **return value** is the text of a generic type variable [`Text`](https://wrapper.angular-package.dev/wrap/accessors/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than).

## Example usage

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

// Returns quote of type "quote".
new Wrap(`[`, `]`, 'quote').text;
```


# \[Symbol.toStringTag]

## `[Symbol.toStringTag]`

The [`get`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) accessor [`toStringTag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag) of the [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) changes the default tag `String` of the instance to the custom tag `Wrap`. It can be read by the [`typeOf()`](https://type.angular-package.dev/v/type-draft/helper/typeof) function of [`@angular-package/type`](https://type.angular-package.dev/).

{% code title="wrap.class.ts" %}

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

{% endcode %}

## Example usage

```typescript
// 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);
```


# Properties

## Private

|                                                                                                                                                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><a href="/pages/oKLZ9AUvVxrQOUBye2mp"><strong>#closing</strong></a><br>Private property of the closing chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-closing"><code>Closing</code></a>.</p>        |
| <p><a href="/pages/EtjyUg0R8ltFx3PbkaZQ"><strong>#opening</strong></a><br>Private property of the opening chars of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-opening"><code>Opening</code></a>.</p>        |
| <p><a href="/pages/oDUSz67aGEA6VGbBULlE"><strong>#text</strong></a><br>Private property of text of a generic type variable <a href="/pages/SYPkCWCkQnshiX32nwLt#wrap-less-than...-text-...greater-than"><code>Text</code></a>.</p> |


# #closing

## `#closing:`<mark style="color:green;">`Closing`</mark>

Private property of the [closing chars](/getting-started/basic-concepts#closing) of a generic type variable [`Closing`](/wrap/generic-type-variables#wrap-closing).

{% code title="wrap.class.ts" %}

```typescript
#closing: Closing;
```

{% endcode %}


# #opening

## `#opening:`<mark style="color:green;">`Opening`</mark>

Private property of the [opening chars](/getting-started/basic-concepts#opening) of a generic type variable [`Opening`](/wrap/generic-type-variables#wrap-opening).

{% code title="wrap.class.ts" %}

```typescript
#opening: Opening;
```

{% endcode %}




---

[Next Page](/llms-full.txt/1)

