Skip to content

Commit 3621fff

Browse files
committed
Version 2.0 Typescript
1 parent 3aed7fd commit 3621fff

File tree

15 files changed

+173
-29
lines changed

15 files changed

+173
-29
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,3 @@ cache
2323

2424
# Debug folder
2525
debug/
26-
27-
# Dist after compiling ts
28-
dist

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"javascript",
77
],
88
"editor.codeActionsOnSave": {
9-
"source.fixAll.eslint": true,
9+
"source.fixAll.eslint": "explicit"
1010
},
1111
"jest.jestCommandLine": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
1212
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A [Singapore NRIC](https://en.wikipedia.org/wiki/National_Registration_Identity_Card) Validator & Generator class, by [Samuel Liew](https://github.com/samliew)<br>
66
This library supports the validation and generation of M-series NRIC numbers.
77

8-
Looking to do it manually instead? Use these tools on my website: [generate](https://samliew.com/nric-generator) or [validate](https://samliew.com/singapore-nric-validator).
8+
You can also use these pages on my website to [generate](https://samliew.com/nric-generator) or [validate](https://samliew.com/singapore-nric-validator) manually.
99

1010
<br>
1111

dist/nric.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
declare class NRIC {
2+
#private;
3+
constructor(value?: NRIC | string | null | undefined);
4+
valueOf(): string;
5+
toString(): string;
6+
get value(): string;
7+
get length(): number;
8+
get firstchar(): string | null;
9+
get identifier(): string | null;
10+
get checksum(): string | null;
11+
get isCorrectFormat(): boolean;
12+
get isValid(): boolean;
13+
static Generate(firstchar?: string | null): NRIC;
14+
static GenerateMany(amount?: number | null): NRIC[];
15+
static Validate(value: string | NRIC | (string | NRIC)[]): boolean;
16+
}
17+
export default NRIC;
18+
//# sourceMappingURL=nric.d.ts.map

dist/nric.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/nric.js

Lines changed: 109 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/nric.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/types.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export type Firstchar = 'F' | 'G' | 'M' | 'S' | 'T';
2+
export type Checksum = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'P' | 'Q' | 'R' | 'T' | 'U' | 'W' | 'X' | 'Z';
3+
//# sourceMappingURL=types.d.ts.map

dist/types.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/types.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)