-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathverify-names.js
46 lines (40 loc) · 1.18 KB
/
verify-names.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const fs = require('fs').promises
const path = require('path')
const { deprecated } = require('./deprecated')
const srcPaths = {
micro: path.resolve(__dirname, '../src/16/solid/'),
mini: path.resolve(__dirname, '../src/20/solid/'),
solid: path.resolve(__dirname, '../src/24/solid/'),
outline: path.resolve(__dirname, '../src/24/outline/'),
}
async function main() {
let files = await Promise.all(
Object.entries(srcPaths).map(async ([name, path]) => {
return { name, files: (await fs.readdir(path)).filter((file) => file.endsWith('.svg')) }
})
)
let diffs = []
for (let current of files) {
for (let other of files) {
if (current === other) continue
for (let file of current.files) {
if (!other.files.includes(file)) {
// Ignore deprecated icons in micro
// They're not going to be added
if (other.name === 'micro' && deprecated.includes(file)) continue
diffs.push({
package: current.name,
file: file,
'Missing in?': other.name,
})
}
}
}
}
if (diffs.length > 0) {
console.table(diffs)
} else {
console.log('All good!')
}
}
main()