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

ip2region

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip2region - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

14

dist/lib/ipv6.js

@@ -8,4 +8,2 @@ "use strict";

const debug = utils_1.createDebug("ipv6");
const FF = 0xffffffffffffffffn;
const N64 = 64n;
class Ipv6ToRegion {

@@ -130,3 +128,3 @@ constructor(dbPath) {

let first = ret.cArea.indexOf("国");
if (first >= 0) {
if (first === 1) {
first += 1;

@@ -157,6 +155,6 @@ country = ret.cArea.slice(0, first);

if (isCity != true) {
for (let province of provinceArr) {
second = ret.cArea.indexOf(province);
for (let p of provinceArr) {
second = ret.cArea.indexOf(p);
if (second >= 0) {
second = second + province.length;
second = second + p.length;
province = ret.cArea.slice(first, second);

@@ -171,3 +169,3 @@ break;

const city2 = ret.cArea.indexOf("州");
// fmt.Println("second", second, city1, city2, string(value))
// console.log("second",ret,second, city1, city2)
if (city1 >= 0 && city2 >= 0 && city1 < city2 && second < city1) {

@@ -208,3 +206,3 @@ city = ret.cArea.slice(second, city1 + 1);

}
const ip = (ip6 >> N64) & FF;
const ip = (ip6 >> 64n) & 0xffffffffffffffffn;
debug("ip", ip);

@@ -211,0 +209,0 @@ // IPv4映射地址

{
"name": "ip2region",
"version": "2.1.0",
"version": "2.1.1",
"description": "ip/ipv6 to geo database, IP(支持IPv6)地址到区域运营商",

@@ -39,3 +39,3 @@ "keywords": [

"dev": "export NODE_ENV=dev && jest --verbose --watch",
"test": "npm run compile && jest --coverage",
"test": "jest --coverage",
"tag": "git tag v`node -p 'require(\"./package\").version'`",

@@ -45,3 +45,3 @@ "format": "prettier --write \"src/**/*.ts\"",

"compile": "npm run clean && tsc",
"prepublishOnly": "npm run format && npm run test && coveralls < coverage/lcov.info && npm test",
"prepublishOnly": "npm run format && npm run compile && npm test && coveralls < coverage/lcov.info",
"postpublish": "npm run tag && git push && git push --tags"

@@ -48,0 +48,0 @@ },

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