FieldPathByValue
Type which eagerly collects all paths through a fieldType that matches a give type
@example
FieldPathByValue<{foo: {bar: number}, baz: number, bar: string}, number>
= 'foo.bar' | 'baz'
type FieldPathByValue<TFieldValues extends FieldValues, TValue> = [Key in FieldPath<TFieldValues>]: FieldPathValue<TFieldValues, Key> extends TValue ? Key : never[FieldPath<TFieldValues>];