Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@furkot/address

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@furkot/address - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

7

lib/address/normalize.js

@@ -1,2 +0,2 @@

const { abbr2country, country2abbr } = require('../country');
const { country2abbr } = require('../country');
const { abbr2state, state2abbr, state2country } = require('../state');

@@ -17,3 +17,3 @@

if (!address) {
return ;
return address;
}

@@ -35,5 +35,2 @@

}
else if (!abbr2country[country]) {
return;
}
}

@@ -40,0 +37,0 @@ state = getState(state);

@@ -9,4 +9,3 @@ module.exports = stringify;

state2abbr,
state2country,
country2states
state2country
} = require('../state');

@@ -26,5 +25,14 @@

*
* stringify({ house: 1, street: 'street', province: 'province'});
* // => '1 street,,province,'
*
* stringify({ house: 1, town: 'town', country: 'country' });
* // => ',town,,country'
* // => '1,town,,country'
*
* stringify({ street: 'street', town: 'town' });
* // => 'street,town,,'
*
* * stringify({});
* // => ''
*
* stringify();

@@ -40,30 +48,18 @@ * // => undefined

country = country2abbr[country] || country;
province = state2abbr[province] || province;
if (!country) {
if (!province) { // if state or country is missing
return;
}
province = state2abbr[province] || province;
country = state2country[province];
if (!country) {
return;
}
}
else {
province = state2abbr[province] || province;
country = country2abbr[country] || country;
}
const st = country2states[country];
if (st && !st[province]) {
province = '';
if (house) {
if (street) {
street = [house, street].join(' ');
}
else {
street = house;
}
}
if (house && street) {
street = [house, street].join(' ');
}
else if (house) {
street = `${house}`;
}
return [street, town, province, country].map(p => p ?? '').join(',').replace(/^,+/, '');
}
{
"name": "@furkot/address",
"version": "0.0.4",
"version": "0.0.5",
"description": "Furkot address normalizer.",

@@ -5,0 +5,0 @@ "author": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc