0
0
Fork 0

refs #6280 perf: remove deepFind unused code

This commit is contained in:
Javier Segarra 2024-01-23 11:33:34 +01:00
parent 6809e9bddb
commit 5d888a2977
2 changed files with 1 additions and 16 deletions

View File

@ -1,5 +1,4 @@
<script setup>
import { deepFind } from 'src/composables/deepFind';
import { ref, toRefs, computed, watch } from 'vue';
const emit = defineEmits(['update:modelValue', 'update:options']);
@ -69,7 +68,7 @@ const filter = (val, options) => {
return options.filter((row) => {
if ($props.filterOptions.length) {
return $props.filterOptions.some((prop) => {
const propValue = String(deepFind(row,prop)).toLowerCase();
const propValue = String(row[prop]).toLowerCase();
return propValue.includes(search);
});
}

View File

@ -1,14 +0,0 @@
export async function deepFind(obj, path) {
const keys = path.split('.');
let current = obj;
for (const key of keys) {
if (current[key] !== undefined) {
current = current[key];
} else {
return undefined;
}
}
return current;
}