Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 3x 3x 3x 491x 3x 491x 491x 491x 491x 491x 491x 491x 491x | import {structHash as structHash_} from '../structHash';
import {structHashCrdt} from '../structHashCrdt';
import {Model} from '../../json-crdt';
// biome-ignore lint: \x00 character
const isASCII = (str: string) => /^[\x00-\x7F]*$/.test(str);
export const assertStructHash = (json: unknown): string => {
const model = Model.create();
model.api.set(json);
const hash1 = structHashCrdt(model.root);
const hash2 = structHash_(json);
// console.log(hash1);
// console.log(hash2);
expect(hash1).toBe(hash2);
expect(hash2.includes('\n')).toBe(false);
expect(isASCII(hash2)).toBe(true);
return hash2;
};
|