From eb19ee77cb566bb79866e139afd0b87e55e19820 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 14 Sep 2023 15:20:52 +0100 Subject: [PATCH] refactor: inline types --- src/runtime/utils/lodash.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/runtime/utils/lodash.ts b/src/runtime/utils/lodash.ts index e6f2f0346e..1a3c2646ab 100644 --- a/src/runtime/utils/lodash.ts +++ b/src/runtime/utils/lodash.ts @@ -1,22 +1,17 @@ -type OmitObject = Pick>; - export function omit, K extends keyof T> ( object: T, keysToOmit: K[] | any[] -): OmitObject { +): Pick> { const result = { ...object } for (const key of keysToOmit) { delete result[key] } - return result as OmitObject + return result } - -type Path = (string | number)[] | string; - -export function get (object: Record, path: Path, defaultValue?: any): any { +export function get (object: Record, path: (string | number)[] | string, defaultValue?: any): any { if (typeof path === 'string') { path = path.split('.').map(key => { const numKey = Number(key)