function hasTagValue
hasTagValue(
words: string[],
tag: string
): boolean

Checks if a sentence has a specific tag value

Returns true if the word array contains a .tag attribute with the specified value.

Examples

Check for specific tag value

import { assertEquals } from "@std/assert";
import { hasTagValue } from "@hertzg/routeros-api/utils/tag";

const words = ["/interface/print", ".tag=abc123"];
assertEquals(hasTagValue(words, "abc123"), true);
assertEquals(hasTagValue(words, "xyz789"), false);

Parameters

words: string[]

Array of words from a sentence

tag: string

The tag value to check for

Return Type

boolean

True if the specific tag value is present

Usage

import { hasTagValue } from "utils/tag.ts";