@k03mad/ip2geo 10.1.1 → 10.4.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/.vscode/settings.json
CHANGED
package/app/helpers/cache.js
CHANGED
|
@@ -47,7 +47,7 @@ export const collectOutputData = dataArr => {
|
|
|
47
47
|
* @returns {string}
|
|
48
48
|
*/
|
|
49
49
|
const getCacheFileFullPath = (ip, cacheDir, cacheFileName) => {
|
|
50
|
-
const [firstOctet] = ip.split(
|
|
50
|
+
const [firstOctet] = ip.split(/[.:]/);
|
|
51
51
|
return path.join(cacheDir, `${firstOctet}_${cacheFileName}`);
|
|
52
52
|
};
|
|
53
53
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k03mad/ip2geo",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "GeoIP library",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
"Kirill Molchanov <k03.mad@gmail.com"
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"node": ">=20"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@k03mad/request": "6.
|
|
23
|
-
"@k03mad/simple-log": "4.
|
|
22
|
+
"@k03mad/request": "6.3.0",
|
|
23
|
+
"@k03mad/simple-log": "4.2.0",
|
|
24
24
|
"chalk": "5.3.0",
|
|
25
|
-
"debug": "4.3.
|
|
25
|
+
"debug": "4.3.7",
|
|
26
26
|
"is-ip": "5.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@k03mad/eslint-config": "
|
|
29
|
+
"@k03mad/eslint-config": "25.6.0",
|
|
30
30
|
"eslint": "8.57.0",
|
|
31
|
-
"husky": "9.1.
|
|
31
|
+
"husky": "9.1.6",
|
|
32
32
|
"mocha": "10.7.3",
|
|
33
33
|
"npm-run-all": "4.1.5"
|
|
34
34
|
},
|
package/tests/shared/consts.js
CHANGED
package/tests/shared/fs.js
CHANGED
|
@@ -37,7 +37,7 @@ export const checkCacheFile = async ({
|
|
|
37
37
|
cacheFileNewline = DEFAULT_CACHE_FILE_NEWLINE,
|
|
38
38
|
response,
|
|
39
39
|
}) => {
|
|
40
|
-
const cacheFile = `${response.ip.split(
|
|
40
|
+
const cacheFile = `${response.ip.split(/[.:]/)[0]}_${cacheFileName}`;
|
|
41
41
|
const data = await fs.readFile(path.join(cacheDir, cacheFile), {encoding: 'utf8'});
|
|
42
42
|
|
|
43
43
|
assert.equal(data, cacheFileNewline + Object.values(response).join(cacheFileSeparator));
|