UNPKG

react-native-unit-components

Version:

Unit React Native components

20 lines (18 loc) 716 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isUNComponentsErrorDataArray = exports.isUNComponentsError = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const isUNComponentsErrorData = obj => { return typeof obj === 'object' && 'title' in obj; }; const isUNComponentsErrorDataArray = arr => { return Array.isArray(arr) && arr.every(item => isUNComponentsErrorData(item)); }; exports.isUNComponentsErrorDataArray = isUNComponentsErrorDataArray; const isUNComponentsError = error => { return 'errors' in error && isUNComponentsErrorDataArray(error.errors); }; exports.isUNComponentsError = isUNComponentsError; //# sourceMappingURL=errorHelpers.js.map