The value to validate
Type predicate indicating if the value is a valid InChIKey
isInChIKey("IRXRGVFLQOSHOH-UHFFFAOYSA-L") // Returns true
isInChIKey("not-an-inchikey") // Returns false
export function isInChIKey(value: unknown): value is InChIKey<string> {
return typeof value === 'string' && /^[A-Z]{14}-[A-Z]{10}-[A-Z]$/.test(value);
}
Type guard to validate if a value is an InChIKey. An InChIKey is three hyphen-separated uppercase-letter blocks of 14, 10, and 1 characters.