Static methods
Last updated
Last updated
Wrapper.define()
Defines a new Wrapper
instance consisting of the allowed opening and closing.
Good to know: The opening and closing parameters are filtered by the allowed chars.
Generic type variables |
---|
Name: type | Description |
---|---|
The return value is a new Wrapper
instance of given opening and closing.
Wrapper.getAllowedChars()
Gets the allowed characters of the AllowedChars
type from the static Wrapper
.
Good to know: The method refers to a private static property allowedChars
which is the default value for filtering the wrap in the static define()
, setWrap()
, wrapText()
methods.
The return value is a an AllowedChars
pattern of allowed characters.
Wrapper.getWrap()
Gets an instance of Wrap
stored in the static Wrapper
.
Good to know: The method refers to a private static property wrap that is used by the static wrapText()
method for wrapping the text.
The return value is an instance of Wrap
.
Wrapper.isWrapper()
The method checks if the value of any type is an instance of the Wrapper
.
The return value is a boolean
type indicating whether the value is an instance of Wrapper
.
Wrapper.setAllowedChars()
The method sets the default pattern of allowed characters for static Wrapper
.
Good to know: The allowed characters refers to a private static allowedChars
property, which is the default value for filtering the wrap in the static define()
, setWrap()
, wrapText()
methods.
The return value is a static Wrapper
.
Wrapper.setWrap()
Sets a new instance of Wrap
into the static Wrapper
. The wrap set by this method is used to wrap the text by the static wrapText()
method for wrapping the text.
Good to know: The opening
and closing
parameters are filtered by the allowed characters of static Wrapper
set by the static method setAllowedChars()
.
The return value is a static Wrapper
.
Wrapper.wrapText()
The static method wraps the specified text with a stored Wrap
instance in the static Wrapper
or with a given opening or closing.
Good to know: The opening
and closing
parameters are filtered by the allowed chars of static Wrapper
set by the static method setAllowedChars()
.
The return value is a new Wrapped
instance of given text.
Generic type variables |
---|
Generic type variables |
---|
Name: type | Description |
---|---|
Return type |
---|
Name: type | Description |
---|---|
Generic type variables |
---|
Name: type | Description |
---|---|
Generic type variables |
---|
Name: type | Description |
---|---|
opening: Opening
The allowed opening of the wrap of a generic type variable Opening
.
closing: Closing
The allowed closing of the wrap of a generic type variable Closing
.
value: any
The value of any type to test against the instance of Wrapper
.
opening?: Opening
An optional wrap opening
to check if the given value
contains.
closing?: Closing
An optional wrap closing
to check if the given value
contains.
value is Wrapper
The return type indicates the value
is the Wrapper
instance.
allowedChars: RegExp
The allowed characters of the RegExp
to set.
opening: Opening
The wrap opening of a generic type variable Opening
.
closing: Closing
The wrap closing of a generic type variable Closing
.
text: Text
opening: Opening
An optional wrap opening of a generic type variable Opening
to wrap the given text
. If the opening
is not provided, then the opening from the Wrap
instance of static Wrapper
is used.
closing: Closing
An optional wrap closing of a generic type variable Closing
to wrap the given text
. If the closing
is not provided, then the closing from the Wrap
instance of static Wrapper
is used.