UNPKG

@softwareventures/maintain-project

Version:

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

15 lines 690 B
import { mapNullable } from "@softwareventures/nullable"; import { modifyPackageJson } from "./modify-package-json.js"; export async function modifyProjectScript(project, name, modify) { return modifyPackageJson(project, json => ({ ...json, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment scripts: { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access ...json?.scripts, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access [name]: modify(mapNullable(json?.scripts?.[name], String)) ?? undefined } })); } //# sourceMappingURL=modify-script.js.map