# Overview

## Wrapper {}

The [`Wrapper`](https://github.com/angular-package/wrapper/blob/main/src/lib/wrapper.class.ts) is an extension of the [`Wrap`](https://wrapper.angular-package.dev/wrapper-draft/wrap) object, which means it represents the [immutable](https://developer.mozilla.org/en-US/docs/Glossary/Immutable) wrap of the [opening](https://wrapper.angular-package.dev/wrapper-draft/getting-started/basic-concepts#opening) and [closing](https://wrapper.angular-package.dev/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="../accessors/get-symbol.tostringtag#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="methods/isclosingin"><strong>isClosingIn()</strong></a><br>Determines whether the provided <a href="../methods/isclosingin#text-string"><code>text</code></a> has the <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars of the specified <a href=""><code>Wrapper</code></a> object at the <strong>end</strong>.</p>                                                                                                                                                                                                                                                                                                                  |
| <p>public <a href="methods/isopeningin"><strong>isOpeningIn()</strong></a><br>Checks whether the provided <a href="../methods/isopeningin#text-string"><code>text</code></a> has the <a href="../wrap/accessors/get-opening"><code>opening</code></a> chars of a specified <a href=""><code>Wrapper</code></a> object at the <strong>beginning</strong>.</p>                                                                                                                                                                                                                                                                                                                  |
| <p>public <a href="methods/replaceclosingin"><strong>replaceClosingIn()</strong></a><br>Replaces the <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars of the <a href="overview"><code>Wrapper</code></a> object in the given <a href="../methods/replaceclosingin#text-string"><code>text</code></a> with a given <a href="../methods/replaceclosingin#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                                  |
| <p>public <a href="../methods/replaceopeningin#replacevalue-string"><strong>replaceOpeningIn()</strong></a><br>Replaces the <a href="../wrap/accessors/get-opening"><code>opening</code></a> chars of the <a href=""><code>Wrapper</code></a> object in the given <a href="../methods/replaceopeningin#text-string"><code>text</code></a> with a given <a href="../methods/replaceopeningin#replacevalue-string">replacement value</a>.</p>                                                                                                                                                                                                                                   |
| <p>public <a href="methods/removewrapin"><strong>removeWrapIn()</strong></a><br>Returns given <a href="../methods/removewrapin#text-string"><code>text</code></a> without the <a href="../wrap/accessors/get-opening"><code>opening</code></a> and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars of the <a href=""><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                                              |
| <p>public <a href="methods/textreplaceclosing"><strong>textReplaceClosing()</strong></a><br>Replaces the <a href="../../wrap/accessors#wrap.prototype.closing"><code>closing</code></a> chars of the <a href=""><code>Wrapper</code></a> object in the <a href="../wrap/accessors/get-text"><code>text</code></a> of the <a href=""><code>Wrapper</code></a> object with the given <a href="../methods/textreplaceclosing#closing-string"><code>closing</code></a> chars.</p>                                                                                                                                                                                                 |
| <p>public <a href="methods/textreplaceopening"><strong>textReplaceOpening()</strong></a><br>Replaces the <a href="../wrap/accessors/get-opening"><code>opening</code></a> chars of the <a href=""><code>Wrapper</code></a> object in the <a href="../wrap/accessors/get-text"><code>text</code></a> of the <a href=""><code>Wrapper</code></a> object with the given <a href="../methods/textreplaceopening#opening-string"><code>opening</code></a> chars.</p>                                                                                                                                                                                                               |
| <p>public <a href="methods/textunwrap"><strong>textUnwrap()</strong></a><br>The method returns the <a href="../wrap/accessors/get-text"><code>text</code></a> of the <a href=""><code>Wrapper</code></a> object without its <a href="../../wrap/accessors#wrap.prototype.opening"><code>opening</code></a> and <a href="../../wrap/accessors#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="methods/textwrap"><strong>textWrap()</strong></a><br>The method returns the <a href="../wrap/accessors/get-text"><code>text</code></a> of the <a href=""><code>Wrapper</code></a> object wrapped by the given <a href="../methods/textwrap#opening-textopening"><code>opening</code></a> and <a href="../methods/textwrap#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                         |
| <p>public <a href="methods/toarray"><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="../wrap/accessors/get-opening"><code>opening</code></a> chars, <a href="../wrap/accessors/get-text"><code>text</code></a>, and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                |
| <p>public <a href="methods/towrap"><strong>toWrap()</strong></a><br>Returns the <a href="../wrap"><code>Wrap</code></a> instance consists of the <a href="../wrap/accessors/get-text"><code>text</code></a>, <a href="../wrap/accessors/get-opening"><code>opening</code></a> and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars of the <a href=""><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                               |
| <p>public <a href="methods/unwrap"><strong>unwrap()</strong></a><br>Returns the <a href="../wrap/accessors/get-text"><code>text</code></a> without the <a href="../wrap/accessors/get-opening"><code>opening</code></a> and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                                                                                                                                                                       |
| <p>public <a href="methods/unwraptext"><strong>unwrapText()</strong></a><br>The method returns the <a href="../wrap/methods/valueof">primitive value</a> of a specified <a href=""><code>Wrapper</code></a> object with <a href="../wrap/accessors/get-text"><code>text</code></a> unwrapped from the <a href="../wrap/accessors/get-opening"><code>opening</code></a> and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars of the <a href=""><code>Wrapper</code></a> instance or given <a href="../methods/unwraptext#opening-string"><code>opening</code></a> and <a href="../methods/unwraptext#closing-string"><code>closing</code></a> chars.</p> |
| <p>public <a href="methods/wrap"><strong>★ wrap()</strong></a><br>The method wraps the <a href="../wrap/methods/valueof">primitive value</a> of a specified <a href=""><code>Wrapper</code></a> object by its <a href="../wrap/accessors/get-opening"><code>opening</code></a> and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars, or the given <a href="../methods/wrap#opening-customopening"><code>opening</code></a> and <a href="../methods/wrap#closing-customclosing"><code>closing</code></a> chars.</p>                                                                                                                                      |
| <p>public <a href="methods/wrapon"><strong>★ wrapOn()</strong></a><br>The method wraps the given <a href="../methods/wrapon#text-customtext"><code>text</code></a> with the wrap, the <a href="../wrap/accessors/get-opening"><code>opening</code></a>, and <a href="../wrap/accessors/get-closing"><code>closing</code></a> chars of the <a href="overview"><code>Wrapper</code></a> object.</p>                                                                                                                                                                                                                                                                             |
| <p>public <a href="methods/wraptext"><strong>★ wrapText()</strong></a><br>The method returns the <a href="../wrap/methods/valueof">primitive value</a> of the <a href=""><code>Wrapper</code></a> object with <a href="../wrap/accessors/get-text"><code>text</code></a> wrapped by given <a href="../methods/wraptext#opening-textopening"><code>opening</code></a> and <a href="../methods/wraptext#closing-textclosing"><code>closing</code></a> chars.</p>                                                                                                                                                                                                                |

## public Static

### Methods

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