⚠ textHasClosing()
The method does not yet exist.
Wrapper.prototype.textHasClosing()
Wrapper.prototype.textHasClosing()Checks if the provided text has the closing of specified Wrapper object at the end of the text.
public textHasClosing(text: string): boolean {
return (
isStringType(text) && text.slice(-this.closing.length) === this.closing
);
}Parameters
Name: type
Description
text: string
The text of a string to test against the existence of the closing chars.
Returns
The return value is a boolean indicating whether the given text has the closing of the wrap.
Example usage
// Example usage.
import { Wrapper } from '@angular-package/wrapper';
// Returns true of boolean.
new Wrapper(`[`, `]`).textHasClosing(`[quote]`);
// Returns false of boolean.
new Wrapper(`{{`, `}}`).textHasClosing(`{{variable`);Last updated
Was this helpful?