For the complete documentation index, see llms.txt. This page is also available as Markdown.

Static methods

Tag.

Public

isTag()

The static method checks whether the provided value of any type is an instance of Tag.

public static isTag<Name extends string, Chars extends string = string>(
  value: any,
  name?: Name,
  chars?: Chars
): value is Tag<Name, Chars> {
  return isInstance(value, Tag)
    ? isDefined(name) || isDefined(chars)
      ? isDefined(name) && isDefined(chars)
        ? value.wrap.value === chars && value.name === name
        : isDefined(name)
        ? value.name === name
        : value.wrap.value === chars
      : true
    : false;
}

Generic type variables

Name / Description

Name extends string

​A generic type variable constrained by a string by default of the value captured from the provided name indicates the text type of Tag via the return type.

Chars extends string

​A generic type variable constrained by a string by default of the value captured from the provided chars parameter indicates the chars type of Tag via the return type.

Parameters

Name: type
Description

value: any

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

name?: Name

An optional tag name of a generic type variable Name.

chars?: Chars

An optional wrap of a generic type variable Chars.

Returns

Return type

value is Tag<Name, Chars>

The return type is a boolean indicating the value parameter is an instance of Tag that takes a generic type variable Name the tag name and Chars the wrap.

The return value is a boolean indicating whether the value is the Tag instance of any or given name, or of any or given wrap.

Example usage

Last updated