Function isLString

  • Tests if a string is a LString. Can also be used as a type guard.

    Parameters

    • string_: string

      The string to test.

    Returns string_ is `L${number}`

    True if the string is a LString.

    const property = 'L123';
    if (!isLString(property)) {
    throw new Error('Not a LString');
    }
    WikibaseLexemeSnak.fromID(property);