Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ export interface CivicAddress {
* Example: Joe's Barbershop
*/
NAM?: string,
/**
* Unit (apartment, suite) \
* https://datatracker.ietf.org/doc/html/rfc5139#page-4 \
* Example: 12a
*/
UNIT?: string,
/**
* Postal code \
* Example: 10027-0401
Expand Down
2 changes: 2 additions & 0 deletions src/pidf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export class Civic extends Location {
FLR: Civic.getValueIfAvailable(node, 'FLR'),
NAM: Civic.getValueIfAvailable(node, 'NAM'),
PC: Civic.getValueIfAvailable(node, 'PC'),
UNIT: Civic.getValueIfAvailable(node, 'UNIT'),
};

return new Civic(addr, method);
Expand Down Expand Up @@ -97,6 +98,7 @@ export class Civic extends Location {
Civic.addElementIfNotUndefined(doc, root, prefix, 'FLR', adr.FLR);
Civic.addElementIfNotUndefined(doc, root, prefix, 'NAM', adr.NAM);
Civic.addElementIfNotUndefined(doc, root, prefix, 'PC', adr.PC);
Civic.addElementIfNotUndefined(doc, root, prefix, 'UNIT', adr.UNIT);

return root;
}
Expand Down