pelias-openstreetmap 9.0.0 → 9.1.0
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.
package/package.json
CHANGED
|
@@ -121,8 +121,13 @@ const addrProps = [ 'name', 'number', 'street', 'zip' ];
|
|
|
121
121
|
// call document setters and ignore non-fatal errors
|
|
122
122
|
function setProperties( record, doc ){
|
|
123
123
|
addrProps.forEach( function ( prop ){
|
|
124
|
+
const value = doc.getAddress( prop );
|
|
125
|
+
|
|
126
|
+
// skip properties the setter rejects, it throws for absent or blank values
|
|
127
|
+
if( 'string' !== typeof value || !value.trim().length ){ return; }
|
|
128
|
+
|
|
124
129
|
try {
|
|
125
|
-
record.setAddress( prop,
|
|
130
|
+
record.setAddress( prop, value );
|
|
126
131
|
} catch ( ex ) {}
|
|
127
132
|
});
|
|
128
133
|
}
|