This has a global process
and two imports
ts
/// <reference types="node" />// @ts-checkimportfs from "fs"import {execSync } from "child_process"constfileToEdit =process .env .HUSKY_GIT_PARAMS !.split (" ")[0]constfiles =execSync ("git status --porcelain", {encoding : "utf8" })constmaps : any = {"spelltower/": "SPTWR","typeshift/": "TPSFT",}constprefixes = newSet ()files .split ("\n").forEach (f => {constfound =Object .keys (maps ).find (prefix =>f .includes (prefix ))if (found )prefixes .add (maps [found ])})if (prefixes .size ) {constprefix = [...prefixes .values ()].sort ().join (", ")constmsg =fs .readFileSync (fileToEdit , "utf8")if (!msg .includes (prefix )) {fs .writeFileSync (fileToEdit , `[${prefix }] ${msg }`)}}