changes
This commit is contained in:
@@ -4,8 +4,13 @@ export default defineNuxtPlugin(() => {
|
||||
|
||||
//==========Find & filter=================
|
||||
const find = function (arr, obj, attr) {
|
||||
if (typeof arr === "object" && !Array.isArray(arr)) {
|
||||
arr = Object.values(arr);
|
||||
if (!Array.isArray(arr)) {
|
||||
if (typeof arr === "object") {
|
||||
arr = Object.values(arr);
|
||||
} else {
|
||||
console.error(`arr "${arr}" is not an array`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const keys = Object.keys(obj);
|
||||
let found = arr.find((v) => {
|
||||
|
||||
Reference in New Issue
Block a user