(packFile: PackedFile, dbName: string)
| 667 | } |
| 668 | }; |
| 669 | export const getDBVersionByTableName = (packFile: PackedFile, dbName: string) => { |
| 670 | if (packFile.name.endsWith(".loc")) return LocVersion; |
| 671 | const dbversions = DBNameToDBVersions[appData.currentGame][dbName]; |
| 672 | // console.log("GETTING DB VERSIONS, dbversions IS", dbversions); |
| 673 | if (!dbversions) return; |
| 674 | // console.log("getting db version for", dbName, "version in file is:", packFile.version); |
| 675 | const dbversion = |
| 676 | dbversions.find((dbversion) => dbversion.version == packFile.version) || |
| 677 | dbversions.find((dbversion) => dbversion.version == 0) || |
| 678 | dbversions[0]; |
| 679 | // console.log("GETTING DB VERSION from dbversions, dbversion IS", dbversion); |
| 680 | if (!dbversion) { |
| 681 | console.log("FAILED getting db version for", dbName, "version in file is:", packFile.version); |
| 682 | return; |
| 683 | } |
| 684 | // console.log("GETTING DB VERSION packFile version IS", packFile.version); |
| 685 | if (packFile.version == null) return dbversion; |
| 686 | if (dbversion.version < packFile.version) return; |
| 687 | return dbversion; |
| 688 | }; |
| 689 | export const getDBVersion = (packFile: PackedFile) => { |
| 690 | if (packFile.name.endsWith(".loc")) return LocVersion; |
| 691 | // console.log("GETTING DB VERSION FOR", packFile.name); |
no outgoing calls
no test coverage detected