iwf
    Preparing search index...

    Function isPString

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

      Parameters

      • string_: string

        The string to test.

      Returns string_ is `P${number}`

      True if the string is a PString.

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