(pages: { [key: string]: PageInterface })
| 4 | import type { PageInterface, PageInterfaceCompiled, PageListJsonInterface } from '../pageInterface'; |
| 5 | |
| 6 | export function getVersionHashes(pages: { [key: string]: PageInterface }) { |
| 7 | const hashes: { |
| 8 | [key: string]: { |
| 9 | hash: string; |
| 10 | timestamp: string; |
| 11 | }; |
| 12 | } = {}; |
| 13 | Object.keys(pages) |
| 14 | .sort() |
| 15 | .forEach(key => { |
| 16 | const pageObj = pages[key]; |
| 17 | const pageString = objectToString(pageObj); |
| 18 | hashes[key] = { |
| 19 | hash: createShortHash(pageString), |
| 20 | timestamp: new Date().getTime().toString(), |
| 21 | }; |
| 22 | }); |
| 23 | return hashes; |
| 24 | } |
| 25 | |
| 26 | function objectToString(obj: any): string { |
| 27 | const result = {}; |
no test coverage detected