hoistIanitorValidatorIanitor validator created inside function body is slow — hoist to module scope. Example: const validator = Ianitor.keyOf(ids);small-rules/no-ianitor-in-function-bodyDisallow Ianitor validator creation inside function bodies. Hoist to module scope to avoid recreating validators on every call.
hoistIanitorValidatorIanitor validator created inside function body is slow — hoist to module scope. Example: const validator = Ianitor.keyOf(ids);This rule does not accept options.
import { Ianitor } from "@packages/ianitor";
const placementVfxIds = { a: "a", b: "b" } as const;
export function isPlacementVfxId(value: unknown) { return Ianitor.keyOf(placementVfxIds)(value).success;}import { Ianitor } from "@packages/ianitor";
const placementVfxIds = { a: "a", b: "b" } as const;const isPlacementVfxIdIanitor = Ianitor.keyOf(placementVfxIds);
export function isPlacementVfxId(value: unknown) { return isPlacementVfxIdIanitor(value).success;}