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

Function parsePackageJsonContent

scripts/validate-changesets.ts:45–53  ·  view source on GitHub ↗
(packagePath: string)

Source from the content-addressed store, hash-verified

43const getRootDir = pipe(Path.Path, Effect.flatMap(resolveDirFromUrl));
44
45const parsePackageJsonContent = (packagePath: string) => (content: string) => {
46 const pkg = JSON.parse(content);
47 return Option.some<PackageInternal>({
48 name: pkg.name,
49 version: pkg.version,
50 path: packagePath,
51 private: pkg.private,
52 });
53};
54
55const readPackageJson = (fs: FileSystem.FileSystem, packagePath: string) =>
56 pipe(packagePath, fs.readFileString, Effect.map(parsePackageJsonContent(packagePath)));

Callers 1

readPackageJsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected