mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 08:48:32 +01:00
1f10ad0608
* feat: add new games.extra.old_id * add extra.old_id; standard release_year * add option dontCheckOldIDs * update naming, README, CHANGELOG * Update CONTRIBUTING.md * fix games.js * add tool for checking duplicates * update GAMES_LIST * fix anchor links * fix notes in generated game list * Update GAMES_LIST.md * Update GAMES_LIST.md * add Game Object Example in CONTRIBUTING * Update find_id_duplicates.js * check skipOldIDs only once * remove old ids; tweaks GAMES_LIST * add MIGRATION document WIP * Update GAMES_LIST.md * update Halo Online name * revert changes tool/generate * remove extra line * Update GAMES_LIST.md * roll back GAME_LIST * Update GAMES_LIST.md * OMG * WAT * ok... hopefully the last change * Update GAMES_LIST.md * add MIGRATION ids * roll back CONTRIBUTING * Update CHANGELOG.md * update skipOldIDs to checkOldIDs * Update MIGRATION.md * add migration note on README
30 lines
573 B
JavaScript
30 lines
573 B
JavaScript
import { games } from '../lib/games.js'
|
|
|
|
const ids = Object.keys(games)
|
|
|
|
Object.keys(games).forEach((key) => {
|
|
if (games[key].extra && games[key].extra.old_id) {
|
|
const idOld = games[key].extra.old_id
|
|
ids.push(idOld)
|
|
}
|
|
})
|
|
|
|
function hasDuplicates(obj) {
|
|
const uniqueSet = new Set()
|
|
|
|
for (const item of obj) {
|
|
if (uniqueSet.has(item)) {
|
|
console.log('Duplicate:', item)
|
|
return true
|
|
}
|
|
uniqueSet.add(item)
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
if (hasDuplicates(ids)) {
|
|
console.log('Duplicates found.')
|
|
} else {
|
|
console.log('No duplicates found.')
|
|
}
|