isClosingIn()

Wrapper.prototype.isClosingIn()

Determines whether the provided text has the closing chars of the specified Wrapper object at the end.

wrapper.class.ts
public isClosingIn(text: string): boolean {
  return Wrapper.hasClosing(text, this.closing);
}

Parameters

text: string

The text of string to test for the existence of the closing chars at the end of it.

Returns

The return value is a boolean indicating whether the given text has the closing chars of the wrap.

Example usage

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

Last updated