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

Function checkAndReadPackage

scripts/validate-changesets.ts:58–65  ·  view source on GitHub ↗
(fs: FileSystem.FileSystem, packagePath: string)

Source from the content-addressed store, hash-verified

56 pipe(packagePath, fs.readFileString, Effect.map(parsePackageJsonContent(packagePath)));
57
58const checkAndReadPackage = (fs: FileSystem.FileSystem, packagePath: string) => (exists: boolean) =>
59 pipe(
60 exists,
61 Match.value,
62 Match.when(true, () => readPackageJson(fs, packagePath)),
63 Match.when(false, () => Effect.succeedNone),
64 Match.exhaustive
65 );
66
67const readPackageIfExists = (
68 fs: FileSystem.FileSystem,

Callers 1

readPackageIfExistsFunction · 0.70

Calls 1

readPackageJsonFunction · 0.70

Tested by

no test coverage detected