toWrap()

Wrapper.prototype.toWrap()

Returns the Wrap instance consists of the text, opening and closing chars of the Wrapper object.

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

Return type

Wrap<Opening,Text,Closing>

The return type is the Wrap object that takes generic type variables Opening, Text and Closing.

Returns

The return value is an instance of Wrap consisting of the text, opening, and closing chars of the Wrapper object.

Example usage

// 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();

Last updated