UNPKG

tus-js-client-olalonde

Version:

A pure JavaScript client for the tus resumable upload protocol

36 lines (26 loc) 1.02 kB
"use strict"; var _upload = require("./upload"); var _upload2 = _interopRequireDefault(_upload); var _storage = require("./node/storage"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* global window */ var defaultOptions = _upload2.default.defaultOptions; if (typeof window !== "undefined") { // Browser environment using XMLHttpRequest var _window = window; var XMLHttpRequest = _window.XMLHttpRequest; var Blob = _window.Blob; var isSupported = XMLHttpRequest && Blob && typeof Blob.prototype.slice === "function"; } else { // Node.js environment using http module var isSupported = true; } // The usage of the commonjs exporting syntax instead of the new ECMAScript // one is actually inteded and prevents weird behaviour if we are trying to // import this module in another module using Babel. module.exports = { Upload: _upload2.default, isSupported: isSupported, canStoreURLs: _storage.canStoreURLs, defaultOptions: defaultOptions };