elections-types 1.0.13 → 1.0.14
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.
|
@@ -14,7 +14,7 @@ export function is_election_id(election_id) {
|
|
|
14
14
|
Number.isInteger(year) && year > 1700 && year < 3000 &&
|
|
15
15
|
is_office_id(office_id) &&
|
|
16
16
|
is_state_id(state_id) &&
|
|
17
|
-
((office_id === "S" || state_ids_without_district.includes(state_id)) &&
|
|
17
|
+
((office_id === "S" || state_ids_without_district.includes(state_id)) && parts[3] === undefined ||
|
|
18
18
|
!(office_id === "S" || state_ids_without_district.includes(state_id)) && Number.isInteger(district) && district < 100));
|
|
19
19
|
}
|
|
20
20
|
export class Election {
|
package/package.json
CHANGED
package/src/types/Election.ts
CHANGED
|
@@ -23,7 +23,7 @@ export function is_election_id(election_id : any) : election_id is ElectionID {
|
|
|
23
23
|
Number.isInteger(year) && year > 1700 && year < 3000 &&
|
|
24
24
|
is_office_id(office_id) &&
|
|
25
25
|
is_state_id(state_id) &&
|
|
26
|
-
((office_id === "S" || state_ids_without_district.includes(state_id)) &&
|
|
26
|
+
((office_id === "S" || state_ids_without_district.includes(state_id)) && parts[3] === undefined ||
|
|
27
27
|
!(office_id === "S" || state_ids_without_district.includes(state_id)) && Number.isInteger(district) && district < 100)
|
|
28
28
|
)
|
|
29
29
|
}
|