Skip to content

Commit 7ce33e4

Browse files
author
Kendall Kelly
authored
normalized fields and added missing fields (#36)
* refactor: normalized fields and added missing fields * style: fixed linting errors * refactor: clened up types * refactor: removed platform check
1 parent 8ac4aec commit 7ce33e4

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ const onScanID = () => {
9393
licenseNumber: string;
9494
expirationDate: string;
9595
endorsementsCode: string;
96+
endorsementsCodeDescription: string;
9697
issuedBy: string;
9798
firstName: string;
9899
middleName: string;
99100
lastName: string;
100101
nameSuffix: string;
101102
restrictionsCode: string;
103+
restrictionsCodeDescription: string;
102104
birthDate: string;
103105
countryCode: string;
104106
jurisdictionCode: string;
@@ -111,6 +113,9 @@ const onScanID = () => {
111113
restrictionCode: string;
112114
postalCode: string;
113115
specification: string;
116+
hazmateExpDate: string;
117+
cardRevisionDate: string;
118+
complianceType: string;
114119
}
115120
```
116121

@@ -134,6 +139,23 @@ const onScanID = () => {
134139
}
135140
```
136141

142+
### Platform Specific Attributes
143+
144+
## Android
145+
146+
- `restrictionsCodeDescription`
147+
- `endorsementsCodeDescription`
148+
- `restrictionsCode`
149+
- `specification`
150+
151+
## iOS
152+
153+
- `weight`
154+
- `issuerIdNum`
155+
- `restrictionsNum`
156+
- `cardRevisionDate`
157+
- `complianceType`
158+
137159
## Contributing
138160

139161
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

src/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export function scan(
5050
onScanComplete: ScanResult
5151
) {
5252
IdscanSdk.scan(type, apiKeys, (error: object, data: DLData) => {
53+
data.birthDate = data.birthDate || data.birthdate;
54+
data.IIN = data.IIN || data.iin;
55+
data.hazmateExpDate = data.HAZMATEExpDate;
5356
onScanComplete(error, data);
5457
});
5558
}

src/types.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Drivers License Data Format
33
*/
44
export type DLData = {
5+
[key: string]: string;
56
namePrefix: string;
67
IIN: string;
78
race: string;
@@ -18,12 +19,14 @@ export type DLData = {
1819
licenseNumber: string;
1920
expirationDate: string;
2021
endorsementsCode: string;
22+
endorsementsCodeDescription: string;
2123
issuedBy: string;
2224
firstName: string;
2325
middleName: string;
2426
lastName: string;
2527
nameSuffix: string;
2628
restrictionsCode: string;
29+
restrictionsCodeDescription: string;
2730
birthDate: string;
2831
countryCode: string;
2932
jurisdictionCode: string;
@@ -36,6 +39,9 @@ export type DLData = {
3639
restrictionCode: string;
3740
postalCode: string;
3841
specification: string;
42+
hazmateExpDate: string;
43+
cardRevisiondate: string;
44+
complianceType: string;
3945
};
4046

4147
/**

0 commit comments

Comments
 (0)