@k03mad/ip2geo 11.4.0 → 11.5.1
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/app/helpers/cache.js +7 -9
- package/package.json +4 -4
package/app/helpers/cache.js
CHANGED
|
@@ -172,15 +172,13 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
|
|
|
172
172
|
fs.readFile(fullFilePath, {encoding: 'utf8'}),
|
|
173
173
|
]);
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
throw new Error(`Folder has subfolders or files without IPs, wrong cache folder arg?\n${fullFilePath}`);
|
|
183
|
-
}
|
|
175
|
+
const firstIp = data
|
|
176
|
+
?.split(cacheFileNewline)
|
|
177
|
+
?.find(Boolean)
|
|
178
|
+
?.split(cacheFileSeparator)[0];
|
|
179
|
+
|
|
180
|
+
if (stat.isDirectory() || (firstIp && !isIP(firstIp))) {
|
|
181
|
+
throw new Error(`Folder has subfolders or files without IPs, wrong cache folder arg?\n${fullFilePath}`);
|
|
184
182
|
}
|
|
185
183
|
}));
|
|
186
184
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k03mad/ip2geo",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.1",
|
|
4
4
|
"description": "GeoIP library",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
"Kirill Molchanov <k03.mad@gmail.com"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"node": ">=22"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@k03mad/request": "7.6.
|
|
23
|
-
"@k03mad/simple-log": "5.
|
|
24
|
-
"chalk": "5.4.
|
|
22
|
+
"@k03mad/request": "7.6.2",
|
|
23
|
+
"@k03mad/simple-log": "5.2.0",
|
|
24
|
+
"chalk": "5.4.1",
|
|
25
25
|
"debug": "4.4.0",
|
|
26
26
|
"is-ip": "5.0.1"
|
|
27
27
|
},
|