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 }