MCPcopy Index your code
hub / github.com/MALSync/MALSync / getVersionHashes

Function getVersionHashes

src/pages-chibi/builder/chibiHelper.ts:6–24  ·  view source on GitHub ↗
(pages: { [key: string]: PageInterface })

Source from the content-addressed store, hash-verified

4import type { PageInterface, PageInterfaceCompiled, PageListJsonInterface } from '../pageInterface';
5
6export 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
26function objectToString(obj: any): string {
27 const result = {};

Callers 2

chibiListFunction · 0.85
chibiPagesFunction · 0.85

Calls 3

objectToStringFunction · 0.85
createShortHashFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected