@k03mad/ip2geo 9.2.0 → 9.3.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/app/helpers/cache.js +1 -8
- package/package.json +1 -1
package/app/helpers/cache.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
import {log} from '@k03mad/simple-log';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
4
|
import _debug from 'debug';
|
|
7
5
|
|
|
8
|
-
const {dim, bold} = chalk;
|
|
9
|
-
|
|
10
6
|
const debug = _debug('mad:geoip');
|
|
11
7
|
|
|
12
8
|
const outputKeys = [
|
|
@@ -174,7 +170,7 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
|
|
|
174
170
|
|
|
175
171
|
let duplicates = 0;
|
|
176
172
|
let empty = 0;
|
|
177
|
-
|
|
173
|
+
|
|
178
174
|
const longLinesFiles = new Set();
|
|
179
175
|
|
|
180
176
|
await Promise.all(files.map(async file => {
|
|
@@ -201,9 +197,6 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
|
|
|
201
197
|
|
|
202
198
|
empty += dataArr.length - dataArrRemoveEmpty.length;
|
|
203
199
|
duplicates += dataArrRemoveEmpty.length - uniq.length;
|
|
204
|
-
|
|
205
|
-
counter++;
|
|
206
|
-
log(`${bold(dim(`[${counter}/${files.length}]`))} ${dim(fullFilePath)}`);
|
|
207
200
|
}));
|
|
208
201
|
|
|
209
202
|
return {duplicates, empty, longLinesFiles};
|