import { NetworkOfflineError } from "../errors" ; export default function assertOnline ( error ) { if ( navigator . onLine === false || ( error . name === "TypeError" && error . message === "Failed to fetch" ) ) { throw new NetworkOfflineError ( error ) ; } }