@typed/content-hash
Version:
Content hash a directory of HTML/JS/CSS files and other static assets
12 lines (8 loc) • 386 B
text/typescript
import { Eq } from 'fp-ts/Eq'
import { swap } from 'fp-ts/Tuple2'
import { DiGraph } from './DiGraph'
import { toDependencyMap } from './toDependencyMap'
export type DependentMap<A> = ReadonlyMap<A, ReadonlyArray<A>>
export function toDependentMap<A>(graph: DiGraph<A>, eq: Eq<A> = graph): DependentMap<A> {
return toDependencyMap({ ...graph, edges: graph.edges.map(swap) }, eq)
}