diff --git a/src/generators/custom.ts b/src/generators/custom.ts new file mode 100644 index 0000000..3c3768d --- /dev/null +++ b/src/generators/custom.ts @@ -0,0 +1,14 @@ +import type { HeaderEntries } from "./index.js"; + +export type CustomHeaders = { contributors: string; } & { [name: string]: string; }; + +/** + * @summary generates custom headers not built-in to any of the managers + * @param custom list of custom headers + */ +export const generateCustomHeaders = (custom: string[]): HeaderEntries => { + return custom.map((pair) => { + const [name, value = ""] = pair.split(/\s+/); + return [name, value]; + }); +}; \ No newline at end of file