UNPKG

@embrace-io/react-native

Version:
23 lines (22 loc) 669 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateAxiosInterface = void 0; /** * This method validates if the instance provided has the same structure * as Axios */ const validateAxiosInterface = (instance) => { if (!("interceptors" in instance)) { return false; } const { interceptors } = instance; if (!("request" in interceptors && "response" in interceptors)) { return false; } const { request, response } = interceptors; if (!("use" in request && "use" in response)) { return false; } return true; }; exports.validateAxiosInterface = validateAxiosInterface;