Constructor

Wrapper()

Creates a new Wrapper instance with the opening and closing chars and optional text.

wrapper.class.ts
constructor(opening: Opening, closing: Closing, text: Text = '' as Text) {
  super(opening, closing, text);
}

Parameters

opening:Opening

The opening chars of a generic type variable Opening placed before the given text.

closing:Closing

The closing chars of a generic type variable Closing placed after the given text.

text:Text

Optional text of a generic type variable Text to wrap by given opening and closing chars.

Returns

The return value is a new instance of Wrapper.

Example usage

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

Last updated