hasOpening()
Wrap.prototype.hasOpening()
Wrap.prototype.hasOpening()Checks whether the primitive value of a specified object has the opening chars or given opening chars.
public hasOpening(opening?: string): boolean {
return (
this.#opening.length >= 1 &&
(typeof opening === 'string' ? this.#opening === opening : true)
);
}Parameters
opening?: string
opening?: stringOptional opening chars of a string type to check if the primitive value contains them at the beginning.
Returns
The return value is a boolean indicating whether the primitive value has the opening chars or given opening chars.
Example usage
Given closing chars
closing charsLast updated
Was this helpful?