1 | # README #
|
2 |
|
3 | ## address-utils ##
|
4 |
|
5 | This is a library with utility functions for address objects as specified in the sri api.
|
6 |
|
7 | #### usage ####
|
8 | ```javascript
|
9 | const addressUtils = require('@kathondvla/sri-client/address-utils');
|
10 | ```
|
11 |
|
12 | #### interface ####
|
13 |
|
14 | * **printAddress(address):** returns the address as a string in the format {street} {houseNumber} {mailboxNumber}, {zipCode} {subCity}
|
15 | * **isSameHouseNumberAndMailbox(a, b):** returns true if sri address a and sri address b have the same mailboxNumber and houseNumber. The match is case insensitive and ingores white spaces and underscores.
|
16 | * **isSameStreet(a, b):** returns true if sri address a and sri address b are the same streets. This means a match on the street name in the same city. If both addresses have a streetHref a match is done based on this reference because it is a reference to the same street, independent of how it is spelled. Otherwise A match on street name is case insensitive and takes into account that parts of the name are abbreviated with a dot. For example 'F. Lintsstraat' matches with 'Frederik lintsstraat'.
|
17 | * **isStreetNameMatch(a, b):** returns true if a en b which are both strings are the same street independent of how they are spelled. It takes into account that parts are abbreviated with a dot. For example 'F. Lintsstraat' matches with 'Frederik lintsstraat'.
|
18 | * **addSubCityHref(sriAddress, api) [async]:** adds a subCityHref reference to the sriAddress. api is an instance of an sri-client library (ng-sri-client, node-sri-client, fetch-sri-client, etc.)
|
19 | * **addStreetHref(sriAddress, api, dateUtils, changeStreetName) [async]:** adds a streetHref reference to the sriAddress. api is an instance of an sri-client library (ng-sri-client, node-sri-client, fetch-sri-client, etc.). You can add dateUtils to look at a differnt point in time. You can also set option changeStreetName [default = false] to also change sriAddress.street to the the way it is written in /sam/commons/streets.
|
20 |
|
21 | ### Questions ###
|
22 |
|
23 | Mail to matthias.snellings@katholiekonderwijs.vlaanderen. |
\ | No newline at end of file |