★ wrap()
Wrapper.prototype.wrap()
Wrapper.prototype.wrap()
The method wraps the primitive value of a specified Wrapper
object by its opening
and closing
chars, or the given opening
and closing
chars.
Generic type variables
CustomOpening
extends
string
=
Opening
CustomOpening
extends
string
=
Opening
A generic type variable constrained by the string
indicates the captured type of the supplied opening
parameter and the Opening
type in the generic type Wrapped
via return type, by default generic type variable Opening
of the Wrapper
object.
CustomClosing
extends
string
=
Closing
CustomClosing
extends
string
=
Closing
A generic type variable constrained by the string
indicates the captured type of the supplied closing
parameter and the Closing
type in the generic type Wrapped
via return type, by default generic type variable Closing
of the Wrapper
object.
Parameters
opening:
CustomOpening
opening:
CustomOpening
Optional opening chars of a generic type variable CustomOpening
to wrap the primitive value of the Wrapper
instance.
closing:
CustomClosing
closing:
CustomClosing
Optional closing chars of a generic type variable CustomClosing
to wrap the primitive value of the Wrapper
instance.
Return type
Wrapped<CustomOpening, Wrapped<Opening, Text, Closing>, CustomClosing>
Wrapped<CustomOpening, Wrapped<Opening, Text, Closing>, CustomClosing>
The return type is the generic type Wrapped
that takes generic type variables Opening
, Text
and Closing
.
Returns
The return value is a primitive value wrapped by the opening
and closing
chars of the Wrapper
instance or the given opening
and closing
chars.
Example usage
Last updated