react-native-unit-components
Version:
Unit React Native components
12 lines (11 loc) • 453 B
JavaScript
/* eslint-disable @typescript-eslint/no-explicit-any */
const isUNComponentsErrorData = obj => {
return typeof obj === 'object' && 'title' in obj;
};
export const isUNComponentsErrorDataArray = arr => {
return Array.isArray(arr) && arr.every(item => isUNComponentsErrorData(item));
};
export const isUNComponentsError = error => {
return 'errors' in error && isUNComponentsErrorDataArray(error.errors);
};
//# sourceMappingURL=errorHelpers.js.map