Simple Typescript utility script for validation of Croatian Personal identification number. Also it can generate valid OIB for testing purposes.
import { validateOIB, generateRandomOIB } from 'croib';
const randomOib = generateRandomOIB();
const isValid = validateOIB(randomOib);
if (isValid) {
throw new Error('Invalid OIB');
}
To @gnekich for the idea. Check his Javscript library oiblib.