v: Static methods

Public

Wrapper.define()

Defines a new Wrapper instance consisting of the opening and closing chars.

wrapper.class.ts
public static define<Opening extends string, Closing extends string>(
  opening: Opening,
  closing: Closing
): Wrapper<Opening, Closing> {
  return new this(opening, closing);
}
Generic type variables

Opening extends string

A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided opening indicates the type of the opening in the Wrapper via return type.

Closing extends string

A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided closing indicates the type of the closing in the Wrapper via return type.

Parameters

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.

Returns

The return value is a new Wrapper instance of given opening and closing chars.

Example usage

Wrapper.isWrapper()

The method checks if the value of any type is an instance of the Wrapper of any, or given opening and closing chars.

Generic type variables

Opening extends string

A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided opening indicates the type of the opening in the Wrapper via return type.

Closing extends string

A generic type variable constrained by the stringarrow-up-right, by default of the value captured from the provided closing indicates the type of the closing in the Wrapper via return type.

Parameters

Name: type
Description

value: any

The value of any type to test against the instance of Wrapper.

opening?: Opening

Optional opening chars of a generic type variable Opening to check if the given value contains.

closing?: Closing

Optional closing chars of a generic type variable Closing to check if the given value contains.

Returns

Return type

value is Wrapper<Opening, Closing>

The return type indicates the value is the Wrapper instance.

The return value is a booleanarrow-up-right type indicating whether the value is an instance of Wrapper of any, or the given opening and closing chars.

Example usage

Last updated