UNPKG

@flatfile/safe-api

Version:

Flatfile Safe API client with streaming capabilities

11 lines (10 loc) 325 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findOrFail = findOrFail; function findOrFail(arr, cb) { const item = arr === null || arr === void 0 ? void 0 : arr.find(cb); if (!item) { throw new Error("Trying to find item in array and failed."); } return item; }