docs: types (#2186)

This commit is contained in:
Romain Hamel
2024-09-12 11:10:23 +02:00
committed by GitHub
parent 26e5ac80b6
commit 523493105e
19 changed files with 54 additions and 47 deletions

View File

@@ -19,7 +19,7 @@ export function omit<Data extends object, Keys extends keyof Data>(data: Data, k
return result as Omit<Data, Keys>
}
export function get(object: Record<string, any>, path: (string | number)[] | string, defaultValue?: any): any {
export function get(object: Record<string, any> | undefined, path: (string | number)[] | string, defaultValue?: any): any {
if (typeof path === 'string') {
path = path.split('.').map((key) => {
const numKey = Number(key)