(packagePath: string)
| 43 | const getRootDir = pipe(Path.Path, Effect.flatMap(resolveDirFromUrl)); |
| 44 | |
| 45 | const 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 | |
| 55 | const readPackageJson = (fs: FileSystem.FileSystem, packagePath: string) => |
| 56 | pipe(packagePath, fs.readFileString, Effect.map(parsePackageJsonContent(packagePath))); |