Documentation / @facturometro/einvoice / identifiers / abn
Function: abn() ​
abn(
value):boolean
Defined in: packages/validator/src/identifiers/abn.ts:19
u:abn: the weighted modulo-89 check of an Australian Business Number (PEPPOL-COMMON-R050, scheme 0151).
Port of the Schematron function: the first digit less one, then the other ten digits, are weighted 10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 and the sum must be divisible by 89. The rule guards the call with matches(., '^[0-9]{11}$'); this port returns false for anything else.
Parameters ​
value ​
string
The identifier, whitespace-normalized.
Returns ​
boolean
true when the check passes.
Example ​
ts
import { abn } from '@facturometro/validator';
abn('51824753556'); // true
abn('51824753557'); // false