const types in getOpt

This commit is contained in:
Tangent Wantwight 2023-11-20 22:31:28 -05:00
parent 63f40309c7
commit 44fe2165d2

View file

@ -14,7 +14,7 @@ type ParsedOptions<P extends Options, V extends string | TextPiece> = {
error?: string;
};
export function getOpt<P extends Options>(
export function getOpt<const P extends Options>(
argv: TextPiece[],
options: P,
procBody: (
@ -60,7 +60,7 @@ export function getOpt<P extends Options>(
}
}
export function getOptRaw<P extends Options>(
export function getOptRaw<const P extends Options>(
argv: TextPiece[],
options: P,
procBody: (
@ -95,7 +95,7 @@ export function getOptRaw<P extends Options>(
const SWITCH_REGEX = /^-([^]*)/;
function getOptCore<P extends Options>(
function getOptCore<const P extends Options>(
argv: TextPiece[],
options: P
): [ParsedOptions<P, TextPiece>, TextPiece[]] {