Function isQString

  • test if a string is a QString can also be used a type guard

    Parameters

    • string_: string

      the string to test

    Returns string_ is `Q${number}`

    true if the string is a QString

    Example

    const id = 'Q123';
    if(!isQString(id)) {
    throw new Error('not a QString');
    }
    WikibaseItemSnak.fromID('P42', id);

Generated using TypeDoc