MCPcopy Create free account
hub / github.com/CodeForBreakfast/eventsourcing / readPackageMetadataIfExists

Function readPackageMetadataIfExists

scripts/validate-publish.ts:52–59  ·  view source on GitHub ↗
(packageJsonPath: string, dir: string)

Source from the content-addressed store, hash-verified

50 pipe(packageJsonPath, readFileAsString, Effect.map(buildPackageMetadata(dir)));
51
52const readPackageMetadataIfExists = (packageJsonPath: string, dir: string) => (exists: boolean) =>
53 pipe(
54 exists,
55 Match.value,
56 Match.when(true, () => readAndBuildMetadata(packageJsonPath, dir)),
57 Match.when(false, () => Effect.succeed([])),
58 Match.exhaustive
59 );
60
61const checkExistsAndRead = (dir: string) => (packageJsonPath: string) =>
62 pipe(

Callers 1

checkExistsAndReadFunction · 0.85

Calls 1

readAndBuildMetadataFunction · 0.85

Tested by

no test coverage detected