Function isPString

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

    Parameters

    • string_: string

      the string to test

    Returns string_ is `P${number}`

    true if the string is a QString

    Example

    const property = 'Q123';
    if(!isPString(property)) {
    throw new Error('not a PString');
    }
    WikibaseItemSnak.fromID(property, 'Q123');

Generated using TypeDoc