repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/__fixtures__/dummy.d.ts | src/__typetest__/__fixtures__/dummy.d.ts | /** tsd needs a declarations file to work */
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/__fixtures__/tuple.ts | src/__typetest__/__fixtures__/tuple.ts | type ConcatTupleTenTimes<T extends unknown[]> = [
...T,
...T,
...T,
...T,
...T,
...T,
...T,
...T,
...T,
...T,
];
export type HundredTuple<T> = ConcatTupleTenTimes<ConcatTupleTenTimes<[T]>>;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/__fixtures__/index.ts | src/__typetest__/__fixtures__/index.ts | export * from './pathString';
export * from './traversable';
export * from './tuple';
export * from './type';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/__fixtures__/pathString.ts | src/__typetest__/__fixtures__/pathString.ts | type ConcatTenTimes<T extends string> =
`${T}.${T}.${T}.${T}.${T}.${T}.${T}.${T}.${T}.${T}`;
export type HundredPathString<T extends string> = ConcatTenTimes<
ConcatTenTimes<T>
>;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/path/eager.test-d.ts | src/__typetest__/path/eager.test-d.ts | import { expectType } from 'tsd';
import type { ArrayPath, FieldPathValues, Path, PathValue } from '../../types';
import type { Depth3Type } from '../__fixtures__';
import { _ } from '../__fixtures__';
/** {@link Path} */ {
/** it should evaluate to never for an empty object */ {
const actual = _ as Path<object... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/path/common.test-d.ts | src/__typetest__/path/common.test-d.ts | import { expectType } from 'tsd';
import type {
ArrayKey,
AsKey,
AsPathTuple,
CheckKeyConstraint,
ContainsIndexable,
EvaluateKey,
EvaluatePath,
HasKey,
HasPath,
IsTuple,
JoinPathTuple,
Key,
Keys,
NumericKeys,
ObjectKeys,
PathString,
SplitPathString,
ToKey,
TupleKeys,
UnionToInte... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isBoolean.ts | src/utils/isBoolean.ts | export default (value: unknown): value is boolean => typeof value === 'boolean';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/convertToArrayPayload.ts | src/utils/convertToArrayPayload.ts | export default <T>(value: T) => (Array.isArray(value) ? value : [value]);
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isKey.ts | src/utils/isKey.ts | export default (value: string) => /^\w*$/.test(value);
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/deepEqual.ts | src/utils/deepEqual.ts | import isDateObject from './isDateObject';
import isObject from './isObject';
import isPrimitive from './isPrimitive';
export default function deepEqual(
object1: any,
object2: any,
_internal_visited = new WeakSet(),
) {
if (isPrimitive(object1) || isPrimitive(object2)) {
return Object.is(object1, object2)... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isFunction.ts | src/utils/isFunction.ts | export default (value: unknown): value is Function =>
typeof value === 'function';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isObject.ts | src/utils/isObject.ts | import isDateObject from './isDateObject';
import isNullOrUndefined from './isNullOrUndefined';
export const isObjectType = (value: unknown): value is object =>
typeof value === 'object';
export default <T extends object>(value: unknown): value is T =>
!isNullOrUndefined(value) &&
!Array.isArray(value) &&
isO... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/createSubject.ts | src/utils/createSubject.ts | import type { Noop } from '../types';
export type Observer<T> = {
next: (value: T) => void;
};
export type Subscription = {
unsubscribe: Noop;
};
export type Subject<T> = {
readonly observers: Observer<T>[];
subscribe: (value: Observer<T>) => Subscription;
unsubscribe: Noop;
} & Observer<T>;
export defaul... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/swap.ts | src/utils/swap.ts | export default <T>(data: T[], indexA: number, indexB: number): void => {
[data[indexA], data[indexB]] = [data[indexB], data[indexA]];
};
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/unset.ts | src/utils/unset.ts | import isEmptyObject from './isEmptyObject';
import isKey from './isKey';
import isObject from './isObject';
import isUndefined from './isUndefined';
import stringToPath from './stringToPath';
function baseGet(object: any, updatePath: (string | number)[]) {
const length = updatePath.slice(0, -1).length;
let index ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/stringToPath.ts | src/utils/stringToPath.ts | import compact from './compact';
export default (input: string): string[] =>
compact(input.replace(/["|']|\]/g, '').split(/\.|\[/));
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/set.ts | src/utils/set.ts | import type { FieldPath, FieldValues } from '../types';
import isKey from './isKey';
import isObject from './isObject';
import stringToPath from './stringToPath';
export default (
object: FieldValues,
path: FieldPath<FieldValues>,
value?: unknown,
) => {
let index = -1;
const tempPath = isKey(path) ? [path]... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/prepend.ts | src/utils/prepend.ts | import convertToArrayPayload from './convertToArrayPayload';
export default <T>(data: T[], value: T | T[]): T[] => [
...convertToArrayPayload(value),
...convertToArrayPayload(data),
];
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/insert.ts | src/utils/insert.ts | import convertToArrayPayload from './convertToArrayPayload';
export default function insert<T>(data: T[], index: number): (T | undefined)[];
export default function insert<T>(
data: T[],
index: number,
value: T | T[],
): T[];
export default function insert<T>(
data: T[],
index: number,
value?: T | T[],
): ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isPrimitive.ts | src/utils/isPrimitive.ts | import type { Primitive } from '../types';
import isNullOrUndefined from './isNullOrUndefined';
import { isObjectType } from './isObject';
export default (value: unknown): value is Primitive =>
isNullOrUndefined(value) || !isObjectType(value);
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/append.ts | src/utils/append.ts | import convertToArrayPayload from './convertToArrayPayload';
export default <T>(data: T[], value: T | T[]): T[] => [
...data,
...convertToArrayPayload(value),
];
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isCheckBoxInput.ts | src/utils/isCheckBoxInput.ts | import type { FieldElement } from '../types';
export default (element: FieldElement): element is HTMLInputElement =>
element.type === 'checkbox';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/compact.ts | src/utils/compact.ts | export default <TValue>(value: TValue[]) =>
Array.isArray(value) ? value.filter(Boolean) : [];
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isUndefined.ts | src/utils/isUndefined.ts | export default (val: unknown): val is undefined => val === undefined;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/objectHasFunction.ts | src/utils/objectHasFunction.ts | import isFunction from './isFunction';
export default <T>(data: T): boolean => {
for (const key in data) {
if (isFunction(data[key])) {
return true;
}
}
return false;
};
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/sleep.ts | src/utils/sleep.ts | export default (ms: number) =>
new Promise((resolve) => setTimeout(resolve, ms));
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isDateObject.ts | src/utils/isDateObject.ts | export default (value: unknown): value is Date => value instanceof Date;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/move.ts | src/utils/move.ts | import isUndefined from './isUndefined';
export default <T>(
data: (T | undefined)[],
from: number,
to: number,
): (T | undefined)[] => {
if (!Array.isArray(data)) {
return [];
}
if (isUndefined(data[to])) {
data[to] = undefined;
}
data.splice(to, 0, data.splice(from, 1)[0]);
return data;
}... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isWeb.ts | src/utils/isWeb.ts | export default typeof window !== 'undefined' &&
typeof window.HTMLElement !== 'undefined' &&
typeof document !== 'undefined';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isEmptyObject.ts | src/utils/isEmptyObject.ts | import type { EmptyObject } from '../types';
import isObject from './isObject';
export default (value: unknown): value is EmptyObject =>
isObject(value) && !Object.keys(value).length;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/cloneObject.ts | src/utils/cloneObject.ts | import isObject from './isObject';
import isPlainObject from './isPlainObject';
import isWeb from './isWeb';
export default function cloneObject<T>(data: T): T {
if (data instanceof Date) {
return new Date(data) as any;
}
const isFileListInstance =
typeof FileList !== 'undefined' && data instanceof File... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/update.ts | src/utils/update.ts | export default <T>(fieldValues: T[], index: number, value: T) => {
fieldValues[index] = value;
return fieldValues;
};
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/remove.ts | src/utils/remove.ts | import compact from './compact';
import convertToArrayPayload from './convertToArrayPayload';
import isUndefined from './isUndefined';
function removeAtIndexes<T>(data: T[], indexes: number[]): T[] {
let i = 0;
const temp = [...data];
for (const index of indexes) {
temp.splice(index - i, 1);
i++;
}
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/flatten.ts | src/utils/flatten.ts | import type { FieldValues } from '../types';
import { isObjectType } from './isObject';
export const flatten = (obj: FieldValues) => {
const output: FieldValues = {};
for (const key of Object.keys(obj)) {
if (isObjectType(obj[key]) && obj[key] !== null) {
const nested = flatten(obj[key]);
for (c... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isMultipleSelect.ts | src/utils/isMultipleSelect.ts | import type { FieldElement } from '../types';
export default (element: FieldElement): element is HTMLSelectElement =>
element.type === `select-multiple`;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/get.ts | src/utils/get.ts | import isKey from './isKey';
import isNullOrUndefined from './isNullOrUndefined';
import isObject from './isObject';
import isUndefined from './isUndefined';
import stringToPath from './stringToPath';
export default <T>(
object: T,
path?: string | null,
defaultValue?: unknown,
): any => {
if (!path || !isObjec... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isRadioOrCheckbox.ts | src/utils/isRadioOrCheckbox.ts | import type { FieldElement } from '../types';
import isCheckBoxInput from './isCheckBoxInput';
import isRadioInput from './isRadioInput';
export default (ref: FieldElement): ref is HTMLInputElement =>
isRadioInput(ref) || isCheckBoxInput(ref);
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isRadioInput.ts | src/utils/isRadioInput.ts | import type { FieldElement } from '../types';
export default (element: FieldElement): element is HTMLInputElement =>
element.type === 'radio';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isPlainObject.ts | src/utils/isPlainObject.ts | import isObject from './isObject';
export default (tempObject: object) => {
const prototypeCopy =
tempObject.constructor && tempObject.constructor.prototype;
return (
isObject(prototypeCopy) && prototypeCopy.hasOwnProperty('isPrototypeOf')
);
};
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isRegex.ts | src/utils/isRegex.ts | export default (value: unknown): value is RegExp => value instanceof RegExp;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/deepMerge.ts | src/utils/deepMerge.ts | import isObject from './isObject';
import isPrimitive from './isPrimitive';
export default function deepMerge<
T extends Record<keyof T, any>,
U extends Record<keyof U, any>,
>(target: T, source: U): T & U {
if (isPrimitive(target) || isPrimitive(source)) {
return source;
}
for (const key in source) {
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/index.ts | src/utils/index.ts | import get from './get';
import set from './set';
export { get, set };
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isFileInput.ts | src/utils/isFileInput.ts | import type { FieldElement } from '../types';
export default (element: FieldElement): element is HTMLInputElement =>
element.type === 'file';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isString.ts | src/utils/isString.ts | export default (value: unknown): value is string => typeof value === 'string';
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/noop.ts | src/utils/noop.ts | export default function noop() {}
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isHTMLElement.ts | src/utils/isHTMLElement.ts | import isWeb from './isWeb';
export default (value: unknown): value is HTMLElement => {
if (!isWeb) {
return false;
}
const owner = value ? ((value as HTMLElement).ownerDocument as Document) : 0;
return (
value instanceof
(owner && owner.defaultView ? owner.defaultView.HTMLElement : HTMLElement)
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/isNullOrUndefined.ts | src/utils/isNullOrUndefined.ts | export default (value: unknown): value is null | undefined => value == null;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/extractFormValues.ts | src/utils/extractFormValues.ts | import isObject from './isObject';
export default function extractFormValues<
T extends object,
K extends Record<string, unknown>,
>(fieldsState: T, formValues: K) {
const values: Record<string, unknown> = {};
for (const key in fieldsState) {
if (fieldsState.hasOwnProperty(key)) {
const fieldState =... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/live.ts | src/utils/live.ts | import type { Ref } from '../types';
import isHTMLElement from './isHTMLElement';
export default (ref: Ref) => isHTMLElement(ref) && ref.isConnected;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/utils/fillEmptyArray.ts | src/utils/fillEmptyArray.ts | export default <T>(value: T | T[]): undefined[] | undefined =>
Array.isArray(value) ? value.map(() => undefined) : undefined;
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/formStateSubscribe.test.tsx | src/__tests__/formStateSubscribe.test.tsx | // __tests__/formState.component.test.tsx
import React from 'react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { Controller } from '../controller';
import { FormStateSubscribe } from '../formStateSubscribe';
import type { Control } from '../types';
import { useFieldArray } fro... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useController.test.tsx | src/__tests__/useController.test.tsx | import React, { useEffect, useMemo, useState } from 'react';
import {
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { Controller } from '../controller';
import type { Control, FieldPath, FieldValues, UseFormReturn } from '../types';
import { useController } from '../... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/formStateSubscribe.server.test.tsx | src/__tests__/formStateSubscribe.server.test.tsx | import React from 'react';
import { renderToString } from 'react-dom/server';
import { FormStateSubscribe } from '../formStateSubscribe';
import { useForm } from '../useForm';
describe('FormStateSubscribe with SSR', () => {
it('should render correctly', () => {
const Component = () => {
const { control } ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/watch.test.tsx | src/__tests__/watch.test.tsx | import React from 'react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import type { Control, UseFormReturn } from '../types';
import { useForm } from '../useForm';
import noop from '../utils/noop';
import { Watch } from '../watch';
type FormType = {
foo: string;
bar: string;
ba... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useFormContext.server.test.tsx | src/__tests__/useFormContext.server.test.tsx | import React from 'react';
import { renderToString } from 'react-dom/server';
import { useController } from '../useController';
import { useForm } from '../useForm';
import { FormProvider, useFormContext } from '../useFormContext';
import { useFormState } from '../useFormState';
import { useWatch } from '../useWatch';... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/controller.test.tsx | src/__tests__/controller.test.tsx | import React from 'react';
import {
act as actComponent,
fireEvent,
render,
screen,
waitFor,
waitForElementToBeRemoved,
} from '@testing-library/react';
import { Controller } from '../controller';
import type {
ControllerRenderProps,
FieldValues,
ValidateResult,
} from '../types';
import { useFieldAr... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/type.test.tsx | src/__tests__/type.test.tsx | import React from 'react';
import { render } from '@testing-library/react';
import { expectType } from 'tsd';
import { Controller } from '../controller';
import type {
FieldErrors,
FieldPath,
FieldValues,
Path,
PathValue,
UseFormRegister,
} from '../types';
import { useController } from '../useController';... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useWatch.test.tsx | src/__tests__/useWatch.test.tsx | import React from 'react';
import {
fireEvent,
render,
renderHook,
screen,
waitFor,
within,
} from '@testing-library/react';
import { Controller } from '../controller';
import type {
Control,
UseFieldArrayReturn,
UseFormRegister,
UseFormReturn,
} from '../types';
import { useController } from '../u... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/controller.server.test.tsx | src/__tests__/controller.server.test.tsx | import React from 'react';
import { renderToString } from 'react-dom/server';
import { Controller } from '../controller';
import { useForm } from '../useForm';
describe('Controller with SSR', () => {
// issue: https://github.com/react-hook-form/react-hook-form/issues/1398
it('should render correctly with as with ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useFormState.test.tsx | src/__tests__/useFormState.test.tsx | import React from 'react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { Controller } from '../controller';
import type { Control } from '../types';
import { useFieldArray } from '../useFieldArray';
import { useForm } from '../useForm';
import { FormProvider } from '../useFormCo... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/form.test.tsx | src/__tests__/form.test.tsx | import 'whatwg-fetch';
import React from 'react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { Form } from '../form';
import { useForm } from '../useForm';
import { FormProvider } from '../useFormContext';
describe('Form', () => {
beforeEach(() => {
jest.restoreAllMocks... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm.server.test.tsx | src/__tests__/useForm.server.test.tsx | import React from 'react';
import { renderToString } from 'react-dom/server';
import { useForm } from '../useForm';
describe('useForm with SSR', () => {
it('should not output error', () => {
const Component = () => {
const { register } = useForm<{
test: string;
}>();
return (
<... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/watch.server.test.tsx | src/__tests__/watch.server.test.tsx | import React from 'react';
import { renderToString } from 'react-dom/server';
import { useForm } from '../useForm';
import { Watch } from '../watch';
describe('Watch with SSR', () => {
it('should be rendered correctly', () => {
const Component = () => {
const { control } = useForm({ defaultValues: { foo: ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useFieldArray.test.tsx | src/__tests__/useFieldArray.test.tsx | import React, { useState } from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { Controller } from '../controller';
import type {
Control,
FieldValues,
SubmitHandler,
UseFieldArrayProps,
UseFormRegister,
UseFormReturn,
} from '../t... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/isPlainObject.test.ts | src/__tests__/isPlainObject.test.ts | import isPlainObject from '../utils/isPlainObject';
import noop from '../utils/noop';
describe('isPlainObject', function () {
it('should identify plan object or not', function () {
function test() {
return {
test: noop,
};
}
expect(isPlainObject(Object.create({}))).toBeTruthy();
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm.test.tsx | src/__tests__/useForm.test.tsx | import React, { useState } from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
waitForElementToBeRemoved,
} from '@testing-library/react';
import { VALIDATION_MODE } from '../constants';
import type {
Control,
FieldErrors,
FieldValues,
FormState,
Mode,
RegisterOptions,... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useFormContext.test.tsx | src/__tests__/useFormContext.test.tsx | import React, { useState } from 'react';
import { flushSync } from 'react-dom';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { Controller } from '../controller';
import { useController } from '../useController';
import { useFieldArray } from '../useFieldArray';
import { useForm }... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/clearErrors.test.tsx | src/__tests__/useForm/clearErrors.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { useForm } from '../../useForm';
describe('clearErrors', () => {
it('should remove error', () => {
const { result } = renderHook(() => useForm<{ input: string }>());
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/watch.test.tsx | src/__tests__/useForm/watch.test.tsx | import React, { useEffect } from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
} from '@testing-library/react';
import { Controller } from '../../controller';
import type { Control, FieldValues } from '../../types';
import { useFieldArray } from '../../useFieldArray';
import { useForm } from ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/unregister.test.tsx | src/__tests__/useForm/unregister.test.tsx | import { act, renderHook } from '@testing-library/react';
import { useForm } from '../../useForm';
describe('unregister', () => {
it('should unregister an registered item', async () => {
const { result } = renderHook(() => useForm<{ input: string }>());
result.current.register('input');
await act(asyn... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/reset.test.tsx | src/__tests__/useForm/reset.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { Controller } from '../../controller';
import type {
Control,
FieldErrors,
UseFormRegister,
UseFormReturn,
} from '../../types';
import { useController } from '../../use... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/resetField.test.tsx | src/__tests__/useForm/resetField.test.tsx | import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { useForm } from '../../useForm';
describe('resetField', () => {
it('should reset input value', () => {
const App = () => {
const { register, resetField } = useForm({
defaultValues: {
te... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/useFormWithNullValues.test.tsx | src/__tests__/useForm/useFormWithNullValues.test.tsx | import React from 'react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { useController } from '../../useController';
import { useForm } from '../../useForm';
describe('useForm with null values (issue #12815)', () => {
function NumberInput({
control,
name = 'views',
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/trigger.test.tsx | src/__tests__/useForm/trigger.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { VALIDATION_MODE } from '../../constants';
import type {
Control,
FieldPath,
FieldValues,
FormState,
UseFormGetFieldState,
} from '../../types';
import { useController... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/setValue.test.tsx | src/__tests__/useForm/setValue.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { VALIDATION_MODE } from '../../constants';
import { Controller } from '../../controller';
import type { Control } from '../../types';
import { useFieldArray } from '../../useFie... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/handleSubmit.test.tsx | src/__tests__/useForm/handleSubmit.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { VALIDATION_MODE } from '../../constants';
import { useFieldArray } from '../../useFieldArray';
import { useForm } from '../../useForm';
import isFunction from '../../utils/isFu... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/getFieldState.test.tsx | src/__tests__/useForm/getFieldState.test.tsx | import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import type { Control } from '../../types';
import { useController } from '../../useController';
import { useForm } from '../../useForm';
type FormValues = {
nested: {
first: string;
last: string;
};
};
const N... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/resolver.test.tsx | src/__tests__/useForm/resolver.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
screen,
waitFor,
} from '@testing-library/react';
import type { FieldErrors } from '../../types/errors';
import { useController } from '../../useController';
import { useFieldArray } from '../../useFieldArray';
import { useForm } from '../../useForm... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/formState.test.tsx | src/__tests__/useForm/formState.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { VALIDATION_MODE } from '../../constants';
import { Controller } from '../../controller';
import type { Control, FormState, UseFormGetFieldState } from '../../types';
import { u... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/getValues.test.tsx | src/__tests__/useForm/getValues.test.tsx | import React from 'react';
import {
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import { Controller } from '../../controller';
import { useForm } from '../../useForm';
import { FormProvider, useFormContext } from '../../useFormContext';
import { useFormState } from '../..... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/setError.test.tsx | src/__tests__/useForm/setError.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
} from '@testing-library/react';
import type {
DeepMap,
ErrorOption,
FieldError,
GlobalError,
} from '../../types';
import { useForm } from '../../useForm';
import { FormProvider, useFormContext } from '../../u... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/setFocus.test.tsx | src/__tests__/useForm/setFocus.test.tsx | import React from 'react';
import { act, render, screen, waitFor } from '@testing-library/react';
import { useForm } from '../../useForm';
describe('setFocus', () => {
it('should focus input when called after setError', async () => {
const App = () => {
const { register, setError, setFocus } = useForm({
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/register.test.tsx | src/__tests__/useForm/register.test.tsx | import React from 'react';
import {
act,
fireEvent,
render,
renderHook,
screen,
waitFor,
waitForElementToBeRemoved,
} from '@testing-library/react';
import { VALIDATION_MODE } from '../../constants';
import { Controller } from '../../controller';
import type { UseFormRegister } from '../../types';
import... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | true |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/useForm/subscribe.test.tsx | src/__tests__/useForm/subscribe.test.tsx | import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import type { UseFormSubscribe } from '../../types';
import { useForm } from '../../useForm';
import { useFormState } from '../../useFormState';
describe('subscribe', () => {
it('should properly handle multiple subscripti... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/append.test.ts | src/__tests__/utils/append.test.ts | import append from '../../utils/append';
describe('append', () => {
it('should append a single value to an array', () => {
const data = [1, 2, 3];
const result = append(data, 4);
expect(result).toEqual([1, 2, 3, 4]);
expect(data).toEqual([1, 2, 3]);
});
it('should append multiple values from an... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isString.test.ts | src/__tests__/utils/isString.test.ts | import isString from '../../utils/isString';
describe('isString', () => {
it('should return true when value is a string', () => {
expect(isString('')).toBeTruthy();
expect(isString('foobar')).toBeTruthy();
});
it('should return false when value is not a string', () => {
expect(isString(null)).toBeFa... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isFunction.test.ts | src/__tests__/utils/isFunction.test.ts | import isFunction from '../../utils/isFunction';
describe('isFunction', () => {
it('should return true when value is a function', () => {
expect(isFunction(() => null)).toBeTruthy();
expect(
isFunction(function foo() {
return null;
}),
).toBeTruthy();
});
it('should return false ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/get.test.ts | src/__tests__/utils/get.test.ts | import get from '../../utils/get';
describe('get', () => {
it('should get the right data', () => {
const test = {
bill: [1, 2, 3],
luo: [1, 3, { betty: 'test' }],
betty: { test: { test1: [{ test2: 'bill' }] } },
'betty.test.test1[0].test1': 'test',
'dotted.filled': 'content',
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/compact.test.ts | src/__tests__/utils/compact.test.ts | import filterOutFalsy from '../../utils/compact';
describe('filterOutFalsy', () => {
it('should return filtered array when array value is falsy ', () => {
expect(filterOutFalsy([1, 2, 3, 4])).toEqual([1, 2, 3, 4]);
expect(filterOutFalsy([1, 2, false, 4])).toEqual([1, 2, 4]);
expect(filterOutFalsy([1, 2, ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/deepEqual.test.ts | src/__tests__/utils/deepEqual.test.ts | import deepEqual from '../../utils/deepEqual';
describe('deepEqual', () => {
it('should return false when two sets not match', () => {
expect(
deepEqual([{ test: '123' }, { test: '455' }, { test: '455' }], []),
).toBeFalsy();
expect(
deepEqual(
[{ test: '123' }, { test: '455' }, { te... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isHTMLElement.test.ts | src/__tests__/utils/isHTMLElement.test.ts | import isHTMLElement from '../../utils/isHTMLElement';
describe('isHTMLElement', () => {
it('should return true when value is HTMLElement', () => {
expect(isHTMLElement(document.createElement('input'))).toBeTruthy();
});
it('should return true when HTMLElement is inside an iframe', () => {
const iframe ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isBoolean.test.ts | src/__tests__/utils/isBoolean.test.ts | import isBoolean from '../../utils/isBoolean';
describe('isBoolean', () => {
it('should return true when value is a boolean', () => {
expect(isBoolean(true)).toBeTruthy();
expect(isBoolean(false)).toBeTruthy();
});
it('should return false when value is not a boolean', () => {
expect(isBoolean(null))... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/extractFormValues.test.ts | src/__tests__/utils/extractFormValues.test.ts | import extractFormValues from '../../utils/extractFormValues';
describe('extractFormValues', () => {
it('should return extracted form values based on form state', () => {
const formData = {
test: {
test: 'test',
test1: 'test1',
test2: 'test2',
test3: 'test3',
test4: ... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/objectHasFunction.test.ts | src/__tests__/utils/objectHasFunction.test.ts | import noop from '../../utils/noop';
import objectHasFunction from '../../utils/objectHasFunction';
describe('objectHasFunction', () => {
it('should detect if any object has function', () => {
expect(objectHasFunction({})).toBeFalsy();
expect(
objectHasFunction({
test: '',
}),
).toBeF... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isMultipleSelect.test.ts | src/__tests__/utils/isMultipleSelect.test.ts | import isMultipleSelect from '../../utils/isMultipleSelect';
describe('isMultipleSelect', () => {
it('should return true when type is select-multiple', () => {
expect(
isMultipleSelect({ name: 'test', type: 'select-multiple' }),
).toBeTruthy();
});
});
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/move.test.ts | src/__tests__/utils/move.test.ts | import move from '../../utils/move';
describe('move', () => {
it('should be able to move element of array', () => {
const data = [
{
firstName: '1',
lastName: 'Luo',
id: '75309979-e340-49eb-8016-5f67bfb56c1c',
},
{
firstName: '2',
lastName: 'Luo',
... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isObject.test.ts | src/__tests__/utils/isObject.test.ts | import isObject from '../../utils/isObject';
describe('isObject', () => {
it('should return true when value is an object', () => {
expect(isObject({})).toBeTruthy();
expect(isObject({ foo: 'bar' })).toBeTruthy();
expect(isObject(new Blob())).toBeTruthy();
});
it('should return false when value is no... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isRegex.test.ts | src/__tests__/utils/isRegex.test.ts | import isRegex from '../../utils/isRegex';
describe('isRegex', () => {
it('should return true when it is a regex', () => {
expect(isRegex(new RegExp('[a-z]'))).toBeTruthy();
});
});
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isCheckBoxInput.test.ts | src/__tests__/utils/isCheckBoxInput.test.ts | import isCheckBoxInput from '../../utils/isCheckBoxInput';
describe('isCheckBoxInput', () => {
it('should return true when type is checkbox', () => {
expect(isCheckBoxInput({ name: 'test', type: 'checkbox' })).toBeTruthy();
});
});
| typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
react-hook-form/react-hook-form | https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__tests__/utils/isEmptyObject.test.ts | src/__tests__/utils/isEmptyObject.test.ts | import isEmptyObject from '../../utils/isEmptyObject';
describe('isEmptyObject', () => {
it('should return true when value is an empty object', () => {
expect(isEmptyObject({})).toBeTruthy();
});
it('should return false when value is not an empty object', () => {
expect(isEmptyObject(null)).toBeFalsy();... | typescript | MIT | a084dcb8597d5fb872ef54c0e8425133d490a711 | 2026-01-04T15:43:31.044549Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.