★ Constructor
Wrap()
Wrap()
Creates a new Wrap
instance of the opening
and closing
chars and optional text
to wrap.
Parameters
Opening characters of the generic type variable Opening
placed before the given text
. An empty string
indicates that for the hasOpening()
and isWrapped()
methods, the opening
chars are undefined
, returning false
.
Closing characters of the generic type variable Closing
placed after the given text
. An empty string
indicates that for the hasClosing()
and isWrapped()
methods, the closing
chars are undefined
, returning false
.
An optional text placed between the given opening
and closing
chars on the template literal ${Opening}${Text}${Closing}
.
Returns
The return value is a new instance of Wrap
with the primitive value of the provided opening
, closing
, and the optional text
.
Example usage
Last updated