-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
darnjo
committed
Oct 1, 2023
1 parent
64d88f8
commit 573c8e0
Showing
5 changed files
with
221 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,3 +109,4 @@ output | |
data-availability-report.json | ||
metadata-report.json | ||
metadata-report*.json | ||
reso-replication-output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
|
||
const wellKnownIdentifiers = [ | ||
'country', | ||
'stateorprovince', | ||
'county', | ||
'subcounty', | ||
'propertytype', | ||
'subpropertytype', | ||
'parcelnumber', | ||
'subparcelnumber' | ||
]; | ||
|
||
/* | ||
nss example: | ||
':country:us:stateorprovince:ca:county:06037:subcounty::propertytype:residential:subpropertytype::parcelnumber: [abc] 1-2 :: 3:456 :subparcelnumber:'; | ||
*/ | ||
const upiParser = ({ version = '2.0', nss = '' }) => { | ||
const regex = new RegExp(wellKnownIdentifiers.map(item => `:${item}:`).join('|')); | ||
const [, country, stateOrProvince, county, subCounty, propertyType, subPropertyType, parcelNumber, subParcelNumber] = nss.split(regex); | ||
return { country, stateOrProvince, county, subCounty, propertyType, subPropertyType, parcelNumber, subParcelNumber }; | ||
}; | ||
|
||
module.exports = { | ||
upiParser | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.