Instance methods

Public

Wrapper.prototype.isTextWrapped()

The method checks if the provided text is wrapped with the wrap of the specified Wrapper object.

wrapper.class.ts
public isTextWrapped<Text extends string>(text: Text): text is Text {
  return this.textHasClosing(text) && this.textHasOpening(text);
}
Generic type variables

Text extends string

​A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided text parameter, confirms the text type via the return type.

Parameters

Name: type
Description

text: Text

The text of a generic type variable Text to check whether it is wrapped.

Returns

The return value is a booleanarrow-up-right indicating whether the provided text is wrapped.

Example usage

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

// Returns true of text is "[quote]"
new Wrapper(`[`, `]`).isTextWrapped(`[quote]`);

Wrapper.prototype.textHasClosing()

Checks if the provided text has a closing of the specified Wrapper object.

Generic type variables

Text extends string

​A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided text parameter, confirms the text type via the return type.

Parameters

Name: type
Description

text: Text

The text to test against the existence of the closing.

Returns

The return value is a booleanarrow-up-right indicating whether the given text has the closing of the wrap.

Example usage

Wrapper.prototype.textHasOpening()

Checks if the provided text has an opening of the specified Wrapper object.

Generic type variables

Text extends string

​A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided text parameter, confirms the text type via the return type.

Parameters

Name: type
Description

text: Text

The text to test against the existence of the opening.

Returns

The return value is a booleanarrow-up-right indicating whether the given text has the opening of the wrap.

Example usage

Wrapper.prototype.unwrapText()

Returns the unwrapped text, without the opening and closing of the Wrapper.

Parameters

Name: type
Description

text: string

The text to unwrap.

Returns

The return value is the unwrapped text of a stringarrow-up-right if the opening or closing is found or the given text.

Example usage

Wrapper.prototype.wrapText()

Wraps specific text with the wrap, the opening, and closing of the Wrapper object.

Generic type variables

Text extends string

​A generic type variable constrained by the stringarrow-up-right by default of the value captured from the provided text parameter indicates the text type of Wrapped via the return type.

Parameters

Name: type
Description

text: Text

The text of a generic type variable Text, to be wrapped.

Returns

The return value is a new instance of Wrapped type consisting of the wrapped text.

Example usage

Last updated