From 1bdb583cec4476b614da58ca0da3e567fe2b8479 Mon Sep 17 00:00:00 2001 From: Damir Date: Tue, 26 Dec 2023 00:09:09 +0600 Subject: [PATCH] refactoring --- src/utils.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 9a3b3d2..0c4bb8d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -27,17 +27,17 @@ export const popValues = (data: Record, keys: string[]): Record return source } -export const removeDuplicates = (array: T[]): T[] => { - const uniqueItems: T[] = []; +// export const removeDuplicates = (array: T[]): T[] => { +// const uniqueItems: T[] = []; - for (const item of array) { - if (!uniqueItems.some((uniqueItem) => isEqual(uniqueItem, item))) { - uniqueItems.push(item); - } - } +// for (const item of array) { +// if (!uniqueItems.some((uniqueItem) => isEqual(uniqueItem, item))) { +// uniqueItems.push(item); +// } +// } - return uniqueItems; -} +// return uniqueItems; +// } export const mergeValues = (value: any, patch: any) => { if (Array.isArray(value) && Array.isArray(patch)) { @@ -83,11 +83,11 @@ export const createRef = (basePath?: string, pointer?: string): string => { } } -export const resolveRefNode = (data: any, node: any) => { - const { $ref, ...rest } = node - const _ref = parseRef($ref) - return !_ref.filePath ? resolvePointer(data, _ref.pointer) : undefined -} +// export const resolveRefNode = (data: any, node: any) => { +// const { $ref, ...rest } = node +// const _ref = parseRef($ref) +// return !_ref.filePath ? resolvePointer(data, _ref.pointer) : undefined +// } export const resolvePointer = (data: unknown, pointer: string, pointers: string[] = [pointer]): any => { if (!isObject(data)) { return }