Skip to content

Commit 79b018d

Browse files
committed
Move GenericDeepRecord to tests directory
1 parent 90d9000 commit 79b018d

6 files changed

Lines changed: 17 additions & 8 deletions

File tree

lib/types.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,6 @@ type InitOptions = {
494494
// eslint-disable-next-line @typescript-eslint/no-explicit-any
495495
type GenericFunction = (...args: any[]) => any;
496496

497-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
498-
type GenericDeepRecord = DeepRecord<string, any>;
499-
500497
/**
501498
* Represents a record where the key is a collection member key and the value is a list of
502499
* tuples that we'll use to replace the nested objects of that collection member record with something else.
@@ -554,5 +551,4 @@ export type {
554551
WithOnyxConnectOptions,
555552
MultiMergeReplaceNullPatches,
556553
MixedOperationsQueue,
557-
GenericDeepRecord,
558554
};

tests/types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type {DeepRecord} from '../lib/types';
2+
3+
// The types declared inside this file should be used only for testing.
4+
5+
/**
6+
* Utility type to represent a object that can accept any value and contain any deep objects.
7+
*/
8+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9+
type GenericDeepRecord = DeepRecord<string, any>;
10+
11+
// eslint-disable-next-line import/prefer-default-export
12+
export type {GenericDeepRecord};

tests/unit/fastMergeTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type {GenericDeepRecord} from '../../lib/types';
21
import utils from '../../lib/utils';
2+
import type {GenericDeepRecord} from '../types';
33

44
type DeepObject = GenericDeepRecord | unknown[];
55

tests/unit/onyxTest.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import waitForPromisesToResolve from '../utils/waitForPromisesToResolve';
55
import OnyxUtils from '../../lib/OnyxUtils';
66
import type OnyxCache from '../../lib/OnyxCache';
77
import StorageMock from '../../lib/storage';
8-
import type {GenericDeepRecord, OnyxCollection, OnyxUpdate} from '../../lib/types';
8+
import type {OnyxCollection, OnyxUpdate} from '../../lib/types';
9+
import type {GenericDeepRecord} from '../types';
910
import type GenericCollection from '../utils/GenericCollection';
1011
import type {Connection} from '../../lib/OnyxConnectionManager';
1112

tests/unit/onyxUtilsTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Onyx from '../../lib';
22
import OnyxUtils from '../../lib/OnyxUtils';
3-
import type {GenericDeepRecord} from '../../lib/types';
3+
import type {GenericDeepRecord} from '../types';
44
import utils from '../../lib/utils';
55

66
const testObject: GenericDeepRecord = {

tests/utils/collections/reportActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {randAggregation, randBoolean, randWord} from '@ngneat/falso';
22
import {format} from 'date-fns';
33
import {createCollection} from './createCollection';
4-
import type {GenericDeepRecord} from '../../../lib/types';
4+
import type {GenericDeepRecord} from '../../types';
55

66
const getRandomDate = (): string => {
77
const randomTimestamp = Math.random() * new Date().getTime();

0 commit comments

Comments
 (0)