Skip to content

Commit

Permalink
add string intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Aug 19, 2024
1 parent 73045af commit 1fbc838
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/protocol-parser/src/getFieldIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ValueSchema } from "./common";

export function getFieldIndex<valueSchema extends ValueSchema>(
valueSchema: valueSchema,
fieldName: keyof valueSchema,
fieldName: keyof valueSchema & string,
): number {
const fieldNames = [
...Object.entries(valueSchema)
Expand All @@ -14,5 +14,5 @@ export function getFieldIndex<valueSchema extends ValueSchema>(
.map(([fieldName]) => fieldName),
];

return fieldNames.indexOf(fieldName.toString());
return fieldNames.indexOf(fieldName);
}

0 comments on commit 1fbc838

Please sign in to comment.