au-identifiers 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +64 -2
- package/dist/cjs/index.d.ts +18 -0
- package/dist/cjs/index.js +101 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/index.d.ts +18 -0
- package/dist/esm/index.js +86 -0
- package/package.json +58 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Business API Pty Ltd
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Australian ABN, ACN and TFN Validation for JavaScript and TypeScript
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/BusinessAPI/au-identifiers-js/actions/workflows/test.yml) [](https://www.npmjs.com/package/au-identifiers) [](LICENSE)
|
|
4
|
+
|
|
5
|
+
Validate and format Australian identifiers in JavaScript and TypeScript: ABN, ACN, ARBN, TFN, Director ID and VIN.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install au-identifiers
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { isValidAbn, formatAbn, formatAcn, isValidTfn, isValidDirectorId, normaliseVin } from 'au-identifiers';
|
|
13
|
+
|
|
14
|
+
isValidAbn('51 824 753 556'); // true
|
|
15
|
+
formatAbn('51824753556'); // '51 824 753 556'
|
|
16
|
+
formatAcn('004085616'); // '004 085 616'
|
|
17
|
+
isValidTfn('15195606'); // true (8-digit, organisation)
|
|
18
|
+
isValidTfn('15195606', { individual: true }); // false
|
|
19
|
+
isValidDirectorId('036 123 456 789 012'); // true
|
|
20
|
+
normaliseVin(' 1hgcm82633a004352 '); // '1HGCM82633A004352'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Each identifier has `isValid*` and `normalise*`. ABN, ACN and ARBN also have `format*`. `normalise*` and `format*` return `null` for invalid input. ESM and CommonJS, types included, no dependencies. ARBN has `*Arbn` aliases of the ACN functions.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
| | Format | Check |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| ABN | 11 digits | ATO modulus 89 |
|
|
30
|
+
| ACN, ARBN | 9 digits | ASIC check digit |
|
|
31
|
+
| TFN | 8 or 9 digits | ATO modulus 11 |
|
|
32
|
+
| Director ID | 15 digits, starts with 036 | Format only |
|
|
33
|
+
| VIN | 17 characters, no I, O or Q | Format only (ISO 3779) |
|
|
34
|
+
|
|
35
|
+
Spaces and hyphens in numbers are ignored. VINs are trimmed and upper-cased. Anything else makes the value invalid. Pass ACNs, TFNs and Director IDs as strings so leading zeros aren't lost.
|
|
36
|
+
|
|
37
|
+
## How the checks work
|
|
38
|
+
|
|
39
|
+
### ABN
|
|
40
|
+
|
|
41
|
+
Subtract 1 from the first digit, multiply the 11 digits by 10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 and add them up. The ABN is valid if the total divides evenly by 89. For 51 824 753 556 the total is 534, which is 89 x 6.
|
|
42
|
+
|
|
43
|
+
### ACN and ARBN
|
|
44
|
+
|
|
45
|
+
Multiply the first 8 digits by 8, 7, 6, 5, 4, 3, 2, 1 and add them up. Take the remainder after dividing by 10 and subtract it from 10 (10 becomes 0). That's the check digit, and it must match the last digit. For 004 085 616 the total is 84, so the check digit is 6.
|
|
46
|
+
|
|
47
|
+
### TFN
|
|
48
|
+
|
|
49
|
+
Multiply the 9 digits by 1, 4, 3, 7, 5, 8, 6, 9, 10 and add them up. The TFN is valid if the total divides evenly by 11. For 123 456 782 the total is 253, which is 11 x 23.
|
|
50
|
+
|
|
51
|
+
8-digit TFNs (organisations only) use the weights 1, 4, 3, 7, 5, 8, 6, 10. A 9-digit TFN with a leading zero is valid if either the 9-digit check or the 8-digit check on the rest passes. Set the individual option for a person's TFN, which is always 9 digits.
|
|
52
|
+
|
|
53
|
+
### Director ID and VIN
|
|
54
|
+
|
|
55
|
+
The Director ID check digit method is only given to ATO-registered software providers, so it's a format check here. VINs are checked for 17 characters with no I, O or Q (ISO 3779). Australia doesn't use the VIN check digit.
|
|
56
|
+
|
|
57
|
+
## Valid isn't registered
|
|
58
|
+
|
|
59
|
+
These checks run offline and only tell you a number is well formed. To check an ABN or ACN is registered and active, or to register companies, ABNs and business names, use the [Business API ABN lookup and company registration API](https://businessapi.com.au).
|
|
60
|
+
|
|
61
|
+
Also available for [Python](https://github.com/BusinessAPI/au-identifiers-python), [PHP](https://github.com/BusinessAPI/au-identifiers-php), [.NET](https://github.com/BusinessAPI/au-identifiers-dotnet), [Java](https://github.com/BusinessAPI/au-identifiers-java).
|
|
62
|
+
|
|
63
|
+
## Licence
|
|
64
|
+
|
|
65
|
+
MIT
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function normaliseAbn(value: unknown): string | null;
|
|
2
|
+
export declare function isValidAbn(value: unknown): boolean;
|
|
3
|
+
export declare function formatAbn(value: unknown): string | null;
|
|
4
|
+
export declare function normaliseAcn(value: unknown): string | null;
|
|
5
|
+
export declare function isValidAcn(value: unknown): boolean;
|
|
6
|
+
export declare function formatAcn(value: unknown): string | null;
|
|
7
|
+
export declare const normaliseArbn: typeof normaliseAcn;
|
|
8
|
+
export declare const isValidArbn: typeof isValidAcn;
|
|
9
|
+
export declare const formatArbn: typeof formatAcn;
|
|
10
|
+
export interface TfnOptions {
|
|
11
|
+
individual?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function normaliseTfn(value: unknown, options?: TfnOptions): string | null;
|
|
14
|
+
export declare function isValidTfn(value: unknown, options?: TfnOptions): boolean;
|
|
15
|
+
export declare function normaliseDirectorId(value: unknown): string | null;
|
|
16
|
+
export declare function isValidDirectorId(value: unknown): boolean;
|
|
17
|
+
export declare function normaliseVin(value: unknown): string | null;
|
|
18
|
+
export declare function isValidVin(value: unknown): boolean;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatArbn = exports.isValidArbn = exports.normaliseArbn = void 0;
|
|
4
|
+
exports.normaliseAbn = normaliseAbn;
|
|
5
|
+
exports.isValidAbn = isValidAbn;
|
|
6
|
+
exports.formatAbn = formatAbn;
|
|
7
|
+
exports.normaliseAcn = normaliseAcn;
|
|
8
|
+
exports.isValidAcn = isValidAcn;
|
|
9
|
+
exports.formatAcn = formatAcn;
|
|
10
|
+
exports.normaliseTfn = normaliseTfn;
|
|
11
|
+
exports.isValidTfn = isValidTfn;
|
|
12
|
+
exports.normaliseDirectorId = normaliseDirectorId;
|
|
13
|
+
exports.isValidDirectorId = isValidDirectorId;
|
|
14
|
+
exports.normaliseVin = normaliseVin;
|
|
15
|
+
exports.isValidVin = isValidVin;
|
|
16
|
+
const ABN_WEIGHTS = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
|
|
17
|
+
const ACN_WEIGHTS = [8, 7, 6, 5, 4, 3, 2, 1];
|
|
18
|
+
const TFN_WEIGHTS_9 = [1, 4, 3, 7, 5, 8, 6, 9, 10];
|
|
19
|
+
const TFN_WEIGHTS_8 = [1, 4, 3, 7, 5, 8, 6, 10];
|
|
20
|
+
const VIN = /^[A-HJ-NPR-Z0-9]{17}$/;
|
|
21
|
+
function digits(value, lengths) {
|
|
22
|
+
if (typeof value !== 'string' && !(typeof value === 'number' && Number.isSafeInteger(value) && value >= 0)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const compact = String(value).replace(/[ \t\n\r\v\f-]/g, '');
|
|
26
|
+
return lengths.includes(compact.length) && /^[0-9]+$/.test(compact) ? compact : null;
|
|
27
|
+
}
|
|
28
|
+
function weightedSum(value, weights) {
|
|
29
|
+
let sum = 0;
|
|
30
|
+
for (let i = 0; i < weights.length && i < value.length; i++)
|
|
31
|
+
sum += Number(value[i]) * weights[i];
|
|
32
|
+
return sum;
|
|
33
|
+
}
|
|
34
|
+
function normaliseAbn(value) {
|
|
35
|
+
const abn = digits(value, [11]);
|
|
36
|
+
if (abn === null)
|
|
37
|
+
return null;
|
|
38
|
+
// Subtract 1 from the first digit, then the weighted sum must be divisible by 89.
|
|
39
|
+
const total = (Number(abn[0]) - 1) * ABN_WEIGHTS[0] + weightedSum(abn.slice(1), ABN_WEIGHTS.slice(1));
|
|
40
|
+
return total % 89 === 0 ? abn : null;
|
|
41
|
+
}
|
|
42
|
+
function isValidAbn(value) {
|
|
43
|
+
return normaliseAbn(value) !== null;
|
|
44
|
+
}
|
|
45
|
+
function formatAbn(value) {
|
|
46
|
+
const abn = normaliseAbn(value);
|
|
47
|
+
return abn && `${abn.slice(0, 2)} ${abn.slice(2, 5)} ${abn.slice(5, 8)} ${abn.slice(8)}`;
|
|
48
|
+
}
|
|
49
|
+
function normaliseAcn(value) {
|
|
50
|
+
const acn = digits(value, [9]);
|
|
51
|
+
if (acn === null)
|
|
52
|
+
return null;
|
|
53
|
+
const check = (10 - (weightedSum(acn, ACN_WEIGHTS) % 10)) % 10;
|
|
54
|
+
return Number(acn[8]) === check ? acn : null;
|
|
55
|
+
}
|
|
56
|
+
function isValidAcn(value) {
|
|
57
|
+
return normaliseAcn(value) !== null;
|
|
58
|
+
}
|
|
59
|
+
function formatAcn(value) {
|
|
60
|
+
const acn = normaliseAcn(value);
|
|
61
|
+
return acn && `${acn.slice(0, 3)} ${acn.slice(3, 6)} ${acn.slice(6)}`;
|
|
62
|
+
}
|
|
63
|
+
exports.normaliseArbn = normaliseAcn;
|
|
64
|
+
exports.isValidArbn = isValidAcn;
|
|
65
|
+
exports.formatArbn = formatAcn;
|
|
66
|
+
function normaliseTfn(value, options = {}) {
|
|
67
|
+
// 8-digit TFNs (organisations only) have their own weights. A 9-digit TFN with a leading
|
|
68
|
+
// zero passes on either the 9-digit check or the 8-digit check of the rest.
|
|
69
|
+
const tfn = digits(value, options.individual ? [9] : [8, 9]);
|
|
70
|
+
if (tfn === null)
|
|
71
|
+
return null;
|
|
72
|
+
if (tfn.length === 9 && tfn.replace(/^0+/, '').length >= 8 && weightedSum(tfn, TFN_WEIGHTS_9) % 11 === 0) {
|
|
73
|
+
return tfn;
|
|
74
|
+
}
|
|
75
|
+
const core = tfn.replace(/^0+/, '');
|
|
76
|
+
const weights = core.length === 9 ? TFN_WEIGHTS_9 : core.length === 8 ? TFN_WEIGHTS_8 : null;
|
|
77
|
+
return weights && weightedSum(core, weights) % 11 === 0 ? tfn : null;
|
|
78
|
+
}
|
|
79
|
+
function isValidTfn(value, options = {}) {
|
|
80
|
+
return normaliseTfn(value, options) !== null;
|
|
81
|
+
}
|
|
82
|
+
function normaliseDirectorId(value) {
|
|
83
|
+
// Format only. The check digit method is only given to ATO-registered software providers.
|
|
84
|
+
const did = digits(value, [15]);
|
|
85
|
+
return did && did.startsWith('036') ? did : null;
|
|
86
|
+
}
|
|
87
|
+
function isValidDirectorId(value) {
|
|
88
|
+
return normaliseDirectorId(value) !== null;
|
|
89
|
+
}
|
|
90
|
+
function normaliseVin(value) {
|
|
91
|
+
if (typeof value !== 'string')
|
|
92
|
+
return null;
|
|
93
|
+
const trimmed = value.replace(/^[ \t\n\r\v\f]+|[ \t\n\r\v\f]+$/g, '');
|
|
94
|
+
if (!/^[\x00-\x7f]*$/.test(trimmed))
|
|
95
|
+
return null;
|
|
96
|
+
const vin = trimmed.toUpperCase();
|
|
97
|
+
return VIN.test(vin) ? vin : null;
|
|
98
|
+
}
|
|
99
|
+
function isValidVin(value) {
|
|
100
|
+
return normaliseVin(value) !== null;
|
|
101
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function normaliseAbn(value: unknown): string | null;
|
|
2
|
+
export declare function isValidAbn(value: unknown): boolean;
|
|
3
|
+
export declare function formatAbn(value: unknown): string | null;
|
|
4
|
+
export declare function normaliseAcn(value: unknown): string | null;
|
|
5
|
+
export declare function isValidAcn(value: unknown): boolean;
|
|
6
|
+
export declare function formatAcn(value: unknown): string | null;
|
|
7
|
+
export declare const normaliseArbn: typeof normaliseAcn;
|
|
8
|
+
export declare const isValidArbn: typeof isValidAcn;
|
|
9
|
+
export declare const formatArbn: typeof formatAcn;
|
|
10
|
+
export interface TfnOptions {
|
|
11
|
+
individual?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function normaliseTfn(value: unknown, options?: TfnOptions): string | null;
|
|
14
|
+
export declare function isValidTfn(value: unknown, options?: TfnOptions): boolean;
|
|
15
|
+
export declare function normaliseDirectorId(value: unknown): string | null;
|
|
16
|
+
export declare function isValidDirectorId(value: unknown): boolean;
|
|
17
|
+
export declare function normaliseVin(value: unknown): string | null;
|
|
18
|
+
export declare function isValidVin(value: unknown): boolean;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const ABN_WEIGHTS = [10, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19];
|
|
2
|
+
const ACN_WEIGHTS = [8, 7, 6, 5, 4, 3, 2, 1];
|
|
3
|
+
const TFN_WEIGHTS_9 = [1, 4, 3, 7, 5, 8, 6, 9, 10];
|
|
4
|
+
const TFN_WEIGHTS_8 = [1, 4, 3, 7, 5, 8, 6, 10];
|
|
5
|
+
const VIN = /^[A-HJ-NPR-Z0-9]{17}$/;
|
|
6
|
+
function digits(value, lengths) {
|
|
7
|
+
if (typeof value !== 'string' && !(typeof value === 'number' && Number.isSafeInteger(value) && value >= 0)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const compact = String(value).replace(/[ \t\n\r\v\f-]/g, '');
|
|
11
|
+
return lengths.includes(compact.length) && /^[0-9]+$/.test(compact) ? compact : null;
|
|
12
|
+
}
|
|
13
|
+
function weightedSum(value, weights) {
|
|
14
|
+
let sum = 0;
|
|
15
|
+
for (let i = 0; i < weights.length && i < value.length; i++)
|
|
16
|
+
sum += Number(value[i]) * weights[i];
|
|
17
|
+
return sum;
|
|
18
|
+
}
|
|
19
|
+
export function normaliseAbn(value) {
|
|
20
|
+
const abn = digits(value, [11]);
|
|
21
|
+
if (abn === null)
|
|
22
|
+
return null;
|
|
23
|
+
// Subtract 1 from the first digit, then the weighted sum must be divisible by 89.
|
|
24
|
+
const total = (Number(abn[0]) - 1) * ABN_WEIGHTS[0] + weightedSum(abn.slice(1), ABN_WEIGHTS.slice(1));
|
|
25
|
+
return total % 89 === 0 ? abn : null;
|
|
26
|
+
}
|
|
27
|
+
export function isValidAbn(value) {
|
|
28
|
+
return normaliseAbn(value) !== null;
|
|
29
|
+
}
|
|
30
|
+
export function formatAbn(value) {
|
|
31
|
+
const abn = normaliseAbn(value);
|
|
32
|
+
return abn && `${abn.slice(0, 2)} ${abn.slice(2, 5)} ${abn.slice(5, 8)} ${abn.slice(8)}`;
|
|
33
|
+
}
|
|
34
|
+
export function normaliseAcn(value) {
|
|
35
|
+
const acn = digits(value, [9]);
|
|
36
|
+
if (acn === null)
|
|
37
|
+
return null;
|
|
38
|
+
const check = (10 - (weightedSum(acn, ACN_WEIGHTS) % 10)) % 10;
|
|
39
|
+
return Number(acn[8]) === check ? acn : null;
|
|
40
|
+
}
|
|
41
|
+
export function isValidAcn(value) {
|
|
42
|
+
return normaliseAcn(value) !== null;
|
|
43
|
+
}
|
|
44
|
+
export function formatAcn(value) {
|
|
45
|
+
const acn = normaliseAcn(value);
|
|
46
|
+
return acn && `${acn.slice(0, 3)} ${acn.slice(3, 6)} ${acn.slice(6)}`;
|
|
47
|
+
}
|
|
48
|
+
export const normaliseArbn = normaliseAcn;
|
|
49
|
+
export const isValidArbn = isValidAcn;
|
|
50
|
+
export const formatArbn = formatAcn;
|
|
51
|
+
export function normaliseTfn(value, options = {}) {
|
|
52
|
+
// 8-digit TFNs (organisations only) have their own weights. A 9-digit TFN with a leading
|
|
53
|
+
// zero passes on either the 9-digit check or the 8-digit check of the rest.
|
|
54
|
+
const tfn = digits(value, options.individual ? [9] : [8, 9]);
|
|
55
|
+
if (tfn === null)
|
|
56
|
+
return null;
|
|
57
|
+
if (tfn.length === 9 && tfn.replace(/^0+/, '').length >= 8 && weightedSum(tfn, TFN_WEIGHTS_9) % 11 === 0) {
|
|
58
|
+
return tfn;
|
|
59
|
+
}
|
|
60
|
+
const core = tfn.replace(/^0+/, '');
|
|
61
|
+
const weights = core.length === 9 ? TFN_WEIGHTS_9 : core.length === 8 ? TFN_WEIGHTS_8 : null;
|
|
62
|
+
return weights && weightedSum(core, weights) % 11 === 0 ? tfn : null;
|
|
63
|
+
}
|
|
64
|
+
export function isValidTfn(value, options = {}) {
|
|
65
|
+
return normaliseTfn(value, options) !== null;
|
|
66
|
+
}
|
|
67
|
+
export function normaliseDirectorId(value) {
|
|
68
|
+
// Format only. The check digit method is only given to ATO-registered software providers.
|
|
69
|
+
const did = digits(value, [15]);
|
|
70
|
+
return did && did.startsWith('036') ? did : null;
|
|
71
|
+
}
|
|
72
|
+
export function isValidDirectorId(value) {
|
|
73
|
+
return normaliseDirectorId(value) !== null;
|
|
74
|
+
}
|
|
75
|
+
export function normaliseVin(value) {
|
|
76
|
+
if (typeof value !== 'string')
|
|
77
|
+
return null;
|
|
78
|
+
const trimmed = value.replace(/^[ \t\n\r\v\f]+|[ \t\n\r\v\f]+$/g, '');
|
|
79
|
+
if (!/^[\x00-\x7f]*$/.test(trimmed))
|
|
80
|
+
return null;
|
|
81
|
+
const vin = trimmed.toUpperCase();
|
|
82
|
+
return VIN.test(vin) ? vin : null;
|
|
83
|
+
}
|
|
84
|
+
export function isValidVin(value) {
|
|
85
|
+
return normaliseVin(value) !== null;
|
|
86
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "au-identifiers",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Validate and format Australian identifiers: ABN, ACN, ARBN, TFN, Director ID and VIN.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"abn",
|
|
7
|
+
"acn",
|
|
8
|
+
"arbn",
|
|
9
|
+
"tfn",
|
|
10
|
+
"vin",
|
|
11
|
+
"director-id",
|
|
12
|
+
"australia",
|
|
13
|
+
"validation",
|
|
14
|
+
"validator",
|
|
15
|
+
"checksum",
|
|
16
|
+
"ato",
|
|
17
|
+
"asic"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://businessapi.com.au",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/BusinessAPI/au-identifiers-js.git"
|
|
23
|
+
},
|
|
24
|
+
"bugs": "https://github.com/BusinessAPI/au-identifiers-js/issues",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "Business API <dev@businessapi.com.au>",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/cjs/index.js",
|
|
29
|
+
"module": "./dist/esm/index.js",
|
|
30
|
+
"types": "./dist/esm/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": {
|
|
34
|
+
"types": "./dist/esm/index.d.ts",
|
|
35
|
+
"default": "./dist/esm/index.js"
|
|
36
|
+
},
|
|
37
|
+
"require": {
|
|
38
|
+
"types": "./dist/cjs/index.d.ts",
|
|
39
|
+
"default": "./dist/cjs/index.js"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"README.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"sideEffects": false,
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
54
|
+
"test": "npm run build && node --test test/vectors.test.mjs",
|
|
55
|
+
"prepublishOnly": "npm test"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"typescript": "^5.9.3"
|
|
59
|
+
}
|
|
60
|
+
}
|