UNPKG

@softwareventures/maintain-project

Version:

Automatically create and maintain TypeScript projects with standard settings for Software Ventures Limited

16 lines 793 B
import { chain } from "@softwareventures/chain"; import { mapResultFn } from "../result/result.js"; import { insert as insertIntoDirectory, insertSubdirectory as insertSubdirectoryIntoDirectory } from "./file-node.js"; export function insert(stage, path, node) { return chain(insertIntoDirectory(stage.root, path, node)).map(mapResultFn(root => ({ ...stage, root }))).value; } export function insertFn(path, node) { return fsStage => insert(fsStage, path, node); } export function insertSubdirectory(fsStage, path) { return chain(insertSubdirectoryIntoDirectory(fsStage.root, path)).map(mapResultFn(root => ({ ...fsStage, root }))).value; } export function insertSubdirectoryFn(path) { return fsStage => insertSubdirectory(fsStage, path); } //# sourceMappingURL=fs-stage.js.map