Мне передали проект, и я пытаюсь запустить приложение в Экспо, но я получаю необработанную ошибку обещания.
* utils / index. js: 107: 28 in * utils / index. js: 99: 38 in * utils / index. js: 91: 52 in * utils / index. js: 90: 38 в getImageInstances * utils / index. js: 165: 45 in * utils / index. js: 163: 34 in deleteStaleImages
Внутренний индекс. js ниже:
const getImageInstances = (imagePath, originalImageState) => {
const occurrencesList = [];
Object.keys(originalImageState).map((reducerKey) => {
Object.keys(originalImageState[reducerKey]).map((imageKey) => {
const currentImage = originalImageState[reducerKey][imageKey];
if (typeof currentImage === 'string' || typeof currentImage === 'number') {
if (imagePath === currentImage) {
occurrencesList.push(`${reducerKey}.${imageKey}`);
}
} else {
// If it's not a string, then it's an object
Object.keys(currentImage).map((nestedImageKey) => {
const nestedImage = currentImage[nestedImageKey];
if (typeof nestedImage === 'string') {
if (imagePath === currentImage) {
occurrencesList.push(`${reducerKey}.${imageKey}.${nestedImageKey}`);
}
} else {
// If it's not a string, then it's an array
nestedImage.map((imageValue, idx) => {
if (imagePath === imageValue) {
occurrencesList.push(`${reducerKey}.${imageKey}.${nestedImageKey}.${idx}`);
}
});
}
});
}
});
});
};