test if a string is a PString can also be used a type guard
the string to test
true if the string is a QString
const property = 'Q123'; if(!isPString(property)) { throw new Error('not a PString'); } WikibaseItemSnak.fromID(property, 'Q123'); Copy
const property = 'Q123'; if(!isPString(property)) { throw new Error('not a PString'); } WikibaseItemSnak.fromID(property, 'Q123');
Generated using TypeDoc
test if a string is a PString can also be used a type guard