All files / src/crud-to-cas CrudCas.ts

100% Statements 8/8
100% Branches 0/0
100% Functions 2/2
100% Lines 7/7

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 191x 1x             6x   1x   30x 30x   30x      
import { hashToLocation } from './util';
import { CrudCasBase } from './CrudCasBase';
import type { CrudApi } from '../crud/types';
 
export interface CrudCasOptions {
  hash: (blob: Uint8Array) => Promise<string>;
}
 
const hashEqual = (h1: string, h2: string) => h1 === h2;
 
export class CrudCas extends CrudCasBase<string> {
  constructor(
    protected readonly crud: CrudApi,
    protected readonly options: CrudCasOptions,
  ) {
    super(crud, options.hash, hashToLocation, hashEqual);
  }
}