Tests if a string is a PString. Can also be used as a type guard.
The string to test.
True if the string is a PString.
const property = 'P123'; if (!isPString(property)) { throw new Error('Not a PString'); } WikibaseItemSnak.fromID(property, 'Q123'); Copy
const property = 'P123'; if (!isPString(property)) { throw new Error('Not a PString'); } WikibaseItemSnak.fromID(property, 'Q123');
Tests if a string is a PString. Can also be used as a type guard.