Skip to content

Commit facf6eb

Browse files
authored
fix: when birth_date is present, include age_over_NN only for org.iso.18013.5.1 namespace (#35)
1 parent 0160c1d commit facf6eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mdoc/model/Document.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ export class Document {
8989

9090
for (const [key, value] of Object.entries(values)) {
9191
addAttribute(key, value);
92-
if (key === 'birth_date') {
92+
93+
if (key === 'birth_date' && namespace === DEFAULT_NS) {
9394
const ageInYears = getAgeInYears(value);
9495
addAttribute('age_over_21', ageInYears >= 21);
9596
addAttribute(`age_over_${Math.floor(ageInYears)}`, true);

0 commit comments

Comments
 (0)