From 6e331ccf3839c0d4219fea84e3a2e09e07791fbd Mon Sep 17 00:00:00 2001 From: Theodor Truffer Date: Wed, 10 Feb 2021 16:26:00 +0100 Subject: [PATCH] WIP: chunked upload and event logging --- classes/class.ilOneDriveActionListGUI.php | 18 +- classes/class.ilOneDriveDeleteGUI.php | 42 + classes/class.ilOneDriveSettingsGUI.php | 28 + classes/class.ilOneDriveUploadGUI.php | 11 +- node_modules/.package-lock.json | 38 + node_modules/@mux/upchunk/README.md | 182 ---- node_modules/@mux/upchunk/README_INTERNAL.md | 10 - node_modules/@mux/upchunk/dist/upchunk.d.ts | 74 -- node_modules/@mux/upchunk/dist/upchunk.js | 2 - node_modules/@mux/upchunk/dist/upchunk.js.map | 1 - node_modules/@mux/upchunk/package.json | 90 -- node_modules/@mux/upchunk/src/upchunk.spec.js | 112 --- node_modules/@mux/upchunk/src/upchunk.spec.ts | 260 ------ node_modules/@mux/upchunk/src/upchunk.ts | 350 ------- node_modules/dom-walk/LICENCE | 19 - node_modules/dom-walk/Makefile | 2 - node_modules/dom-walk/README.md | 23 - node_modules/dom-walk/example/index.js | 5 - node_modules/dom-walk/index.js | 24 - node_modules/dom-walk/package.json | 63 -- node_modules/event-target-shim/LICENSE | 22 - node_modules/event-target-shim/README.md | 267 ------ .../dist/event-target-shim.js | 871 ------------------ .../dist/event-target-shim.js.map | 1 - .../dist/event-target-shim.mjs | 862 ----------------- .../dist/event-target-shim.mjs.map | 1 - .../dist/event-target-shim.umd.js | 6 - .../dist/event-target-shim.umd.js.map | 1 - node_modules/event-target-shim/index.d.ts | 200 ---- node_modules/event-target-shim/package.json | 109 --- node_modules/global/.travis.yml | 4 - node_modules/global/LICENSE | 19 - node_modules/global/README.md | 30 - node_modules/global/console.js | 1 - node_modules/global/document.js | 17 - node_modules/global/package.json | 94 -- node_modules/global/process.js | 1 - node_modules/global/window.js | 13 - node_modules/is-function/LICENSE | 19 - node_modules/is-function/README.md | 23 - node_modules/is-function/index.js | 18 - node_modules/is-function/package.json | 74 -- node_modules/is-function/test.js | 37 - node_modules/min-document/.jshintrc | 30 - node_modules/min-document/.npmignore | 15 - node_modules/min-document/.testem.json | 14 - node_modules/min-document/.travis.yml | 6 - node_modules/min-document/CONTRIBUTION.md | 48 - node_modules/min-document/LICENCE | 19 - node_modules/min-document/README.md | 43 - node_modules/min-document/docs.mli | 156 ---- node_modules/min-document/document.js | 72 -- node_modules/min-document/dom-comment.js | 19 - node_modules/min-document/dom-element.js | 209 ----- node_modules/min-document/dom-fragment.js | 28 - node_modules/min-document/dom-text.js | 27 - node_modules/min-document/event.js | 13 - .../min-document/event/add-event-listener.js | 17 - .../min-document/event/dispatch-event.js | 31 - .../event/remove-event-listener.js | 19 - node_modules/min-document/index.js | 3 - node_modules/min-document/package.json | 89 -- node_modules/min-document/serialize.js | 139 --- node_modules/min-document/test/cleanup.js | 13 - node_modules/min-document/test/index.js | 14 - .../min-document/test/static/index.html | 11 - .../min-document/test/static/test-adapter.js | 49 - .../min-document/test/test-document.js | 564 ------------ .../min-document/test/test-dom-comment.js | 20 - .../min-document/test/test-dom-element.js | 219 ----- node_modules/parse-headers/.travis.yml | 3 - node_modules/parse-headers/LICENCE | 21 - node_modules/parse-headers/example.js | 11 - node_modules/parse-headers/package.json | 55 -- node_modules/parse-headers/parse-headers.js | 32 - node_modules/parse-headers/readme.md | 70 -- node_modules/parse-headers/test.js | 70 -- node_modules/parse-headers/yarn.lock | 253 ----- node_modules/process/.eslintrc | 21 - node_modules/process/LICENSE | 22 - node_modules/process/README.md | 26 - node_modules/process/browser.js | 184 ---- node_modules/process/index.js | 2 - node_modules/process/package.json | 59 -- node_modules/process/test.js | 199 ---- node_modules/xhr/.vscode/settings.json | 3 - node_modules/xhr/CONTRIBUTING.md | 27 - node_modules/xhr/LICENCE | 19 - node_modules/xhr/README.md | 255 ----- node_modules/xhr/index.d.ts | 61 -- node_modules/xhr/index.js | 247 ----- node_modules/xhr/package.json | 79 -- node_modules/xtend/.jshintrc | 30 - node_modules/xtend/LICENSE | 20 - node_modules/xtend/README.md | 32 - node_modules/xtend/immutable.js | 19 - node_modules/xtend/mutable.js | 17 - node_modules/xtend/package.json | 86 -- node_modules/xtend/test.js | 103 --- package-lock.json | 107 +-- package.json | 1 - src/EventLog/EventLogEntryAR.php | 37 +- src/EventLog/EventLogger.php | 39 +- src/EventLog/ObjectType.php | 21 +- 104 files changed, 210 insertions(+), 7952 deletions(-) create mode 100644 classes/class.ilOneDriveDeleteGUI.php create mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/@mux/upchunk/README.md delete mode 100644 node_modules/@mux/upchunk/README_INTERNAL.md delete mode 100644 node_modules/@mux/upchunk/dist/upchunk.d.ts delete mode 100644 node_modules/@mux/upchunk/dist/upchunk.js delete mode 100644 node_modules/@mux/upchunk/dist/upchunk.js.map delete mode 100644 node_modules/@mux/upchunk/package.json delete mode 100644 node_modules/@mux/upchunk/src/upchunk.spec.js delete mode 100644 node_modules/@mux/upchunk/src/upchunk.spec.ts delete mode 100644 node_modules/@mux/upchunk/src/upchunk.ts delete mode 100644 node_modules/dom-walk/LICENCE delete mode 100644 node_modules/dom-walk/Makefile delete mode 100644 node_modules/dom-walk/README.md delete mode 100644 node_modules/dom-walk/example/index.js delete mode 100644 node_modules/dom-walk/index.js delete mode 100644 node_modules/dom-walk/package.json delete mode 100644 node_modules/event-target-shim/LICENSE delete mode 100644 node_modules/event-target-shim/README.md delete mode 100644 node_modules/event-target-shim/dist/event-target-shim.js delete mode 100644 node_modules/event-target-shim/dist/event-target-shim.js.map delete mode 100644 node_modules/event-target-shim/dist/event-target-shim.mjs delete mode 100644 node_modules/event-target-shim/dist/event-target-shim.mjs.map delete mode 100644 node_modules/event-target-shim/dist/event-target-shim.umd.js delete mode 100644 node_modules/event-target-shim/dist/event-target-shim.umd.js.map delete mode 100644 node_modules/event-target-shim/index.d.ts delete mode 100644 node_modules/event-target-shim/package.json delete mode 100644 node_modules/global/.travis.yml delete mode 100644 node_modules/global/LICENSE delete mode 100644 node_modules/global/README.md delete mode 100644 node_modules/global/console.js delete mode 100644 node_modules/global/document.js delete mode 100644 node_modules/global/package.json delete mode 100644 node_modules/global/process.js delete mode 100644 node_modules/global/window.js delete mode 100644 node_modules/is-function/LICENSE delete mode 100644 node_modules/is-function/README.md delete mode 100644 node_modules/is-function/index.js delete mode 100644 node_modules/is-function/package.json delete mode 100644 node_modules/is-function/test.js delete mode 100644 node_modules/min-document/.jshintrc delete mode 100644 node_modules/min-document/.npmignore delete mode 100644 node_modules/min-document/.testem.json delete mode 100644 node_modules/min-document/.travis.yml delete mode 100644 node_modules/min-document/CONTRIBUTION.md delete mode 100644 node_modules/min-document/LICENCE delete mode 100644 node_modules/min-document/README.md delete mode 100644 node_modules/min-document/docs.mli delete mode 100644 node_modules/min-document/document.js delete mode 100644 node_modules/min-document/dom-comment.js delete mode 100644 node_modules/min-document/dom-element.js delete mode 100644 node_modules/min-document/dom-fragment.js delete mode 100644 node_modules/min-document/dom-text.js delete mode 100644 node_modules/min-document/event.js delete mode 100644 node_modules/min-document/event/add-event-listener.js delete mode 100644 node_modules/min-document/event/dispatch-event.js delete mode 100644 node_modules/min-document/event/remove-event-listener.js delete mode 100644 node_modules/min-document/index.js delete mode 100644 node_modules/min-document/package.json delete mode 100644 node_modules/min-document/serialize.js delete mode 100644 node_modules/min-document/test/cleanup.js delete mode 100644 node_modules/min-document/test/index.js delete mode 100644 node_modules/min-document/test/static/index.html delete mode 100644 node_modules/min-document/test/static/test-adapter.js delete mode 100644 node_modules/min-document/test/test-document.js delete mode 100644 node_modules/min-document/test/test-dom-comment.js delete mode 100644 node_modules/min-document/test/test-dom-element.js delete mode 100644 node_modules/parse-headers/.travis.yml delete mode 100644 node_modules/parse-headers/LICENCE delete mode 100644 node_modules/parse-headers/example.js delete mode 100644 node_modules/parse-headers/package.json delete mode 100644 node_modules/parse-headers/parse-headers.js delete mode 100644 node_modules/parse-headers/readme.md delete mode 100644 node_modules/parse-headers/test.js delete mode 100644 node_modules/parse-headers/yarn.lock delete mode 100644 node_modules/process/.eslintrc delete mode 100644 node_modules/process/LICENSE delete mode 100644 node_modules/process/README.md delete mode 100644 node_modules/process/browser.js delete mode 100644 node_modules/process/index.js delete mode 100644 node_modules/process/package.json delete mode 100644 node_modules/process/test.js delete mode 100755 node_modules/xhr/.vscode/settings.json delete mode 100644 node_modules/xhr/CONTRIBUTING.md delete mode 100644 node_modules/xhr/LICENCE delete mode 100644 node_modules/xhr/README.md delete mode 100644 node_modules/xhr/index.d.ts delete mode 100644 node_modules/xhr/index.js delete mode 100644 node_modules/xhr/package.json delete mode 100644 node_modules/xtend/.jshintrc delete mode 100644 node_modules/xtend/LICENSE delete mode 100644 node_modules/xtend/README.md delete mode 100644 node_modules/xtend/immutable.js delete mode 100644 node_modules/xtend/mutable.js delete mode 100644 node_modules/xtend/package.json delete mode 100644 node_modules/xtend/test.js diff --git a/classes/class.ilOneDriveActionListGUI.php b/classes/class.ilOneDriveActionListGUI.php index 93ad35e..f3d1e4f 100644 --- a/classes/class.ilOneDriveActionListGUI.php +++ b/classes/class.ilOneDriveActionListGUI.php @@ -1,4 +1,8 @@ buildForm(); @@ -178,14 +183,19 @@ protected function rename() $id = filter_input(INPUT_GET, self::GET_ID, FILTER_SANITIZE_STRING); $title = $form->getInput(self::POST_TITLE); - $exoFile = exodItemCache::get($id); - if ($exoFile instanceof exodFile) { - $title = exodFile::formatRename($title, $exoFile->getName()); + $exoItem = exodItemCache::get($id); + if ($exoItem instanceof exodFile) { + $title = exodFile::formatRename($title, $exoItem->getName()); } try { $this->getService()->getClient()->renameItemById($id, $title); - + EventLogger::logObjectRenamed( + $DIC->user()->getId(), + $exoItem->getPath(), + $title, + ObjectType::fromExodItem($exoItem) + ); $response->message = ilUtil::getSystemMessageHTML($this->txt("msg_renamed"), "success"); $response->success = true; } catch (Exception $e) { diff --git a/classes/class.ilOneDriveDeleteGUI.php b/classes/class.ilOneDriveDeleteGUI.php new file mode 100644 index 0000000..3f67b19 --- /dev/null +++ b/classes/class.ilOneDriveDeleteGUI.php @@ -0,0 +1,42 @@ + + */ +class ilOneDriveDeleteGUI extends ilCloudPluginDeleteGUI +{ + public function deleteItem() + { + global $DIC; + $tpl = $DIC['tpl']; + $lng = $DIC['lng']; + + $response = new stdClass(); + $response->success = null; + $response->message = null; + + if (true) { + try { + $file_tree = ilCloudFileTree::getFileTreeFromSession(); + $node = $file_tree->getNodeFromId($_POST["id"]); + $file_tree->deleteFromService($node->getId()); + $response->message = $tpl->getMessageHTML($lng->txt("cld_file_deleted"), "success"); + $response->success = true; + EventLogger::logObjectDeleted( + $DIC->user()->getId(), + $node->getPath(), + ObjectType::fromExodItem(exodItemCache::get($node->getId())) + ); + } catch (Exception $e) { + $response->message = $tpl->getMessageHTML($e->getMessage(), "failure"); + } + } + echo ""; + exit; } + +} diff --git a/classes/class.ilOneDriveSettingsGUI.php b/classes/class.ilOneDriveSettingsGUI.php index b197314..976e9d7 100644 --- a/classes/class.ilOneDriveSettingsGUI.php +++ b/classes/class.ilOneDriveSettingsGUI.php @@ -13,6 +13,9 @@ */ class ilOneDriveSettingsGUI extends ilCloudPluginSettingsGUI { + const SUBTAB_GENERAL = 'general'; + const SUBTAB_LOGS = 'logs'; + /** * @var ilPropertyFormGUI */ @@ -28,6 +31,7 @@ protected function initPluginSettings() public function updateSettings() { global $DIC; $ilCtrl = $DIC['ilCtrl']; + $this->initSubtabs(self::SUBTAB_GENERAL); try { $this->initSettingsForm(); @@ -51,6 +55,8 @@ function editSettings() $ilCtrl = $DIC['ilCtrl']; $lng = $DIC['lng']; + $this->initSubtabs(self::SUBTAB_GENERAL); + $cloud_object_changed = false; // On object creation set cloud root id @@ -90,6 +96,28 @@ public function initSettingsForm() } + protected function showLogs() + { + global $DIC; + $DIC->tabs()->activateTab('settings'); + $this->initSubtabs(self::SUBTAB_LOGS); + + } + + protected function initSubtabs(string $active) + { + global $DIC; + $DIC->tabs()->addSubTab( + self::SUBTAB_GENERAL, + $this->txt('subtab_' . self::SUBTAB_GENERAL), + $DIC->ctrl()->getLinkTargetByClass(parent::class, 'editSettings')); + $DIC->tabs()->addSubTab( + self::SUBTAB_LOGS, + $this->txt('subtab_' . self::SUBTAB_LOGS), + $DIC->ctrl()->getLinkTargetByClass(parent::class, 'showLogs')); + $DIC->tabs()->setSubTabActive($active); + } + public function txt($var = "") { diff --git a/classes/class.ilOneDriveUploadGUI.php b/classes/class.ilOneDriveUploadGUI.php index f2501c3..680517b 100644 --- a/classes/class.ilOneDriveUploadGUI.php +++ b/classes/class.ilOneDriveUploadGUI.php @@ -79,7 +79,13 @@ function handleFileUpload($file_upload) protected function afterUpload() { - // TODO: event logging + global $DIC; + $name = filter_input(INPUT_POST, 'filename', FILTER_SANITIZE_STRING); + $parent_id = $_SESSION["cld_folder_id"]; + EventLogger::logUploadComplete( + $DIC->user()->getId(), + ilCloudFileTree::getFileTreeFromSession()->getNodeFromId($parent_id)->getPath() . '/' . $name + ); } protected function asyncGetResumableUploadUrl() @@ -99,8 +105,7 @@ protected function asyncGetResumableUploadUrl() } EventLogger::logUploadStarted( $DIC->user()->getId(), - $name, - ilCloudFileTree::getFileTreeFromSession()->getNodeFromId($parent_id)->getPath() + ilCloudFileTree::getFileTreeFromSession()->getNodeFromId($parent_id)->getPath() . '/' . $name ); http_response_code(200); echo $upload_url->toJson(); diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..e216cd7 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,38 @@ +{ + "name": "srag.plugins.onedrive", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/blueimp-canvas-to-blob": { + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.28.0.tgz", + "integrity": "sha512-5q+YHzgGsuHQ01iouGgJaPJXod2AzTxJXmVv90PpGrRxU7G7IqgPqWXz+PBmt3520jKKi6irWbNV87DicEa7wg==", + "optional": true + }, + "node_modules/blueimp-file-upload": { + "version": "10.31.0", + "resolved": "https://registry.npmjs.org/blueimp-file-upload/-/blueimp-file-upload-10.31.0.tgz", + "integrity": "sha512-dGAxOf9+SsMDvZPTsIUpe0cOk57taMJYE3FocHEUebhn5BnDbu1hcWOmrP8oswIe6V61Qcm9UDuhq/Pv1t/eRw==", + "optionalDependencies": { + "blueimp-canvas-to-blob": "3", + "blueimp-load-image": "5", + "blueimp-tmpl": "3" + } + }, + "node_modules/blueimp-load-image": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/blueimp-load-image/-/blueimp-load-image-5.14.0.tgz", + "integrity": "sha512-g5l+4dCOESBG8HkPLdGnBx8dhEwpQHaOZ0en623sl54o3bGhGMLYGc54L5cWfGmPvfKUjbsY7LOAmcW/xlkBSA==", + "optional": true + }, + "node_modules/blueimp-tmpl": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/blueimp-tmpl/-/blueimp-tmpl-3.19.0.tgz", + "integrity": "sha512-v8/Vge6U3uwlAjO9TxeHoYl77C1GJDZBN45pUp+39WyHU/VRzYbnGDhRNYvcT6Lh8jihVsXNZttnDpnYVA4m9w==", + "optional": true, + "bin": { + "tmpl.js": "js/compile.js" + } + } + } +} diff --git a/node_modules/@mux/upchunk/README.md b/node_modules/@mux/upchunk/README.md deleted file mode 100644 index 5bd8d9a..0000000 --- a/node_modules/@mux/upchunk/README.md +++ /dev/null @@ -1,182 +0,0 @@ -![UpChunk](banner.png) - -# UpChunk Build Status - -UpChunk uploads chunks of files! It's a JavaScript module for handling large file uploads via chunking and making a `put` request for each chunk with the correct range request headers. Uploads can be paused and resumed, they're fault tolerant, -and it should work just about anywhere. - -UpChunk is designed to be used with [Mux](https://mux.com) direct uploads, but should work with any server that supports resumable uploads in the same manner. This library will: - -- Split a file into chunks (in multiples of 256KB). -- Make a `PUT` request for each chunk, specifying the correct `Content-Length` and `Content-Range` headers for each one. -- Retry a chunk upload on failures. -- Allow for pausing and resuming an upload. - -## Installation - -### NPM - -``` -npm install --save @mux/upchunk -``` - -### Yarn - -``` -yarn add @mux/upchunk -``` - -### Script Tags - -``` - -``` - -## Basic Usage - -### Getting an upload URL from Mux. - -You'll need to have a route in your application that returns an upload URL from Mux. If you're using the [Mux Node SDK](https://github.com/muxinc/mux-node-sdk), you might do something that looks like this. - -```javascript -const { Video } = new Mux(); - -module.exports = async (req, res) => { - // This ultimately just makes a POST request to https://api.mux.com/video/v1/uploads with the supplied options. - const upload = await Video.Uploads.create({ - cors_origin: 'https://your-app.com', - new_asset_settings: { - playback_policy: 'public', - }, - }); - - // Save the Upload ID in your own DB somewhere, then - // return the upload URL to the end-user. - res.end(upload.url); -}; -``` - -### Then, in the browser - -```javascript -import * as UpChunk from '@mux/upchunk'; - -// Pretend you have an HTML page with an input like: -const picker = document.getElementById('picker'); - -picker.onchange = () => { - const getUploadUrl = () => - fetch('/the-endpoint-above').then(res => - res.ok ? res.text() : throw new Error('Error getting an upload URL :(') - ); - - const upload = UpChunk.createUpload({ - endpoint: getUploadUrl, - file: picker.files[0], - chunkSize: 5120, // Uploads the file in ~5mb chunks - }); - - // subscribe to events - upload.on('error', err => { - console.error('💥 🙀', err.detail); - }); - - upload.on('progress', progress => { - console.log(`So far we've uploaded ${progress.detail}% of this file.`); - }); - - upload.on('success', () => { - console.log("Wrap it up, we're done here. 👋"); - }); -}; -``` - -## API - -### `createUpload(options)` - -Returns an instance of `UpChunk` and begins uploading the specified `File`. - -#### `options` object parameters - -- `endpoint` type: `string` | `function` (required) - - URL to upload the file to. This can be either a string of the authenticated URL to upload to, or a function that returns a promise that resolves that URL string. The function will be passed the `file` as a parameter. - -- `file` type: [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) (required) - - The file you'd like to upload. For example, you might just want to use the file from an input with a type of "file". - -- `headers` type: `Object` - - An object with any headers you'd like included with the `PUT` request for each chunk. - -- `chunkSize` type: `integer`, default:`5120` - - The size in kb of the chunks to split the file into, with the exception of the final chunk which may be smaller. This parameter should be in multiples of 256. - -- `maxFileSize` type: `integer` - - The maximum size of the file in kb of the input file to be uploaded. The maximum size can technically be smaller than the chunk size, and in that case there would be exactly one chunk. - -- `retries` type: `integer`, default: `5` - - The number of times to retry any given chunk. - -- `delayBeforeRetry` type: `integer`, default: `1` - - The time in seconds to wait before attempting to upload a chunk again. - -- `method` type: `"PUT" | "PATCH" | "POST"`, default: `PUT` - - The HTTP method to use when uploading each chunk. - -### UpChunk Instance Methods - -- `pause()` - - Pauses an upload after the current in-flight chunk is finished uploading. - -- `resume()` - - Resumes an upload that was previously paused. - -### UpChunk Instance Events - -Events are fired with a [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent) object. The `detail` key is null if an interface isn't specified. - -- `attempt` `{ detail: { chunkNumber: Integer, chunkSize: Integer } }` - - Fired immediately before a chunk upload is attempted. `chunkNumber` is the number of the current chunk being attempted, and `chunkSize` is the size (in bytes) of that chunk. - -- `attemptFailure` `{ detail: { message: String, chunkNumber: Integer, attemptsLeft: Integer } }` - - Fired when an attempt to upload a chunk fails. - -- `chunkSuccess` `{ detail: { chunk: Integer, attempts: Integer, response: XhrResponse } }` - - Fired when an indvidual chunk is successfully uploaded. - -- `error` `{ detail: { message: String, chunkNumber: Integer, attempts: Integer } }` - - Fired when a chunk has reached the max number of retries or the response code is fatal and implies that retries should not be attempted. - -- `offline` - - Fired when the client has gone offline. - -- `online` - - Fired when the client has gone online. - -- `progress` `{ detail: [0..100] }` - - Fired continuously with incremental upload progress. This returns the current percentage of the file that's been uploaded. - -- `success` - - Fired when the upload is finished successfully. - -## Credit - -The original idea and base for this came from the awesome [huge uploader](https://github.com/Buzut/huge-uploader) project, which is what you need if you're looking to do multipart form data uploads. 👏 diff --git a/node_modules/@mux/upchunk/README_INTERNAL.md b/node_modules/@mux/upchunk/README_INTERNAL.md deleted file mode 100644 index 3fea005..0000000 --- a/node_modules/@mux/upchunk/README_INTERNAL.md +++ /dev/null @@ -1,10 +0,0 @@ -# Release - -1. Get branch approved and merged -1. Pull the updated master branch locally -1. Run `npm version` - bump the version appropriately (this will commit and tag master). ex: `npm version 1.0.8` -1. Push commit to github w/ tags `git push origin --tags` -1. Run `yarn build` -1. Run `npm publish` (your npm account will need to have publish access) -1. After publishing, there will be a release in github with this tagname. Edit the release notes with any changes and attach the `.tgz` file that was created by `yarn build`. - diff --git a/node_modules/@mux/upchunk/dist/upchunk.d.ts b/node_modules/@mux/upchunk/dist/upchunk.d.ts deleted file mode 100644 index ae574a3..0000000 --- a/node_modules/@mux/upchunk/dist/upchunk.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { XhrHeaders } from 'xhr'; -declare type EventName = 'attempt' | 'attemptFailure' | 'chunkSuccess' | 'error' | 'offline' | 'online' | 'progress' | 'success'; -declare type AllowedMethods = 'PUT' | 'POST' | 'PATCH'; -export interface UpChunkOptions { - endpoint: string | ((file?: File) => Promise); - file: File; - method?: AllowedMethods; - headers?: XhrHeaders; - maxFileSize?: number; - chunkSize?: number; - attempts?: number; - delayBeforeAttempt?: number; -} -export declare class UpChunk { - endpoint: string | ((file?: File) => Promise); - file: File; - headers: XhrHeaders; - method: AllowedMethods; - chunkSize: number; - attempts: number; - delayBeforeAttempt: number; - private chunk; - private chunkCount; - private chunkByteSize; - private maxFileBytes; - private endpointValue; - private totalChunks; - private attemptCount; - private offline; - private paused; - private currentXhr?; - private reader; - private eventTarget; - constructor(options: UpChunkOptions); - /** - * Subscribe to an event - */ - on(eventName: EventName, fn: (event: CustomEvent) => void): void; - abort(): void; - pause(): void; - resume(): void; - /** - * Dispatch an event - */ - private dispatch; - /** - * Validate options and throw errors if expectations are violated. - */ - private validateOptions; - /** - * Endpoint can either be a URL or a function that returns a promise that resolves to a string. - */ - private getEndpoint; - /** - * Get portion of the file of x bytes corresponding to chunkSize - */ - private getChunk; - private xhrPromise; - /** - * Send chunk of the file with appropriate headers and add post parameters if it's last chunk - */ - private sendChunk; - /** - * Called on net failure. If retry counter !== 0, retry after delayBeforeAttempt - */ - private manageRetries; - /** - * Manage the whole upload by calling getChunk & sendChunk - * handle errors & retries and dispatch events - */ - private sendChunks; -} -export declare const createUpload: (options: UpChunkOptions) => UpChunk; -export {}; diff --git a/node_modules/@mux/upchunk/dist/upchunk.js b/node_modules/@mux/upchunk/dist/upchunk.js deleted file mode 100644 index fea01bf..0000000 --- a/node_modules/@mux/upchunk/dist/upchunk.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.UpChunk=t():e.UpChunk=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&this.maxFileBytes "+this.maxFileBytes+")");if(this.attempts&&("number"!=typeof this.attempts||this.attempts<=0))throw new TypeError("retries must be a positive number");if(this.delayBeforeAttempt&&("number"!=typeof this.delayBeforeAttempt||this.delayBeforeAttempt<0))throw new TypeError("delayBeforeAttempt must be a positive number")},e.prototype.getEndpoint=function(){var e=this;return"string"==typeof this.endpoint?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then((function(t){return e.endpointValue=t,e.endpointValue}))},e.prototype.getChunk=function(){var e=this;return new Promise((function(t){var n=1===e.totalChunks?e.file.size:e.chunkByteSize,r=n*e.chunkCount;e.reader.onload=function(){null!==e.reader.result&&(e.chunk=new Blob([e.reader.result],{type:"application/octet-stream"})),t()},e.reader.readAsArrayBuffer(e.file.slice(r,r+n))}))},e.prototype.xhrPromise=function(e){var t=this,n=function(e){e.upload.onprogress=function(e){var n=100/t.totalChunks*t.chunkCount,r=e.loaded/t.file.size*100;t.dispatch("progress",n+r)}};return new Promise((function(o,s){t.currentXhr=i.default(r(r({},e),{beforeSend:n}),(function(e,n){return t.currentXhr=void 0,e?s(e):o(n)}))}))},e.prototype.sendChunk=function(){var e=this.chunkCount*this.chunkByteSize,t=e+this.chunk.size-1,n=r(r({},this.headers),{"Content-Type":this.file.type,"Content-Range":"bytes "+e+"-"+t+"/"+this.file.size});return this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.xhrPromise({headers:n,url:this.endpointValue,method:this.method,body:this.chunk})},e.prototype.manageRetries=function(){var e=this;if(this.attemptCount0){const e=new Array(arguments.length);for(let t=0;t0&&(l=setTimeout((function(){if(!p){p=!0,c.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",o(e)}}),e.timeout)),c.setRequestHeader)for(u in y)y.hasOwnProperty(u)&&c.setRequestHeader(u,y[u]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(d||null),c}e.exports=a,e.exports.default=a,a.XMLHttpRequest=r.XMLHttpRequest||function(){},a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:r.XDomainRequest,function(e,t){for(var n=0;n 0 && this.maxFileBytes < this.file.size) {\n throw new Error(\"file size exceeds maximum (\" + this.file.size + \" > \" + this.maxFileBytes + \")\");\n }\n if (this.attempts &&\n (typeof this.attempts !== 'number' || this.attempts <= 0)) {\n throw new TypeError('retries must be a positive number');\n }\n if (this.delayBeforeAttempt &&\n (typeof this.delayBeforeAttempt !== 'number' ||\n this.delayBeforeAttempt < 0)) {\n throw new TypeError('delayBeforeAttempt must be a positive number');\n }\n };\n /**\n * Endpoint can either be a URL or a function that returns a promise that resolves to a string.\n */\n UpChunk.prototype.getEndpoint = function () {\n var _this = this;\n if (typeof this.endpoint === 'string') {\n this.endpointValue = this.endpoint;\n return Promise.resolve(this.endpoint);\n }\n return this.endpoint(this.file).then(function (value) {\n _this.endpointValue = value;\n return _this.endpointValue;\n });\n };\n /**\n * Get portion of the file of x bytes corresponding to chunkSize\n */\n UpChunk.prototype.getChunk = function () {\n var _this = this;\n return new Promise(function (resolve) {\n // Since we start with 0-chunkSize for the range, we need to subtract 1.\n var length = _this.totalChunks === 1 ? _this.file.size : _this.chunkByteSize;\n var start = length * _this.chunkCount;\n _this.reader.onload = function () {\n if (_this.reader.result !== null) {\n _this.chunk = new Blob([_this.reader.result], {\n type: 'application/octet-stream',\n });\n }\n resolve();\n };\n _this.reader.readAsArrayBuffer(_this.file.slice(start, start + length));\n });\n };\n UpChunk.prototype.xhrPromise = function (options) {\n var _this = this;\n var beforeSend = function (xhrObject) {\n xhrObject.upload.onprogress = function (event) {\n var successfulPercentage = (100 / _this.totalChunks) * _this.chunkCount;\n var chunkPercentage = (event.loaded / _this.file.size) * 100;\n _this.dispatch('progress', successfulPercentage + chunkPercentage);\n };\n };\n return new Promise(function (resolve, reject) {\n _this.currentXhr = xhr_1[\"default\"](__assign(__assign({}, options), { beforeSend: beforeSend }), function (err, resp) {\n _this.currentXhr = undefined;\n if (err) {\n return reject(err);\n }\n return resolve(resp);\n });\n });\n };\n /**\n * Send chunk of the file with appropriate headers and add post parameters if it's last chunk\n */\n UpChunk.prototype.sendChunk = function () {\n var rangeStart = this.chunkCount * this.chunkByteSize;\n var rangeEnd = rangeStart + this.chunk.size - 1;\n var headers = __assign(__assign({}, this.headers), { 'Content-Type': this.file.type, 'Content-Range': \"bytes \" + rangeStart + \"-\" + rangeEnd + \"/\" + this.file.size });\n this.dispatch('attempt', {\n chunkNumber: this.chunkCount,\n chunkSize: this.chunk.size,\n });\n return this.xhrPromise({\n headers: headers,\n url: this.endpointValue,\n method: this.method,\n body: this.chunk,\n });\n };\n /**\n * Called on net failure. If retry counter !== 0, retry after delayBeforeAttempt\n */\n UpChunk.prototype.manageRetries = function () {\n var _this = this;\n if (this.attemptCount < this.attempts) {\n setTimeout(function () { return _this.sendChunks(); }, this.delayBeforeAttempt * 1000);\n this.dispatch('attemptFailure', {\n message: \"An error occured uploading chunk \" + this.chunkCount + \". \" + (this.attempts - this.attemptCount) + \" retries left.\",\n chunkNumber: this.chunkCount,\n attemptsLeft: this.attempts - this.attemptCount,\n });\n return;\n }\n this.dispatch('error', {\n message: \"An error occured uploading chunk \" + this.chunkCount + \". No more retries, stopping upload\",\n chunk: this.chunkCount,\n attempts: this.attemptCount,\n });\n };\n /**\n * Manage the whole upload by calling getChunk & sendChunk\n * handle errors & retries and dispatch events\n */\n UpChunk.prototype.sendChunks = function () {\n var _this = this;\n if (this.paused || this.offline) {\n return;\n }\n this.getChunk()\n .then(function () { return _this.sendChunk(); })\n .then(function (res) {\n _this.attemptCount = _this.attemptCount + 1;\n if (SUCCESSFUL_CHUNK_UPLOAD_CODES.includes(res.statusCode)) {\n _this.dispatch('chunkSuccess', {\n chunk: _this.chunkCount,\n attempts: _this.attemptCount,\n response: res,\n });\n _this.attemptCount = 0;\n _this.chunkCount = _this.chunkCount + 1;\n if (_this.chunkCount < _this.totalChunks) {\n _this.sendChunks();\n }\n else {\n _this.dispatch('success');\n }\n var percentProgress = Math.round((100 / _this.totalChunks) * _this.chunkCount);\n _this.dispatch('progress', percentProgress);\n }\n else if (TEMPORARY_ERROR_CODES.includes(res.statusCode)) {\n if (_this.paused || _this.offline) {\n return;\n }\n _this.manageRetries();\n }\n else {\n if (_this.paused || _this.offline) {\n return;\n }\n _this.dispatch('error', {\n message: \"Server responded with \" + res.statusCode + \". Stopping upload.\",\n chunkNumber: _this.chunkCount,\n attempts: _this.attemptCount,\n });\n }\n })[\"catch\"](function (err) {\n if (_this.paused || _this.offline) {\n return;\n }\n // this type of error can happen after network disconnection on CORS setup\n _this.manageRetries();\n });\n };\n return UpChunk;\n}());\nexports.UpChunk = UpChunk;\nexports.createUpload = function (options) { return new UpChunk(options); };\n","/**\n * @author Toru Nagashima \n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap();\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap();\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event);\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n );\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n );\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true;\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault();\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n });\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n\n // Define accessors\n const keys = Object.keys(event);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key));\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget;\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation();\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this);\n\n data.stopped = true;\n data.immediateStopped = true;\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation();\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this));\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true;\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this));\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n});\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype);\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event);\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value;\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event;\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto);\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event);\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n });\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n const isFunc = typeof descriptor.value === \"function\";\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n );\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);\n wrappers.set(proto, wrapper);\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nfunction wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event));\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nfunction isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nfunction setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase;\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nfunction setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget;\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nfunction setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener;\n}\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap();\n\n// Listener types\nconst CAPTURE = 1;\nconst BUBBLE = 2;\nconst ATTRIBUTE = 3;\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget);\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this);\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next;\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null; // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this);\n\n // Traverse to the tail while removing old value.\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n };\n if (prev === null) {\n listeners.set(eventName, newNode);\n } else {\n prev.next = newNode;\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n );\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this);\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n });\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map());\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length);\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this);\n const optionsIsObj = isObject(options);\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n };\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName);\n if (node === undefined) {\n listeners.set(eventName, newNode);\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null;\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node;\n node = node.next;\n }\n\n // Add it.\n prev.next = newNode;\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this);\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n return\n }\n\n prev = node;\n node = node.next;\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this);\n const eventName = event.type;\n let node = listeners.get(eventName);\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null;\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n );\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent);\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err);\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent);\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next;\n }\n setPassiveListener(wrappedEvent, null);\n setEventPhase(wrappedEvent, 0);\n setCurrentTarget(wrappedEvent, null);\n\n return !wrappedEvent.defaultPrevented\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n});\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);\n}\n\nexports.defineEventAttribute = defineEventAttribute;\nexports.EventTarget = EventTarget;\nexports.default = EventTarget;\n\nmodule.exports = EventTarget\nmodule.exports.EventTarget = module.exports[\"default\"] = EventTarget\nmodule.exports.defineEventAttribute = defineEventAttribute\n//# sourceMappingURL=event-target-shim.js.map\n","\"use strict\";\nvar window = require(\"global/window\")\nvar isFunction = require(\"is-function\")\nvar parseHeaders = require(\"parse-headers\")\nvar xtend = require(\"xtend\")\n\nmodule.exports = createXHR\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = createXHR;\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = \"withCredentials\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback)\n options.method = method.toUpperCase()\n return _createXHR(options)\n }\n})\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i])\n }\n}\n\nfunction isEmpty(obj){\n for(var i in obj){\n if(obj.hasOwnProperty(i)) return false\n }\n return true\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri\n\n if (isFunction(options)) {\n callback = options\n if (typeof uri === \"string\") {\n params = {uri:uri}\n }\n } else {\n params = xtend(options, {uri: uri})\n }\n\n params.callback = callback\n return params\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback)\n return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n if(typeof options.callback === \"undefined\"){\n throw new Error(\"callback argument missing\")\n }\n\n var called = false\n var callback = function cbOnce(err, response, body){\n if(!called){\n called = true\n options.callback(err, response, body)\n }\n }\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0)\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined\n\n if (xhr.response) {\n body = xhr.response\n } else {\n body = xhr.responseText || getXml(xhr)\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body)\n } catch (e) {}\n }\n\n return body\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer)\n if(!(evt instanceof Error)){\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\") )\n }\n evt.statusCode = 0\n return callback(evt, failureResponse)\n }\n\n // will load the data & process the response in a special response object\n function loadFunc() {\n if (aborted) return\n var status\n clearTimeout(timeoutTimer)\n if(options.useXDR && xhr.status===undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200\n } else {\n status = (xhr.status === 1223 ? 204 : xhr.status)\n }\n var response = failureResponse\n var err = null\n\n if (status !== 0){\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\")\n }\n return callback(err, response, response.body)\n }\n\n var xhr = options.xhr || null\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest()\n }else{\n xhr = new createXHR.XMLHttpRequest()\n }\n }\n\n var key\n var aborted\n var uri = xhr.url = options.uri || options.url\n var method = xhr.method = options.method || \"GET\"\n var body = options.body || options.data\n var headers = xhr.headers = options.headers || {}\n var sync = !!options.sync\n var isJson = false\n var timeoutTimer\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n }\n\n if (\"json\" in options && options.json !== false) {\n isJson = true\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\") //Don't override existing accept header declared by user\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\") //Don't override existing accept header declared by user\n body = JSON.stringify(options.json === true ? body : options.json)\n }\n }\n\n xhr.onreadystatechange = readystatechange\n xhr.onload = loadFunc\n xhr.onerror = errorFunc\n // IE9 must have onprogress be set to a unique function.\n xhr.onprogress = function () {\n // IE must die\n }\n xhr.onabort = function(){\n aborted = true;\n }\n xhr.ontimeout = errorFunc\n xhr.open(method, uri, !sync, options.username, options.password)\n //has to be after open\n if(!sync) {\n xhr.withCredentials = !!options.withCredentials\n }\n // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n if (!sync && options.timeout > 0 ) {\n timeoutTimer = setTimeout(function(){\n if (aborted) return\n aborted = true//IE9 may still call readystatechange\n xhr.abort(\"timeout\")\n var e = new Error(\"XMLHttpRequest timeout\")\n e.code = \"ETIMEDOUT\"\n errorFunc(e)\n }, options.timeout )\n }\n\n if (xhr.setRequestHeader) {\n for(key in headers){\n if(headers.hasOwnProperty(key)){\n xhr.setRequestHeader(key, headers[key])\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\")\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType\n }\n\n if (\"beforeSend\" in options &&\n typeof options.beforeSend === \"function\"\n ) {\n options.beforeSend(xhr)\n }\n\n // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n xhr.send(body || null)\n\n return xhr\n\n\n}\n\nfunction getXml(xhr) {\n // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n try {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML\n }\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\"\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML\n }\n } catch (e) {}\n\n return null\n}\n\nfunction noop() {}\n","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n if (!fn) {\n return false\n }\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n","var trim = function(string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n}\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n var headersArr = trim(headers).split('\\n')\n\n for (var i = 0; i < headersArr.length; i++) {\n var row = headersArr[i]\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n\n return result\n}\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@mux/upchunk/package.json b/node_modules/@mux/upchunk/package.json deleted file mode 100644 index c06b1d6..0000000 --- a/node_modules/@mux/upchunk/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_from": "@mux/upchunk", - "_id": "@mux/upchunk@2.2.0", - "_inBundle": false, - "_integrity": "sha512-z2tJH6yhpFe5Yz97ynI7BcGMq04yn5rRnS7nbXhq6Y58fgts9UKnsa6KDXsQq/yCbg+ImlgzoHXV0XNnF/bA2g==", - "_location": "/@mux/upchunk", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "@mux/upchunk", - "name": "@mux/upchunk", - "escapedName": "@mux%2fupchunk", - "scope": "@mux", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/@mux/upchunk/-/upchunk-2.2.0.tgz", - "_shasum": "6a204a3e9865e0670b96a44efc69c83456f288dc", - "_spec": "@mux/upchunk", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive", - "author": { - "name": "Matthew McClure", - "email": "m@mux.com" - }, - "bugs": { - "url": "https://github.com/muxinc/upchunk/issues" - }, - "bundleDependencies": false, - "dependencies": { - "event-target-shim": "^4.0.3", - "xhr": "^2.6.0" - }, - "deprecated": false, - "description": "Dead simple chunked file uploads using Fetch", - "devDependencies": { - "@types/jest": "^25.2.3", - "jest": "^26.6.3", - "nock": "^13.0.5", - "ts-jest": "^26.1.0", - "ts-loader": "^7.0.5", - "tslint": "^6.1.2", - "tslint-config-airbnb": "^5.11.2", - "tslint-config-prettier": "^1.18.0", - "typescript": "^3.9.5", - "webpack": "^4.43.0", - "webpack-cli": "^3.3.11", - "webpack-dev-server": "^3.11.0", - "webpack-merge": "^4.2.2" - }, - "files": [ - "dist", - "src" - ], - "homepage": "https://github.com/muxinc/upchunk#readme", - "keywords": [ - "browser upload", - "chunked upload", - "file upload", - "gcs upload", - "google cloud storage upload", - "large file upload", - "resumable", - "upload" - ], - "license": "MIT", - "main": "dist/upchunk.js", - "name": "@mux/upchunk", - "repository": { - "type": "git", - "url": "git+https://github.com/muxinc/upchunk.git" - }, - "scripts": { - "build": "yarn clean && yarn lint && yarn test && webpack --config webpack.prod.js && yarn pack", - "clean": "rm -rf ./dist", - "lint": "tslint --project .", - "start": "webpack-dev-server --open --config webpack.dev.js", - "test": "jest", - "tslint-check": "tslint-config-prettier-check ./tslint.json" - }, - "version": "2.2.0", - "volta": { - "node": "10.21.0" - } -} diff --git a/node_modules/@mux/upchunk/src/upchunk.spec.js b/node_modules/@mux/upchunk/src/upchunk.spec.js deleted file mode 100644 index 2bac8c6..0000000 --- a/node_modules/@mux/upchunk/src/upchunk.spec.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * This is more of an integration test. We can't test these in TS, because - * our handy dandy typechecks will make it so we can't compile with invalid - * parameters. We don't have that luxury in normal JS, however, so make sure - * we still yell when we're supposed to. - */ - -const { createUpload, UpChunk } = require('./upchunk'); - -const fakeFile = () => { - return new File(['foo'], 'foo.mp4', { - type: 'video/mp4', - }); -}; - -describe('option validation', () => { - const buildParams = (options = {}) => ({ - endpoint: '/foo', - file: fakeFile(), - headers: {}, - chunkSize: 256, - attempts: 1, - delayBeforeAttempt: 1, - ...options, - }); - - test('returns a new UpChunk instance when given valid params', () => { - const upload = createUpload(buildParams()); - expect(upload).toBeInstanceOf(UpChunk); - }); - - test('accepts a function that returns a promise for endpoint', () => { - const upload = createUpload( - buildParams({ endpoint: () => Promise.resolve('/foo') }) - ); - expect(upload).toBeInstanceOf(UpChunk); - }); - - describe('throws', () => { - test('endpoint is not included', () => { - const params = buildParams({ endpoint: undefined }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('endpoint is an empty string', () => { - const params = buildParams({ endpoint: '' }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('file is not included', () => { - const params = buildParams({ file: undefined }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('file is not a File', () => { - const params = buildParams({ file: 'neato' }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('headers are specified and not an object', () => { - const params = buildParams({ headers: 'hey neato' }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('chunkSize is not a number', () => { - const params = buildParams({ chunkSize: 'cool' }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('chunkSize is a positive integer', () => { - const params = buildParams({ chunkSize: -256 }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('chunkSize is not a multiple of 256', () => { - const params = buildParams({ chunkSize: 100 }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('attempts is not a number', () => { - const params = buildParams({ attempts: 'foo' }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('attempts is not a positive number', () => { - const params = buildParams({ attempts: -1 }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('delayBeforeAttempt is not a positive number', () => { - const params = buildParams({ delayBeforeAttempt: -1 }); - - expect(() => createUpload(params)).toThrow(TypeError); - }); - - test('an error is thrown if input file is larger than max', () => { - const params = buildParams({ maxFileSize: (fakeFile().size - 1) / 1024 }); - - expect(() => createUpload(params)).toThrow(Error); - }); - }); -}); diff --git a/node_modules/@mux/upchunk/src/upchunk.spec.ts b/node_modules/@mux/upchunk/src/upchunk.spec.ts deleted file mode 100644 index 5a27310..0000000 --- a/node_modules/@mux/upchunk/src/upchunk.spec.ts +++ /dev/null @@ -1,260 +0,0 @@ -import * as nock from 'nock'; - -import { UpChunk, createUpload, UpChunkOptions } from './upchunk'; - -beforeEach(() => { - if (!nock.isActive()) { - nock.activate(); - } -}); - -afterEach(() => { - nock.restore(); - nock.cleanAll(); -}); - -const createUploadFixture = ( - options?: Partial, - specifiedFile?: File -) => { - const file = specifiedFile || new File([new ArrayBuffer(524288)], 'test.mp4'); - - return createUpload({ - file, - endpoint: `https://example.com/upload/endpoint`, - chunkSize: 256, - ...options, - }); -}; - -test('files can be uploading using POST', (done) => { - nock('https://example.com') - .post('/upload/endpoint') - .twice() - .reply(200) - - const upload = createUploadFixture({ - method: 'POST', - }); - - upload.on('success', () => { - done(); - }); -}); - -test('files can be uploading using PATCH', (done) => { - nock('https://example.com') - .patch('/upload/endpoint') - .twice() - .reply(200); - - const upload = createUploadFixture({ - method: 'PATCH', - }); - - upload.on('success', () => { - done(); - }); -}); - -test('a file is uploaded using the correct content-range headers', (done) => { - const fileBytes = 524288; - const upload = createUploadFixture( - {}, - new File([new ArrayBuffer(fileBytes)], 'test.mp4') - ); - - const scopes = [ - nock('https://example.com') - .matchHeader('content-range', `bytes 0-${fileBytes / 2 - 1}/${fileBytes}`) - .put('/upload/endpoint') - .reply(200), - - nock('https://example.com') - .matchHeader( - 'content-range', - `bytes ${fileBytes / 2}-${fileBytes - 1}/${fileBytes}` - ) - .put('/upload/endpoint') - .reply(200), - ]; - - upload.on('error', (err) => { - done(err); - }); - - upload.on('success', () => { - scopes.forEach((scope) => { - if (!scope.isDone()) { - done('All scopes not completed'); - } - }); - - done(); - }); -}); - -test('an error is thrown if a request does not complete', (done) => { - nock('https://example.com').put('/upload/endpoint').reply(500); - - const upload = createUploadFixture(); - - upload.on('error', (err) => { - done(); - }); - - upload.on('success', () => { - done('Ironic failure, should not have been successful'); - }); -}); - -test('fires an attempt event before each attempt', (done) => { - let ATTEMPT_COUNT = 0; - const MAX_ATTEMPTS = 2; // because we set the chunk size to 256kb, half of our file size in bytes. - - nock('https://example.com') - .put('/upload/endpoint') - .reply(200) - .put('/upload/endpoint') - .reply(200); - - const upload = createUploadFixture(); - - upload.on('attempt', (err) => { - ATTEMPT_COUNT += 1; - }); - - upload.on('success', () => { - if (ATTEMPT_COUNT === MAX_ATTEMPTS) { - done(); - } else { - done( - `Attempted ${ATTEMPT_COUNT} times and it should have been ${MAX_ATTEMPTS}` - ); - } - }); -}); - -test('a chunk failing to upload fires an attemptFailure event', (done) => { - nock('https://example.com').put('/upload/endpoint').reply(502); - - const upload = createUploadFixture(); - - upload.on('attemptFailure', (err) => { - upload.pause(); - done(); - }); -}); - -test('a single chunk failing is retried multiple times until successful', (done) => { - let ATTEMPT_FAILURE_COUNT = 0; - const FAILURES = 2; - - nock('https://example.com') - .put('/upload/endpoint') - .times(FAILURES) - .reply(502) - .put('/upload/endpoint') - .twice() - .reply(200); - - const upload = createUploadFixture({ delayBeforeAttempt: 0.1 }); - - upload.on('attemptFailure', (err) => { - ATTEMPT_FAILURE_COUNT += 1; - }); - - upload.on('error', done); - - upload.on('success', () => { - if (ATTEMPT_FAILURE_COUNT === FAILURES) { - return done(); - } - - done( - `Expected ${FAILURES} attempt failures, received ${ATTEMPT_FAILURE_COUNT}` - ); - }); -}); - -test('a single chunk failing the max number of times fails the upload', (done) => { - nock('https://example.com') - .put('/upload/endpoint') - .times(5) - .reply(502) - .put('/upload/endpoint') - .twice() - .reply(200); - - const upload = createUploadFixture({ delayBeforeAttempt: 0.1 }); - - upload.on('error', (err) => { - try { - expect(err.detail.chunk).toBe(0); - expect(err.detail.attempts).toBe(5); - done(); - } catch (err) { - done(err); - } - }); - - upload.on('success', () => { - done(`Expected upload to fail due to failed attempts`); - }); -}); - -test('chunkSuccess event is fired after each successful upload', (done) => { - nock('https://example.com') - .put('/upload/endpoint') - .reply(200) - .put('/upload/endpoint') - .reply(200); - - const upload = createUploadFixture(); - - const successCallback = jest.fn(); - - upload.on('chunkSuccess', successCallback); - - upload.on('success', () => { - expect(successCallback).toBeCalledTimes(2); - done(); - }); -}); - -test('abort pauses the upload and cancels the current XHR request', (done) => { - /* - This is hacky and I don't love it, but the gist is: - - Set up a chunkSuccess callback listener - - We abort the upload during the first request stub before responding - - In the attempt callback, we'll set a short timeout, where we check if the scope is done, meaning all the stubs have been called. If that's the case, make sure that chunkSuccess was never called. - */ - let upload: UpChunk; - - const scope = nock('https://example.com') - .put('/upload/endpoint') - .reply(() => { - upload.abort(); - - return [200, 'success']; - }); - - upload = createUploadFixture(); - - const chunkSuccessCallback = jest.fn(); - - upload.on('attempt', (e) => { - setTimeout(() => { - expect(scope.isDone()).toBeTruthy(); - expect(chunkSuccessCallback).toHaveBeenCalledTimes(0); - done(); - }, 10); - }); - - // upload.on('chunkSuccess', chunkSuccessCallback); - upload.on('chunkSuccess', (e) => console.log(e.detail)) - - upload.on('success', () => { - done('Upload should not have successfully completed'); - }); -}); diff --git a/node_modules/@mux/upchunk/src/upchunk.ts b/node_modules/@mux/upchunk/src/upchunk.ts deleted file mode 100644 index b2be73b..0000000 --- a/node_modules/@mux/upchunk/src/upchunk.ts +++ /dev/null @@ -1,350 +0,0 @@ -import { EventTarget } from 'event-target-shim'; -import xhr, { XhrUrlConfig, XhrHeaders, XhrResponse } from 'xhr'; - -const SUCCESSFUL_CHUNK_UPLOAD_CODES = [200, 201, 202, 204, 308]; -const TEMPORARY_ERROR_CODES = [408, 502, 503, 504]; // These error codes imply a chunk may be retried - -type EventName = - | 'attempt' - | 'attemptFailure' - | 'chunkSuccess' - | 'error' - | 'offline' - | 'online' - | 'progress' - | 'success'; - -type AllowedMethods = - | 'PUT' - | 'POST' - | 'PATCH'; - -export interface UpChunkOptions { - endpoint: string | ((file?: File) => Promise); - file: File; - method?: AllowedMethods; - headers?: XhrHeaders; - maxFileSize?: number; - chunkSize?: number; - attempts?: number; - delayBeforeAttempt?: number; -} - -export class UpChunk { - public endpoint: string | ((file?: File) => Promise); - public file: File; - public headers: XhrHeaders; - public method: AllowedMethods; - public chunkSize: number; - public attempts: number; - public delayBeforeAttempt: number; - - private chunk: Blob; - private chunkCount: number; - private chunkByteSize: number; - private maxFileBytes: number; - private endpointValue: string; - private totalChunks: number; - private attemptCount: number; - private offline: boolean; - private paused: boolean; - private currentXhr?: XMLHttpRequest; - - private reader: FileReader; - private eventTarget: EventTarget; - - constructor(options: UpChunkOptions) { - this.endpoint = options.endpoint; - this.file = options.file; - this.headers = options.headers || ({} as XhrHeaders); - this.method = options.method || 'PUT'; - this.chunkSize = options.chunkSize || 5120; - this.attempts = options.attempts || 5; - this.delayBeforeAttempt = options.delayBeforeAttempt || 1; - - this.maxFileBytes = (options.maxFileSize || 0) * 1024; - this.chunkCount = 0; - this.chunkByteSize = this.chunkSize * 1024; - this.totalChunks = Math.ceil(this.file.size / this.chunkByteSize); - this.attemptCount = 0; - this.offline = false; - this.paused = false; - - this.reader = new FileReader(); - this.eventTarget = new EventTarget(); - - this.validateOptions(); - this.getEndpoint().then(() => this.sendChunks()); - - // restart sync when back online - // trigger events when offline/back online - if (typeof(window) !== 'undefined') { - window.addEventListener('online', () => { - if (!this.offline) { - return; - } - - this.offline = false; - this.dispatch('online'); - this.sendChunks(); - }); - - window.addEventListener('offline', () => { - this.offline = true; - this.dispatch('offline'); - }); - } - } - - /** - * Subscribe to an event - */ - public on(eventName: EventName, fn: (event: CustomEvent) => void) { - this.eventTarget.addEventListener(eventName, fn); - } - - public abort() { - this.pause(); - this.currentXhr?.abort(); - } - - public pause() { - this.paused = true; - } - - public resume() { - if (this.paused) { - this.paused = false; - - this.sendChunks(); - } - } - - /** - * Dispatch an event - */ - private dispatch(eventName: EventName, detail?: any) { - const event = new CustomEvent(eventName, { detail }); - - this.eventTarget.dispatchEvent(event); - } - - /** - * Validate options and throw errors if expectations are violated. - */ - private validateOptions() { - if ( - !this.endpoint || - (typeof this.endpoint !== 'function' && typeof this.endpoint !== 'string') - ) { - throw new TypeError( - 'endpoint must be defined as a string or a function that returns a promise' - ); - } - if (!(this.file instanceof File)) { - throw new TypeError('file must be a File object'); - } - if (this.headers && typeof this.headers !== 'object') { - throw new TypeError('headers must be null or an object'); - } - if ( - this.chunkSize && - (typeof this.chunkSize !== 'number' || - this.chunkSize <= 0 || - this.chunkSize % 256 !== 0) - ) { - throw new TypeError( - 'chunkSize must be a positive number in multiples of 256' - ); - } - if (this.maxFileBytes > 0 && this.maxFileBytes < this.file.size) { - throw new Error( - `file size exceeds maximum (${this.file.size} > ${this.maxFileBytes})` - ); - } - if ( - this.attempts && - (typeof this.attempts !== 'number' || this.attempts <= 0) - ) { - throw new TypeError('retries must be a positive number'); - } - if ( - this.delayBeforeAttempt && - (typeof this.delayBeforeAttempt !== 'number' || - this.delayBeforeAttempt < 0) - ) { - throw new TypeError('delayBeforeAttempt must be a positive number'); - } - } - - /** - * Endpoint can either be a URL or a function that returns a promise that resolves to a string. - */ - private getEndpoint() { - if (typeof this.endpoint === 'string') { - this.endpointValue = this.endpoint; - return Promise.resolve(this.endpoint); - } - - return this.endpoint(this.file).then((value) => { - this.endpointValue = value; - return this.endpointValue; - }); - } - - /** - * Get portion of the file of x bytes corresponding to chunkSize - */ - private getChunk() { - return new Promise((resolve) => { - // Since we start with 0-chunkSize for the range, we need to subtract 1. - const length = - this.totalChunks === 1 ? this.file.size : this.chunkByteSize; - const start = length * this.chunkCount; - - this.reader.onload = () => { - if (this.reader.result !== null) { - this.chunk = new Blob([this.reader.result], { - type: 'application/octet-stream', - }); - } - resolve(); - }; - - this.reader.readAsArrayBuffer(this.file.slice(start, start + length)); - }); - } - - private xhrPromise(options: XhrUrlConfig): Promise { - const beforeSend = (xhrObject: XMLHttpRequest) => { - xhrObject.upload.onprogress = (event: ProgressEvent) => { - const successfulPercentage = (100 / this.totalChunks) * this.chunkCount; - const chunkPercentage = (event.loaded / this.file.size) * 100; - this.dispatch('progress', successfulPercentage + chunkPercentage); - }; - }; - - return new Promise((resolve, reject) => { - this.currentXhr = xhr({ ...options, beforeSend }, (err, resp) => { - this.currentXhr = undefined; - if (err) { - return reject(err); - } - - return resolve(resp); - }); - }); - } - - /** - * Send chunk of the file with appropriate headers and add post parameters if it's last chunk - */ - private sendChunk() { - const rangeStart = this.chunkCount * this.chunkByteSize; - const rangeEnd = rangeStart + this.chunk.size - 1; - const headers = { - ...this.headers, - 'Content-Type': this.file.type, - 'Content-Range': `bytes ${rangeStart}-${rangeEnd}/${this.file.size}`, - }; - - this.dispatch('attempt', { - chunkNumber: this.chunkCount, - chunkSize: this.chunk.size, - }); - - return this.xhrPromise({ - headers, - url: this.endpointValue, - method: this.method, - body: this.chunk, - }); - } - - /** - * Called on net failure. If retry counter !== 0, retry after delayBeforeAttempt - */ - private manageRetries() { - if (this.attemptCount < this.attempts) { - setTimeout(() => this.sendChunks(), this.delayBeforeAttempt * 1000); - this.dispatch('attemptFailure', { - message: `An error occured uploading chunk ${this.chunkCount}. ${ - this.attempts - this.attemptCount - } retries left.`, - chunkNumber: this.chunkCount, - attemptsLeft: this.attempts - this.attemptCount, - }); - return; - } - - this.dispatch('error', { - message: `An error occured uploading chunk ${this.chunkCount}. No more retries, stopping upload`, - chunk: this.chunkCount, - attempts: this.attemptCount, - }); - } - - /** - * Manage the whole upload by calling getChunk & sendChunk - * handle errors & retries and dispatch events - */ - private sendChunks() { - if (this.paused || this.offline) { - return; - } - - this.getChunk() - .then(() => this.sendChunk()) - .then((res) => { - this.attemptCount = this.attemptCount + 1; - - if (SUCCESSFUL_CHUNK_UPLOAD_CODES.includes(res.statusCode)) { - this.dispatch('chunkSuccess', { - chunk: this.chunkCount, - attempts: this.attemptCount, - response: res, - }); - - this.attemptCount = 0; - this.chunkCount = this.chunkCount + 1; - - if (this.chunkCount < this.totalChunks) { - this.sendChunks(); - } else { - this.dispatch('success'); - } - - const percentProgress = Math.round( - (100 / this.totalChunks) * this.chunkCount - ); - - this.dispatch('progress', percentProgress); - } else if (TEMPORARY_ERROR_CODES.includes(res.statusCode)) { - if (this.paused || this.offline) { - return; - } - this.manageRetries(); - } else { - if (this.paused || this.offline) { - return; - } - - this.dispatch('error', { - message: `Server responded with ${res.statusCode}. Stopping upload.`, - chunkNumber: this.chunkCount, - attempts: this.attemptCount, - }); - } - }) - .catch((err) => { - if (this.paused || this.offline) { - return; - } - - // this type of error can happen after network disconnection on CORS setup - this.manageRetries(); - }); - } -} - -export const createUpload = (options: UpChunkOptions) => new UpChunk(options); diff --git a/node_modules/dom-walk/LICENCE b/node_modules/dom-walk/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/dom-walk/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/dom-walk/Makefile b/node_modules/dom-walk/Makefile deleted file mode 100644 index 132d3a3..0000000 --- a/node_modules/dom-walk/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -run: - ./node_modules/.bin/browserify-server --cwd example \ No newline at end of file diff --git a/node_modules/dom-walk/README.md b/node_modules/dom-walk/README.md deleted file mode 100644 index 9e33dd1..0000000 --- a/node_modules/dom-walk/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# dom-walk - -iteratively walk a DOM node - -## Example - -``` js -var walk = require("dom-walk") - -walk(document.body.childNodes, function (node) { - console.log("node", node) -}) -``` - -## Installation - -`npm install dom-walk` - -## Contributors - - - Raynos - -## MIT Licenced \ No newline at end of file diff --git a/node_modules/dom-walk/example/index.js b/node_modules/dom-walk/example/index.js deleted file mode 100644 index 2c8162d..0000000 --- a/node_modules/dom-walk/example/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var walk = require("../index") - -walk(document, function (node) { - console.log("node", node) -}) diff --git a/node_modules/dom-walk/index.js b/node_modules/dom-walk/index.js deleted file mode 100644 index 9c2402d..0000000 --- a/node_modules/dom-walk/index.js +++ /dev/null @@ -1,24 +0,0 @@ -var slice = Array.prototype.slice - -module.exports = iterativelyWalk - -function iterativelyWalk(nodes, cb) { - if (!('length' in nodes)) { - nodes = [nodes] - } - - nodes = slice.call(nodes) - - while(nodes.length) { - var node = nodes.shift(), - ret = cb(node) - - if (ret) { - return ret - } - - if (node.childNodes && node.childNodes.length) { - nodes = slice.call(node.childNodes).concat(nodes) - } - } -} diff --git a/node_modules/dom-walk/package.json b/node_modules/dom-walk/package.json deleted file mode 100644 index e2685be..0000000 --- a/node_modules/dom-walk/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "_from": "dom-walk@^0.1.0", - "_id": "dom-walk@0.1.2", - "_inBundle": false, - "_integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==", - "_location": "/dom-walk", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "dom-walk@^0.1.0", - "name": "dom-walk", - "escapedName": "dom-walk", - "rawSpec": "^0.1.0", - "saveSpec": null, - "fetchSpec": "^0.1.0" - }, - "_requiredBy": [ - "/min-document" - ], - "_resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "_shasum": "0c548bef048f4d1f2a97249002236060daa3fd84", - "_spec": "dom-walk@^0.1.0", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/min-document", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/dom-walk/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "iteratively walk a DOM node", - "devDependencies": { - "budo": "11.6.3" - }, - "homepage": "https://github.com/Raynos/dom-walk", - "keywords": [], - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/dom-walk/raw/master/LICENSE" - } - ], - "main": "index", - "name": "dom-walk", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/dom-walk.git" - }, - "scripts": { - "example": "budo example/index.js" - }, - "version": "0.1.2" -} diff --git a/node_modules/event-target-shim/LICENSE b/node_modules/event-target-shim/LICENSE deleted file mode 100644 index c39e694..0000000 --- a/node_modules/event-target-shim/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Toru Nagashima - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/node_modules/event-target-shim/README.md b/node_modules/event-target-shim/README.md deleted file mode 100644 index 4fab4eb..0000000 --- a/node_modules/event-target-shim/README.md +++ /dev/null @@ -1,267 +0,0 @@ -# event-target-shim - -[![npm version](https://img.shields.io/npm/v/event-target-shim.svg)](https://www.npmjs.com/package/event-target-shim) -[![Downloads/month](https://img.shields.io/npm/dm/event-target-shim.svg)](http://www.npmtrends.com/event-target-shim) -[![Build Status](https://travis-ci.org/mysticatea/event-target-shim.svg?branch=master)](https://travis-ci.org/mysticatea/event-target-shim) -[![Coverage Status](https://codecov.io/gh/mysticatea/event-target-shim/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/event-target-shim) -[![Dependency Status](https://david-dm.org/mysticatea/event-target-shim.svg)](https://david-dm.org/mysticatea/event-target-shim) - -An implementation of [WHATWG EventTarget interface](https://dom.spec.whatwg.org/#interface-eventtarget), plus few extensions. - -- This provides `EventTarget` constructor that can inherit for your custom object. -- This provides an utility that defines properties of attribute listeners (e.g. `obj.onclick`). - -```js -import {EventTarget, defineEventAttribute} from "event-target-shim" - -class Foo extends EventTarget { - // ... -} - -// Define `foo.onhello` property. -defineEventAttribute(Foo.prototype, "hello") - -// Use -const foo = new Foo() -foo.addEventListener("hello", e => console.log("hello", e)) -foo.onhello = e => console.log("onhello:", e) -foo.dispatchEvent(new CustomEvent("hello")) -``` - -## 💿 Installation - -Use [npm](https://www.npmjs.com/) to install then use a bundler. - -``` -npm install event-target-shim -``` - -Or download from [`dist` directory](./dist). - -- [dist/event-target-shim.mjs](dist/event-target-shim.mjs) ... ES modules version. -- [dist/event-target-shim.js](dist/event-target-shim.js) ... Common JS version. -- [dist/event-target-shim.umd.js](dist/event-target-shim.umd.js) ... UMD (Universal Module Definition) version. This is transpiled by [Babel](https://babeljs.io/) for IE 11. - -## 📖 Usage - -```js -import {EventTarget, defineEventAttribute} from "event-target-shim" -// or -const {EventTarget, defineEventAttribute} = require("event-target-shim") - -// or UMD version defines a global variable: -const {EventTarget, defineEventAttribute} = window.EventTargetShim -``` - -### EventTarget - -> https://dom.spec.whatwg.org/#interface-eventtarget - -#### eventTarget.addEventListener(type, callback, options) - -Register an event listener. - -- `type` is a string. This is the event name to register. -- `callback` is a function. This is the event listener to register. -- `options` is a boolean or an object `{ capture?: boolean, passive?: boolean, once?: boolean }`. If this is a boolean, it's same meaning as `{ capture: options }`. - - `capture` is the flag to register the event listener for capture phase. - - `passive` is the flag to ignore `event.preventDefault()` method in the event listener. - - `once` is the flag to remove the event listener automatically after the first call. - -#### eventTarget.removeEventListener(type, callback, options) - -Unregister an event listener. - -- `type` is a string. This is the event name to unregister. -- `callback` is a function. This is the event listener to unregister. -- `options` is a boolean or an object `{ capture?: boolean }`. If this is a boolean, it's same meaning as `{ capture: options }`. - - `capture` is the flag to register the event listener for capture phase. - -#### eventTarget.dispatchEvent(event) - -Dispatch an event. - -- `event` is a [Event](https://dom.spec.whatwg.org/#event) object or an object `{ type: string, [key: string]: any }`. The latter is non-standard but useful. In both cases, listeners receive the event as implementing [Event](https://dom.spec.whatwg.org/#event) interface. - -### defineEventAttribute(proto, type) - -Define an event attribute (e.g. `onclick`) to `proto`. This is non-standard. - -- `proto` is an object (assuming it's a prototype object). This function defines a getter/setter pair for the event attribute. -- `type` is a string. This is the event name to define. - -For example: - -```js -class AbortSignal extends EventTarget { - constructor() { - this.aborted = false - } -} -// Define `onabort` property. -defineEventAttribute(AbortSignal.prototype, "abort") -``` - -### EventTarget(types) - -Define a custom `EventTarget` class with event attributes. This is non-standard. - -- `types` is a string or an array of strings. This is the event name to define. - -For example: - -```js -// This has `onabort` property. -class AbortSignal extends EventTarget("abort") { - constructor() { - this.aborted = false - } -} -``` - -## 📚 Examples - -### ES2015 and later - -> https://jsfiddle.net/636vea92/ - -```js -const {EventTarget, defineEventAttribute} = EventTargetShim - -// Define a derived class. -class Foo extends EventTarget { - // ... -} - -// Define `foo.onhello` property. -defineEventAttribute(Foo.prototype, "hello") - -// Register event listeners. -const foo = new Foo() -foo.addEventListener("hello", (e) => { - console.log("hello", e) -}) -foo.onhello = (e) => { - console.log("onhello", e) -} - -// Dispatching events -foo.dispatchEvent(new CustomEvent("hello", { detail: "detail" })) -``` - -### Typescript - -Currently typescript does not support type mutation by method, therefore the previous example will **not work** without the following modifications: - -#### Working example #1 -```ts -import { EventTarget, defineEventAttribute } from "event-target-shim"; - -// Define a derived class. -class Foo extends EventTarget<"onhello"> { - // ... -} - -// Define `foo.onhello` property. -defineEventAttribute(Foo.prototype, "hello") - -// Register event listeners. -const foo = new Foo() -foo.addEventListener("hello", (e) => { - console.log("hello", e) -}) -foo.onhello = (e) => { - console.log("onhello", e) -} - -// Dispatching events -foo.dispatchEvent(new CustomEvent("hello", { detail: "detail" })) -``` - -In the future, if typescript adds support to string literal mutation (joining, slicing and etc.), it should be possible to automatically infer `onhello` type from `hello`. However, until then you are stuck with this: - -#### Working example #2 -```ts -import { EventTarget, defineEventAttribute } from "event-target-shim"; - -// Define a derived class. -class Foo extends EventTarget<"onhello">("hello") { - // ... -} - -// Register event listeners. -const foo = new Foo() -foo.addEventListener("hello", (e) => { - console.log("hello", e) -}) -foo.onhello = (e) => { - console.log("onhello", e) -} - -// Dispatching events -foo.dispatchEvent(new CustomEvent("hello", { detail: "detail" })) -``` - -### ES5 - -> https://jsfiddle.net/522zc9de/ - -```js -// Define a derived class. -function Foo() { - EventTarget.call(this) -} -Foo.prototype = Object.create(EventTarget.prototype, { - constructor: { value: Foo, configurable: true, writable: true } - // ... -}) - -// Define `foo.onhello` property. -defineEventAttribute(Foo.prototype, "hello") - -// Register event listeners. -var foo = new Foo() -foo.addEventListener("hello", function(e) { - console.log("hello", e) -}) -foo.onhello = function(e) { - console.log("onhello", e) -} - -// Dispatching events -function isSupportEventConstrucor() { // IE does not support. - try { - new CusomEvent("hello") - return true - } catch (_err) { - return false - } -} -if (isSupportEventConstrucor()) { - foo.dispatchEvent(new CustomEvent("hello", { detail: "detail" })) -} else { - var e = document.createEvent("CustomEvent") - e.initCustomEvent("hello", false, false, "detail") - foo.dispatchEvent(e) -} -``` - -## 📰 Changelog - -- See [GitHub releases](https://github.com/mysticatea/event-target-shim/releases). - -## 🍻 Contributing - -Contributing is welcome ❤️ - -Please use GitHub issues/PRs. - -### Development tools - -- `npm install` installs dependencies for development. -- `npm test` runs tests and measures code coverage. -- `npm run clean` removes temporary files of tests. -- `npm run coverage` opens code coverage of the previous test with your default browser. -- `npm run lint` runs ESLint. -- `npm run build` generates `dist` codes. -- `npm run watch` runs tests on each file change. diff --git a/node_modules/event-target-shim/dist/event-target-shim.js b/node_modules/event-target-shim/dist/event-target-shim.js deleted file mode 100644 index 53ce220..0000000 --- a/node_modules/event-target-shim/dist/event-target-shim.js +++ /dev/null @@ -1,871 +0,0 @@ -/** - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -/** - * @typedef {object} PrivateData - * @property {EventTarget} eventTarget The event target. - * @property {{type:string}} event The original event object. - * @property {number} eventPhase The current event phase. - * @property {EventTarget|null} currentTarget The current event target. - * @property {boolean} canceled The flag to prevent default. - * @property {boolean} stopped The flag to stop propagation. - * @property {boolean} immediateStopped The flag to stop propagation immediately. - * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null. - * @property {number} timeStamp The unix time. - * @private - */ - -/** - * Private data for event wrappers. - * @type {WeakMap} - * @private - */ -const privateData = new WeakMap(); - -/** - * Cache for wrapper classes. - * @type {WeakMap} - * @private - */ -const wrappers = new WeakMap(); - -/** - * Get private data. - * @param {Event} event The event object to get private data. - * @returns {PrivateData} The private data of the event. - * @private - */ -function pd(event) { - const retv = privateData.get(event); - console.assert( - retv != null, - "'this' is expected an Event object, but got", - event - ); - return retv -} - -/** - * https://dom.spec.whatwg.org/#set-the-canceled-flag - * @param data {PrivateData} private data. - */ -function setCancelFlag(data) { - if (data.passiveListener != null) { - if ( - typeof console !== "undefined" && - typeof console.error === "function" - ) { - console.error( - "Unable to preventDefault inside passive event listener invocation.", - data.passiveListener - ); - } - return - } - if (!data.event.cancelable) { - return - } - - data.canceled = true; - if (typeof data.event.preventDefault === "function") { - data.event.preventDefault(); - } -} - -/** - * @see https://dom.spec.whatwg.org/#interface-event - * @private - */ -/** - * The event wrapper. - * @constructor - * @param {EventTarget} eventTarget The event target of this dispatching. - * @param {Event|{type:string}} event The original event to wrap. - */ -function Event(eventTarget, event) { - privateData.set(this, { - eventTarget, - event, - eventPhase: 2, - currentTarget: eventTarget, - canceled: false, - stopped: false, - immediateStopped: false, - passiveListener: null, - timeStamp: event.timeStamp || Date.now(), - }); - - // https://heycam.github.io/webidl/#Unforgeable - Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); - - // Define accessors - const keys = Object.keys(event); - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - if (!(key in this)) { - Object.defineProperty(this, key, defineRedirectDescriptor(key)); - } - } -} - -// Should be enumerable, but class methods are not enumerable. -Event.prototype = { - /** - * The type of this event. - * @type {string} - */ - get type() { - return pd(this).event.type - }, - - /** - * The target of this event. - * @type {EventTarget} - */ - get target() { - return pd(this).eventTarget - }, - - /** - * The target of this event. - * @type {EventTarget} - */ - get currentTarget() { - return pd(this).currentTarget - }, - - /** - * @returns {EventTarget[]} The composed path of this event. - */ - composedPath() { - const currentTarget = pd(this).currentTarget; - if (currentTarget == null) { - return [] - } - return [currentTarget] - }, - - /** - * Constant of NONE. - * @type {number} - */ - get NONE() { - return 0 - }, - - /** - * Constant of CAPTURING_PHASE. - * @type {number} - */ - get CAPTURING_PHASE() { - return 1 - }, - - /** - * Constant of AT_TARGET. - * @type {number} - */ - get AT_TARGET() { - return 2 - }, - - /** - * Constant of BUBBLING_PHASE. - * @type {number} - */ - get BUBBLING_PHASE() { - return 3 - }, - - /** - * The target of this event. - * @type {number} - */ - get eventPhase() { - return pd(this).eventPhase - }, - - /** - * Stop event bubbling. - * @returns {void} - */ - stopPropagation() { - const data = pd(this); - - data.stopped = true; - if (typeof data.event.stopPropagation === "function") { - data.event.stopPropagation(); - } - }, - - /** - * Stop event bubbling. - * @returns {void} - */ - stopImmediatePropagation() { - const data = pd(this); - - data.stopped = true; - data.immediateStopped = true; - if (typeof data.event.stopImmediatePropagation === "function") { - data.event.stopImmediatePropagation(); - } - }, - - /** - * The flag to be bubbling. - * @type {boolean} - */ - get bubbles() { - return Boolean(pd(this).event.bubbles) - }, - - /** - * The flag to be cancelable. - * @type {boolean} - */ - get cancelable() { - return Boolean(pd(this).event.cancelable) - }, - - /** - * Cancel this event. - * @returns {void} - */ - preventDefault() { - setCancelFlag(pd(this)); - }, - - /** - * The flag to indicate cancellation state. - * @type {boolean} - */ - get defaultPrevented() { - return pd(this).canceled - }, - - /** - * The flag to be composed. - * @type {boolean} - */ - get composed() { - return Boolean(pd(this).event.composed) - }, - - /** - * The unix time of this event. - * @type {number} - */ - get timeStamp() { - return pd(this).timeStamp - }, - - /** - * The target of this event. - * @type {EventTarget} - * @deprecated - */ - get srcElement() { - return pd(this).eventTarget - }, - - /** - * The flag to stop event bubbling. - * @type {boolean} - * @deprecated - */ - get cancelBubble() { - return pd(this).stopped - }, - set cancelBubble(value) { - if (!value) { - return - } - const data = pd(this); - - data.stopped = true; - if (typeof data.event.cancelBubble === "boolean") { - data.event.cancelBubble = true; - } - }, - - /** - * The flag to indicate cancellation state. - * @type {boolean} - * @deprecated - */ - get returnValue() { - return !pd(this).canceled - }, - set returnValue(value) { - if (!value) { - setCancelFlag(pd(this)); - } - }, - - /** - * Initialize this event object. But do nothing under event dispatching. - * @param {string} type The event type. - * @param {boolean} [bubbles=false] The flag to be possible to bubble up. - * @param {boolean} [cancelable=false] The flag to be possible to cancel. - * @deprecated - */ - initEvent() { - // Do nothing. - }, -}; - -// `constructor` is not enumerable. -Object.defineProperty(Event.prototype, "constructor", { - value: Event, - configurable: true, - writable: true, -}); - -// Ensure `event instanceof window.Event` is `true`. -if (typeof window !== "undefined" && typeof window.Event !== "undefined") { - Object.setPrototypeOf(Event.prototype, window.Event.prototype); - - // Make association for wrappers. - wrappers.set(window.Event.prototype, Event); -} - -/** - * Get the property descriptor to redirect a given property. - * @param {string} key Property name to define property descriptor. - * @returns {PropertyDescriptor} The property descriptor to redirect the property. - * @private - */ -function defineRedirectDescriptor(key) { - return { - get() { - return pd(this).event[key] - }, - set(value) { - pd(this).event[key] = value; - }, - configurable: true, - enumerable: true, - } -} - -/** - * Get the property descriptor to call a given method property. - * @param {string} key Property name to define property descriptor. - * @returns {PropertyDescriptor} The property descriptor to call the method property. - * @private - */ -function defineCallDescriptor(key) { - return { - value() { - const event = pd(this).event; - return event[key].apply(event, arguments) - }, - configurable: true, - enumerable: true, - } -} - -/** - * Define new wrapper class. - * @param {Function} BaseEvent The base wrapper class. - * @param {Object} proto The prototype of the original event. - * @returns {Function} The defined wrapper class. - * @private - */ -function defineWrapper(BaseEvent, proto) { - const keys = Object.keys(proto); - if (keys.length === 0) { - return BaseEvent - } - - /** CustomEvent */ - function CustomEvent(eventTarget, event) { - BaseEvent.call(this, eventTarget, event); - } - - CustomEvent.prototype = Object.create(BaseEvent.prototype, { - constructor: { value: CustomEvent, configurable: true, writable: true }, - }); - - // Define accessors. - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - if (!(key in BaseEvent.prototype)) { - const descriptor = Object.getOwnPropertyDescriptor(proto, key); - const isFunc = typeof descriptor.value === "function"; - Object.defineProperty( - CustomEvent.prototype, - key, - isFunc - ? defineCallDescriptor(key) - : defineRedirectDescriptor(key) - ); - } - } - - return CustomEvent -} - -/** - * Get the wrapper class of a given prototype. - * @param {Object} proto The prototype of the original event to get its wrapper. - * @returns {Function} The wrapper class. - * @private - */ -function getWrapper(proto) { - if (proto == null || proto === Object.prototype) { - return Event - } - - let wrapper = wrappers.get(proto); - if (wrapper == null) { - wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); - wrappers.set(proto, wrapper); - } - return wrapper -} - -/** - * Wrap a given event to management a dispatching. - * @param {EventTarget} eventTarget The event target of this dispatching. - * @param {Object} event The event to wrap. - * @returns {Event} The wrapper instance. - * @private - */ -function wrapEvent(eventTarget, event) { - const Wrapper = getWrapper(Object.getPrototypeOf(event)); - return new Wrapper(eventTarget, event) -} - -/** - * Get the immediateStopped flag of a given event. - * @param {Event} event The event to get. - * @returns {boolean} The flag to stop propagation immediately. - * @private - */ -function isStopped(event) { - return pd(event).immediateStopped -} - -/** - * Set the current event phase of a given event. - * @param {Event} event The event to set current target. - * @param {number} eventPhase New event phase. - * @returns {void} - * @private - */ -function setEventPhase(event, eventPhase) { - pd(event).eventPhase = eventPhase; -} - -/** - * Set the current target of a given event. - * @param {Event} event The event to set current target. - * @param {EventTarget|null} currentTarget New current target. - * @returns {void} - * @private - */ -function setCurrentTarget(event, currentTarget) { - pd(event).currentTarget = currentTarget; -} - -/** - * Set a passive listener of a given event. - * @param {Event} event The event to set current target. - * @param {Function|null} passiveListener New passive listener. - * @returns {void} - * @private - */ -function setPassiveListener(event, passiveListener) { - pd(event).passiveListener = passiveListener; -} - -/** - * @typedef {object} ListenerNode - * @property {Function} listener - * @property {1|2|3} listenerType - * @property {boolean} passive - * @property {boolean} once - * @property {ListenerNode|null} next - * @private - */ - -/** - * @type {WeakMap>} - * @private - */ -const listenersMap = new WeakMap(); - -// Listener types -const CAPTURE = 1; -const BUBBLE = 2; -const ATTRIBUTE = 3; - -/** - * Check whether a given value is an object or not. - * @param {any} x The value to check. - * @returns {boolean} `true` if the value is an object. - */ -function isObject(x) { - return x !== null && typeof x === "object" //eslint-disable-line no-restricted-syntax -} - -/** - * Get listeners. - * @param {EventTarget} eventTarget The event target to get. - * @returns {Map} The listeners. - * @private - */ -function getListeners(eventTarget) { - const listeners = listenersMap.get(eventTarget); - if (listeners == null) { - throw new TypeError( - "'this' is expected an EventTarget object, but got another value." - ) - } - return listeners -} - -/** - * Get the property descriptor for the event attribute of a given event. - * @param {string} eventName The event name to get property descriptor. - * @returns {PropertyDescriptor} The property descriptor. - * @private - */ -function defineEventAttributeDescriptor(eventName) { - return { - get() { - const listeners = getListeners(this); - let node = listeners.get(eventName); - while (node != null) { - if (node.listenerType === ATTRIBUTE) { - return node.listener - } - node = node.next; - } - return null - }, - - set(listener) { - if (typeof listener !== "function" && !isObject(listener)) { - listener = null; // eslint-disable-line no-param-reassign - } - const listeners = getListeners(this); - - // Traverse to the tail while removing old value. - let prev = null; - let node = listeners.get(eventName); - while (node != null) { - if (node.listenerType === ATTRIBUTE) { - // Remove old value. - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - } else { - prev = node; - } - - node = node.next; - } - - // Add new value. - if (listener !== null) { - const newNode = { - listener, - listenerType: ATTRIBUTE, - passive: false, - once: false, - next: null, - }; - if (prev === null) { - listeners.set(eventName, newNode); - } else { - prev.next = newNode; - } - } - }, - configurable: true, - enumerable: true, - } -} - -/** - * Define an event attribute (e.g. `eventTarget.onclick`). - * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite. - * @param {string} eventName The event name to define. - * @returns {void} - */ -function defineEventAttribute(eventTargetPrototype, eventName) { - Object.defineProperty( - eventTargetPrototype, - `on${eventName}`, - defineEventAttributeDescriptor(eventName) - ); -} - -/** - * Define a custom EventTarget with event attributes. - * @param {string[]} eventNames Event names for event attributes. - * @returns {EventTarget} The custom EventTarget. - * @private - */ -function defineCustomEventTarget(eventNames) { - /** CustomEventTarget */ - function CustomEventTarget() { - EventTarget.call(this); - } - - CustomEventTarget.prototype = Object.create(EventTarget.prototype, { - constructor: { - value: CustomEventTarget, - configurable: true, - writable: true, - }, - }); - - for (let i = 0; i < eventNames.length; ++i) { - defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); - } - - return CustomEventTarget -} - -/** - * EventTarget. - * - * - This is constructor if no arguments. - * - This is a function which returns a CustomEventTarget constructor if there are arguments. - * - * For example: - * - * class A extends EventTarget {} - * class B extends EventTarget("message") {} - * class C extends EventTarget("message", "error") {} - * class D extends EventTarget(["message", "error"]) {} - */ -function EventTarget() { - /*eslint-disable consistent-return */ - if (this instanceof EventTarget) { - listenersMap.set(this, new Map()); - return - } - if (arguments.length === 1 && Array.isArray(arguments[0])) { - return defineCustomEventTarget(arguments[0]) - } - if (arguments.length > 0) { - const types = new Array(arguments.length); - for (let i = 0; i < arguments.length; ++i) { - types[i] = arguments[i]; - } - return defineCustomEventTarget(types) - } - throw new TypeError("Cannot call a class as a function") - /*eslint-enable consistent-return */ -} - -// Should be enumerable, but class methods are not enumerable. -EventTarget.prototype = { - /** - * Add a given listener to this event target. - * @param {string} eventName The event name to add. - * @param {Function} listener The listener to add. - * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. - * @returns {void} - */ - addEventListener(eventName, listener, options) { - if (listener == null) { - return - } - if (typeof listener !== "function" && !isObject(listener)) { - throw new TypeError("'listener' should be a function or an object.") - } - - const listeners = getListeners(this); - const optionsIsObj = isObject(options); - const capture = optionsIsObj - ? Boolean(options.capture) - : Boolean(options); - const listenerType = capture ? CAPTURE : BUBBLE; - const newNode = { - listener, - listenerType, - passive: optionsIsObj && Boolean(options.passive), - once: optionsIsObj && Boolean(options.once), - next: null, - }; - - // Set it as the first node if the first node is null. - let node = listeners.get(eventName); - if (node === undefined) { - listeners.set(eventName, newNode); - return - } - - // Traverse to the tail while checking duplication.. - let prev = null; - while (node != null) { - if ( - node.listener === listener && - node.listenerType === listenerType - ) { - // Should ignore duplication. - return - } - prev = node; - node = node.next; - } - - // Add it. - prev.next = newNode; - }, - - /** - * Remove a given listener from this event target. - * @param {string} eventName The event name to remove. - * @param {Function} listener The listener to remove. - * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. - * @returns {void} - */ - removeEventListener(eventName, listener, options) { - if (listener == null) { - return - } - - const listeners = getListeners(this); - const capture = isObject(options) - ? Boolean(options.capture) - : Boolean(options); - const listenerType = capture ? CAPTURE : BUBBLE; - - let prev = null; - let node = listeners.get(eventName); - while (node != null) { - if ( - node.listener === listener && - node.listenerType === listenerType - ) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - return - } - - prev = node; - node = node.next; - } - }, - - /** - * Dispatch a given event. - * @param {Event|{type:string}} event The event to dispatch. - * @returns {boolean} `false` if canceled. - */ - dispatchEvent(event) { - if (event == null || typeof event.type !== "string") { - throw new TypeError('"event.type" should be a string.') - } - - // If listeners aren't registered, terminate. - const listeners = getListeners(this); - const eventName = event.type; - let node = listeners.get(eventName); - if (node == null) { - return true - } - - // Since we cannot rewrite several properties, so wrap object. - const wrappedEvent = wrapEvent(this, event); - - // This doesn't process capturing phase and bubbling phase. - // This isn't participating in a tree. - let prev = null; - while (node != null) { - // Remove this listener if it's once - if (node.once) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - } else { - prev = node; - } - - // Call this listener - setPassiveListener( - wrappedEvent, - node.passive ? node.listener : null - ); - if (typeof node.listener === "function") { - try { - node.listener.call(this, wrappedEvent); - } catch (err) { - if ( - typeof console !== "undefined" && - typeof console.error === "function" - ) { - console.error(err); - } - } - } else if ( - node.listenerType !== ATTRIBUTE && - typeof node.listener.handleEvent === "function" - ) { - node.listener.handleEvent(wrappedEvent); - } - - // Break if `event.stopImmediatePropagation` was called. - if (isStopped(wrappedEvent)) { - break - } - - node = node.next; - } - setPassiveListener(wrappedEvent, null); - setEventPhase(wrappedEvent, 0); - setCurrentTarget(wrappedEvent, null); - - return !wrappedEvent.defaultPrevented - }, -}; - -// `constructor` is not enumerable. -Object.defineProperty(EventTarget.prototype, "constructor", { - value: EventTarget, - configurable: true, - writable: true, -}); - -// Ensure `eventTarget instanceof window.EventTarget` is `true`. -if ( - typeof window !== "undefined" && - typeof window.EventTarget !== "undefined" -) { - Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); -} - -exports.defineEventAttribute = defineEventAttribute; -exports.EventTarget = EventTarget; -exports.default = EventTarget; - -module.exports = EventTarget -module.exports.EventTarget = module.exports["default"] = EventTarget -module.exports.defineEventAttribute = defineEventAttribute -//# sourceMappingURL=event-target-shim.js.map diff --git a/node_modules/event-target-shim/dist/event-target-shim.js.map b/node_modules/event-target-shim/dist/event-target-shim.js.map deleted file mode 100644 index 76c67e7..0000000 --- a/node_modules/event-target-shim/dist/event-target-shim.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"event-target-shim.js.map","sources":["../src/event.mjs","../src/event-target.mjs"],"sourcesContent":["/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,WAAW,GAAG,IAAI,OAAO,GAAE;;;;;;;AAOjC,MAAM,QAAQ,GAAG,IAAI,OAAO,GAAE;;;;;;;;AAQ9B,SAAS,EAAE,CAAC,KAAK,EAAE;IACf,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,EAAC;IACnC,OAAO,CAAC,MAAM;QACV,IAAI,IAAI,IAAI;QACZ,6CAA6C;QAC7C,KAAK;MACR;IACD,OAAO,IAAI;CACd;;;;;;AAMD,SAAS,aAAa,CAAC,IAAI,EAAE;IACzB,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE;QAC9B;YACI,OAAO,OAAO,KAAK,WAAW;YAC9B,OAAO,OAAO,CAAC,KAAK,KAAK,UAAU;UACrC;YACE,OAAO,CAAC,KAAK;gBACT,oEAAoE;gBACpE,IAAI,CAAC,eAAe;cACvB;SACJ;QACD,MAAM;KACT;IACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;QACxB,MAAM;KACT;;IAED,IAAI,CAAC,QAAQ,GAAG,KAAI;IACpB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,UAAU,EAAE;QACjD,IAAI,CAAC,KAAK,CAAC,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AC,QAAQ,CAAC,WAAW,CAAC,YAAY,EAAC;aAC1C;;;YAGD,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE;gBACzB,KAAK;aACR;;YAED,IAAI,GAAG,IAAI,CAAC,KAAI;SACnB;QACD,kBAAkB,CAAC,YAAY,EAAE,IAAI,EAAC;QACtC,aAAa,CAAC,YAAY,EAAE,CAAC,EAAC;QAC9B,gBAAgB,CAAC,YAAY,EAAE,IAAI,EAAC;;QAEpC,OAAO,CAAC,YAAY,CAAC,gBAAgB;KACxC;EACJ;;;AAGD,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE;IACxD,KAAK,EAAE,WAAW;IAClB,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI;CACjB,EAAC;;;AAGF;IACI,OAAO,MAAM,KAAK,WAAW;IAC7B,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW;EAC3C;IACE,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EAAC;CAC7E;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/event-target-shim/dist/event-target-shim.mjs b/node_modules/event-target-shim/dist/event-target-shim.mjs deleted file mode 100644 index 114f3a1..0000000 --- a/node_modules/event-target-shim/dist/event-target-shim.mjs +++ /dev/null @@ -1,862 +0,0 @@ -/** - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ -/** - * @typedef {object} PrivateData - * @property {EventTarget} eventTarget The event target. - * @property {{type:string}} event The original event object. - * @property {number} eventPhase The current event phase. - * @property {EventTarget|null} currentTarget The current event target. - * @property {boolean} canceled The flag to prevent default. - * @property {boolean} stopped The flag to stop propagation. - * @property {boolean} immediateStopped The flag to stop propagation immediately. - * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null. - * @property {number} timeStamp The unix time. - * @private - */ - -/** - * Private data for event wrappers. - * @type {WeakMap} - * @private - */ -const privateData = new WeakMap(); - -/** - * Cache for wrapper classes. - * @type {WeakMap} - * @private - */ -const wrappers = new WeakMap(); - -/** - * Get private data. - * @param {Event} event The event object to get private data. - * @returns {PrivateData} The private data of the event. - * @private - */ -function pd(event) { - const retv = privateData.get(event); - console.assert( - retv != null, - "'this' is expected an Event object, but got", - event - ); - return retv -} - -/** - * https://dom.spec.whatwg.org/#set-the-canceled-flag - * @param data {PrivateData} private data. - */ -function setCancelFlag(data) { - if (data.passiveListener != null) { - if ( - typeof console !== "undefined" && - typeof console.error === "function" - ) { - console.error( - "Unable to preventDefault inside passive event listener invocation.", - data.passiveListener - ); - } - return - } - if (!data.event.cancelable) { - return - } - - data.canceled = true; - if (typeof data.event.preventDefault === "function") { - data.event.preventDefault(); - } -} - -/** - * @see https://dom.spec.whatwg.org/#interface-event - * @private - */ -/** - * The event wrapper. - * @constructor - * @param {EventTarget} eventTarget The event target of this dispatching. - * @param {Event|{type:string}} event The original event to wrap. - */ -function Event(eventTarget, event) { - privateData.set(this, { - eventTarget, - event, - eventPhase: 2, - currentTarget: eventTarget, - canceled: false, - stopped: false, - immediateStopped: false, - passiveListener: null, - timeStamp: event.timeStamp || Date.now(), - }); - - // https://heycam.github.io/webidl/#Unforgeable - Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); - - // Define accessors - const keys = Object.keys(event); - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - if (!(key in this)) { - Object.defineProperty(this, key, defineRedirectDescriptor(key)); - } - } -} - -// Should be enumerable, but class methods are not enumerable. -Event.prototype = { - /** - * The type of this event. - * @type {string} - */ - get type() { - return pd(this).event.type - }, - - /** - * The target of this event. - * @type {EventTarget} - */ - get target() { - return pd(this).eventTarget - }, - - /** - * The target of this event. - * @type {EventTarget} - */ - get currentTarget() { - return pd(this).currentTarget - }, - - /** - * @returns {EventTarget[]} The composed path of this event. - */ - composedPath() { - const currentTarget = pd(this).currentTarget; - if (currentTarget == null) { - return [] - } - return [currentTarget] - }, - - /** - * Constant of NONE. - * @type {number} - */ - get NONE() { - return 0 - }, - - /** - * Constant of CAPTURING_PHASE. - * @type {number} - */ - get CAPTURING_PHASE() { - return 1 - }, - - /** - * Constant of AT_TARGET. - * @type {number} - */ - get AT_TARGET() { - return 2 - }, - - /** - * Constant of BUBBLING_PHASE. - * @type {number} - */ - get BUBBLING_PHASE() { - return 3 - }, - - /** - * The target of this event. - * @type {number} - */ - get eventPhase() { - return pd(this).eventPhase - }, - - /** - * Stop event bubbling. - * @returns {void} - */ - stopPropagation() { - const data = pd(this); - - data.stopped = true; - if (typeof data.event.stopPropagation === "function") { - data.event.stopPropagation(); - } - }, - - /** - * Stop event bubbling. - * @returns {void} - */ - stopImmediatePropagation() { - const data = pd(this); - - data.stopped = true; - data.immediateStopped = true; - if (typeof data.event.stopImmediatePropagation === "function") { - data.event.stopImmediatePropagation(); - } - }, - - /** - * The flag to be bubbling. - * @type {boolean} - */ - get bubbles() { - return Boolean(pd(this).event.bubbles) - }, - - /** - * The flag to be cancelable. - * @type {boolean} - */ - get cancelable() { - return Boolean(pd(this).event.cancelable) - }, - - /** - * Cancel this event. - * @returns {void} - */ - preventDefault() { - setCancelFlag(pd(this)); - }, - - /** - * The flag to indicate cancellation state. - * @type {boolean} - */ - get defaultPrevented() { - return pd(this).canceled - }, - - /** - * The flag to be composed. - * @type {boolean} - */ - get composed() { - return Boolean(pd(this).event.composed) - }, - - /** - * The unix time of this event. - * @type {number} - */ - get timeStamp() { - return pd(this).timeStamp - }, - - /** - * The target of this event. - * @type {EventTarget} - * @deprecated - */ - get srcElement() { - return pd(this).eventTarget - }, - - /** - * The flag to stop event bubbling. - * @type {boolean} - * @deprecated - */ - get cancelBubble() { - return pd(this).stopped - }, - set cancelBubble(value) { - if (!value) { - return - } - const data = pd(this); - - data.stopped = true; - if (typeof data.event.cancelBubble === "boolean") { - data.event.cancelBubble = true; - } - }, - - /** - * The flag to indicate cancellation state. - * @type {boolean} - * @deprecated - */ - get returnValue() { - return !pd(this).canceled - }, - set returnValue(value) { - if (!value) { - setCancelFlag(pd(this)); - } - }, - - /** - * Initialize this event object. But do nothing under event dispatching. - * @param {string} type The event type. - * @param {boolean} [bubbles=false] The flag to be possible to bubble up. - * @param {boolean} [cancelable=false] The flag to be possible to cancel. - * @deprecated - */ - initEvent() { - // Do nothing. - }, -}; - -// `constructor` is not enumerable. -Object.defineProperty(Event.prototype, "constructor", { - value: Event, - configurable: true, - writable: true, -}); - -// Ensure `event instanceof window.Event` is `true`. -if (typeof window !== "undefined" && typeof window.Event !== "undefined") { - Object.setPrototypeOf(Event.prototype, window.Event.prototype); - - // Make association for wrappers. - wrappers.set(window.Event.prototype, Event); -} - -/** - * Get the property descriptor to redirect a given property. - * @param {string} key Property name to define property descriptor. - * @returns {PropertyDescriptor} The property descriptor to redirect the property. - * @private - */ -function defineRedirectDescriptor(key) { - return { - get() { - return pd(this).event[key] - }, - set(value) { - pd(this).event[key] = value; - }, - configurable: true, - enumerable: true, - } -} - -/** - * Get the property descriptor to call a given method property. - * @param {string} key Property name to define property descriptor. - * @returns {PropertyDescriptor} The property descriptor to call the method property. - * @private - */ -function defineCallDescriptor(key) { - return { - value() { - const event = pd(this).event; - return event[key].apply(event, arguments) - }, - configurable: true, - enumerable: true, - } -} - -/** - * Define new wrapper class. - * @param {Function} BaseEvent The base wrapper class. - * @param {Object} proto The prototype of the original event. - * @returns {Function} The defined wrapper class. - * @private - */ -function defineWrapper(BaseEvent, proto) { - const keys = Object.keys(proto); - if (keys.length === 0) { - return BaseEvent - } - - /** CustomEvent */ - function CustomEvent(eventTarget, event) { - BaseEvent.call(this, eventTarget, event); - } - - CustomEvent.prototype = Object.create(BaseEvent.prototype, { - constructor: { value: CustomEvent, configurable: true, writable: true }, - }); - - // Define accessors. - for (let i = 0; i < keys.length; ++i) { - const key = keys[i]; - if (!(key in BaseEvent.prototype)) { - const descriptor = Object.getOwnPropertyDescriptor(proto, key); - const isFunc = typeof descriptor.value === "function"; - Object.defineProperty( - CustomEvent.prototype, - key, - isFunc - ? defineCallDescriptor(key) - : defineRedirectDescriptor(key) - ); - } - } - - return CustomEvent -} - -/** - * Get the wrapper class of a given prototype. - * @param {Object} proto The prototype of the original event to get its wrapper. - * @returns {Function} The wrapper class. - * @private - */ -function getWrapper(proto) { - if (proto == null || proto === Object.prototype) { - return Event - } - - let wrapper = wrappers.get(proto); - if (wrapper == null) { - wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); - wrappers.set(proto, wrapper); - } - return wrapper -} - -/** - * Wrap a given event to management a dispatching. - * @param {EventTarget} eventTarget The event target of this dispatching. - * @param {Object} event The event to wrap. - * @returns {Event} The wrapper instance. - * @private - */ -function wrapEvent(eventTarget, event) { - const Wrapper = getWrapper(Object.getPrototypeOf(event)); - return new Wrapper(eventTarget, event) -} - -/** - * Get the immediateStopped flag of a given event. - * @param {Event} event The event to get. - * @returns {boolean} The flag to stop propagation immediately. - * @private - */ -function isStopped(event) { - return pd(event).immediateStopped -} - -/** - * Set the current event phase of a given event. - * @param {Event} event The event to set current target. - * @param {number} eventPhase New event phase. - * @returns {void} - * @private - */ -function setEventPhase(event, eventPhase) { - pd(event).eventPhase = eventPhase; -} - -/** - * Set the current target of a given event. - * @param {Event} event The event to set current target. - * @param {EventTarget|null} currentTarget New current target. - * @returns {void} - * @private - */ -function setCurrentTarget(event, currentTarget) { - pd(event).currentTarget = currentTarget; -} - -/** - * Set a passive listener of a given event. - * @param {Event} event The event to set current target. - * @param {Function|null} passiveListener New passive listener. - * @returns {void} - * @private - */ -function setPassiveListener(event, passiveListener) { - pd(event).passiveListener = passiveListener; -} - -/** - * @typedef {object} ListenerNode - * @property {Function} listener - * @property {1|2|3} listenerType - * @property {boolean} passive - * @property {boolean} once - * @property {ListenerNode|null} next - * @private - */ - -/** - * @type {WeakMap>} - * @private - */ -const listenersMap = new WeakMap(); - -// Listener types -const CAPTURE = 1; -const BUBBLE = 2; -const ATTRIBUTE = 3; - -/** - * Check whether a given value is an object or not. - * @param {any} x The value to check. - * @returns {boolean} `true` if the value is an object. - */ -function isObject(x) { - return x !== null && typeof x === "object" //eslint-disable-line no-restricted-syntax -} - -/** - * Get listeners. - * @param {EventTarget} eventTarget The event target to get. - * @returns {Map} The listeners. - * @private - */ -function getListeners(eventTarget) { - const listeners = listenersMap.get(eventTarget); - if (listeners == null) { - throw new TypeError( - "'this' is expected an EventTarget object, but got another value." - ) - } - return listeners -} - -/** - * Get the property descriptor for the event attribute of a given event. - * @param {string} eventName The event name to get property descriptor. - * @returns {PropertyDescriptor} The property descriptor. - * @private - */ -function defineEventAttributeDescriptor(eventName) { - return { - get() { - const listeners = getListeners(this); - let node = listeners.get(eventName); - while (node != null) { - if (node.listenerType === ATTRIBUTE) { - return node.listener - } - node = node.next; - } - return null - }, - - set(listener) { - if (typeof listener !== "function" && !isObject(listener)) { - listener = null; // eslint-disable-line no-param-reassign - } - const listeners = getListeners(this); - - // Traverse to the tail while removing old value. - let prev = null; - let node = listeners.get(eventName); - while (node != null) { - if (node.listenerType === ATTRIBUTE) { - // Remove old value. - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - } else { - prev = node; - } - - node = node.next; - } - - // Add new value. - if (listener !== null) { - const newNode = { - listener, - listenerType: ATTRIBUTE, - passive: false, - once: false, - next: null, - }; - if (prev === null) { - listeners.set(eventName, newNode); - } else { - prev.next = newNode; - } - } - }, - configurable: true, - enumerable: true, - } -} - -/** - * Define an event attribute (e.g. `eventTarget.onclick`). - * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite. - * @param {string} eventName The event name to define. - * @returns {void} - */ -function defineEventAttribute(eventTargetPrototype, eventName) { - Object.defineProperty( - eventTargetPrototype, - `on${eventName}`, - defineEventAttributeDescriptor(eventName) - ); -} - -/** - * Define a custom EventTarget with event attributes. - * @param {string[]} eventNames Event names for event attributes. - * @returns {EventTarget} The custom EventTarget. - * @private - */ -function defineCustomEventTarget(eventNames) { - /** CustomEventTarget */ - function CustomEventTarget() { - EventTarget.call(this); - } - - CustomEventTarget.prototype = Object.create(EventTarget.prototype, { - constructor: { - value: CustomEventTarget, - configurable: true, - writable: true, - }, - }); - - for (let i = 0; i < eventNames.length; ++i) { - defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); - } - - return CustomEventTarget -} - -/** - * EventTarget. - * - * - This is constructor if no arguments. - * - This is a function which returns a CustomEventTarget constructor if there are arguments. - * - * For example: - * - * class A extends EventTarget {} - * class B extends EventTarget("message") {} - * class C extends EventTarget("message", "error") {} - * class D extends EventTarget(["message", "error"]) {} - */ -function EventTarget() { - /*eslint-disable consistent-return */ - if (this instanceof EventTarget) { - listenersMap.set(this, new Map()); - return - } - if (arguments.length === 1 && Array.isArray(arguments[0])) { - return defineCustomEventTarget(arguments[0]) - } - if (arguments.length > 0) { - const types = new Array(arguments.length); - for (let i = 0; i < arguments.length; ++i) { - types[i] = arguments[i]; - } - return defineCustomEventTarget(types) - } - throw new TypeError("Cannot call a class as a function") - /*eslint-enable consistent-return */ -} - -// Should be enumerable, but class methods are not enumerable. -EventTarget.prototype = { - /** - * Add a given listener to this event target. - * @param {string} eventName The event name to add. - * @param {Function} listener The listener to add. - * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. - * @returns {void} - */ - addEventListener(eventName, listener, options) { - if (listener == null) { - return - } - if (typeof listener !== "function" && !isObject(listener)) { - throw new TypeError("'listener' should be a function or an object.") - } - - const listeners = getListeners(this); - const optionsIsObj = isObject(options); - const capture = optionsIsObj - ? Boolean(options.capture) - : Boolean(options); - const listenerType = capture ? CAPTURE : BUBBLE; - const newNode = { - listener, - listenerType, - passive: optionsIsObj && Boolean(options.passive), - once: optionsIsObj && Boolean(options.once), - next: null, - }; - - // Set it as the first node if the first node is null. - let node = listeners.get(eventName); - if (node === undefined) { - listeners.set(eventName, newNode); - return - } - - // Traverse to the tail while checking duplication.. - let prev = null; - while (node != null) { - if ( - node.listener === listener && - node.listenerType === listenerType - ) { - // Should ignore duplication. - return - } - prev = node; - node = node.next; - } - - // Add it. - prev.next = newNode; - }, - - /** - * Remove a given listener from this event target. - * @param {string} eventName The event name to remove. - * @param {Function} listener The listener to remove. - * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener. - * @returns {void} - */ - removeEventListener(eventName, listener, options) { - if (listener == null) { - return - } - - const listeners = getListeners(this); - const capture = isObject(options) - ? Boolean(options.capture) - : Boolean(options); - const listenerType = capture ? CAPTURE : BUBBLE; - - let prev = null; - let node = listeners.get(eventName); - while (node != null) { - if ( - node.listener === listener && - node.listenerType === listenerType - ) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - return - } - - prev = node; - node = node.next; - } - }, - - /** - * Dispatch a given event. - * @param {Event|{type:string}} event The event to dispatch. - * @returns {boolean} `false` if canceled. - */ - dispatchEvent(event) { - if (event == null || typeof event.type !== "string") { - throw new TypeError('"event.type" should be a string.') - } - - // If listeners aren't registered, terminate. - const listeners = getListeners(this); - const eventName = event.type; - let node = listeners.get(eventName); - if (node == null) { - return true - } - - // Since we cannot rewrite several properties, so wrap object. - const wrappedEvent = wrapEvent(this, event); - - // This doesn't process capturing phase and bubbling phase. - // This isn't participating in a tree. - let prev = null; - while (node != null) { - // Remove this listener if it's once - if (node.once) { - if (prev !== null) { - prev.next = node.next; - } else if (node.next !== null) { - listeners.set(eventName, node.next); - } else { - listeners.delete(eventName); - } - } else { - prev = node; - } - - // Call this listener - setPassiveListener( - wrappedEvent, - node.passive ? node.listener : null - ); - if (typeof node.listener === "function") { - try { - node.listener.call(this, wrappedEvent); - } catch (err) { - if ( - typeof console !== "undefined" && - typeof console.error === "function" - ) { - console.error(err); - } - } - } else if ( - node.listenerType !== ATTRIBUTE && - typeof node.listener.handleEvent === "function" - ) { - node.listener.handleEvent(wrappedEvent); - } - - // Break if `event.stopImmediatePropagation` was called. - if (isStopped(wrappedEvent)) { - break - } - - node = node.next; - } - setPassiveListener(wrappedEvent, null); - setEventPhase(wrappedEvent, 0); - setCurrentTarget(wrappedEvent, null); - - return !wrappedEvent.defaultPrevented - }, -}; - -// `constructor` is not enumerable. -Object.defineProperty(EventTarget.prototype, "constructor", { - value: EventTarget, - configurable: true, - writable: true, -}); - -// Ensure `eventTarget instanceof window.EventTarget` is `true`. -if ( - typeof window !== "undefined" && - typeof window.EventTarget !== "undefined" -) { - Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); -} - -export default EventTarget; -export { defineEventAttribute, EventTarget }; -//# sourceMappingURL=event-target-shim.mjs.map diff --git a/node_modules/event-target-shim/dist/event-target-shim.mjs.map b/node_modules/event-target-shim/dist/event-target-shim.mjs.map deleted file mode 100644 index 7d3b9fb..0000000 --- a/node_modules/event-target-shim/dist/event-target-shim.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"event-target-shim.mjs.map","sources":["../src/event.mjs","../src/event-target.mjs"],"sourcesContent":["/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,WAAW,GAAG,IAAI,OAAO,GAAE;;;;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O,MAAM,KAAK,WAAW;IAC7B,OAAO,MAAM,CAAC,WAAW,KAAK,WAAW;EAC3C;IACE,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,EAAC;CAC7E;;;;;"} \ No newline at end of file diff --git a/node_modules/event-target-shim/dist/event-target-shim.umd.js b/node_modules/event-target-shim/dist/event-target-shim.umd.js deleted file mode 100644 index c9bc62d..0000000 --- a/node_modules/event-target-shim/dist/event-target-shim.umd.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):b(a.EventTargetShim={})})(this,function(a){"use strict";function b(a){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},b(a)}function c(a){var b=u.get(a);return console.assert(null!=b,"'this' is expected an Event object, but got",a),b}function d(a){return null==a.passiveListener?void(!a.event.cancelable||(a.canceled=!0,"function"==typeof a.event.preventDefault&&a.event.preventDefault())):void("undefined"!=typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",a.passiveListener))}function e(a,b){u.set(this,{eventTarget:a,event:b,eventPhase:2,currentTarget:a,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:b.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});for(var c,d=Object.keys(b),e=0;e}\n * @private\n */\nconst privateData = new WeakMap()\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap()\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event)\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n )\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n )\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault()\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n })\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true })\n\n // Define accessors\n const keys = Object.keys(event)\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key))\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation()\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this)\n\n data.stopped = true\n data.immediateStopped = true\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation()\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this))\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this)\n\n data.stopped = true\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this))\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n})\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype)\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event)\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto)\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event)\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n })\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i]\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key)\n const isFunc = typeof descriptor.value === \"function\"\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n )\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto)\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto)\n wrappers.set(proto, wrapper)\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nexport function wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event))\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nexport function isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nexport function setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nexport function setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nexport function setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener\n}\n","import {\n isStopped,\n setCurrentTarget,\n setEventPhase,\n setPassiveListener,\n wrapEvent,\n} from \"./event.mjs\"\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap()\n\n// Listener types\nconst CAPTURE = 1\nconst BUBBLE = 2\nconst ATTRIBUTE = 3\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget)\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this)\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this)\n\n // Traverse to the tail while removing old value.\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n node = node.next\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n }\n if (prev === null) {\n listeners.set(eventName, newNode)\n } else {\n prev.next = newNode\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n )\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this)\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n })\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i])\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map())\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length)\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i]\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this)\n const optionsIsObj = isObject(options)\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n }\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName)\n if (node === undefined) {\n listeners.set(eventName, newNode)\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node\n node = node.next\n }\n\n // Add it.\n prev.next = newNode\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this)\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options)\n const listenerType = capture ? CAPTURE : BUBBLE\n\n let prev = null\n let node = listeners.get(eventName)\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n return\n }\n\n prev = node\n node = node.next\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this)\n const eventName = event.type\n let node = listeners.get(eventName)\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event)\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next\n } else if (node.next !== null) {\n listeners.set(eventName, node.next)\n } else {\n listeners.delete(eventName)\n }\n } else {\n prev = node\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n )\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent)\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err)\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent)\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next\n }\n setPassiveListener(wrappedEvent, null)\n setEventPhase(wrappedEvent, 0)\n setCurrentTarget(wrappedEvent, null)\n\n return !wrappedEvent.defaultPrevented\n },\n}\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n})\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype)\n}\n\nexport { defineEventAttribute, EventTarget }\nexport default EventTarget\n"],"names":["pd","event","retv","privateData","get","console","assert","setCancelFlag","data","passiveListener","cancelable","canceled","preventDefault","error","Event","eventTarget","set","eventPhase","currentTarget","stopped","immediateStopped","timeStamp","Date","now","Object","defineProperty","value","enumerable","key","keys","i","length","defineRedirectDescriptor","configurable","defineCallDescriptor","apply","arguments","defineWrapper","BaseEvent","proto","CustomEvent","call","prototype","create","constructor","writable","descriptor","getOwnPropertyDescriptor","isFunc","getWrapper","wrapper","wrappers","getPrototypeOf","wrapEvent","Wrapper","isStopped","setEventPhase","setCurrentTarget","setPassiveListener","isObject","x","_typeof","getListeners","listeners","listenersMap","TypeError","defineEventAttributeDescriptor","eventName","node","listenerType","listener","next","prev","delete","newNode","passive","once","defineEventAttribute","eventTargetPrototype","defineCustomEventTarget","eventNames","CustomEventTarget","EventTarget","Map","Array","isArray","types","WeakMap","type","target","composedPath","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","stopPropagation","stopImmediatePropagation","bubbles","defaultPrevented","composed","srcElement","cancelBubble","returnValue","initEvent","window","setPrototypeOf","CAPTURE","BUBBLE","addEventListener","options","optionsIsObj","capture","removeEventListener","dispatchEvent","wrappedEvent","err","handleEvent"],"mappings":";;;;4aAkCA,QAASA,CAAAA,CAAT,CAAYC,CAAZ,CAAmB,IACTC,CAAAA,CAAI,CAAGC,CAAW,CAACC,GAAZD,CAAgBF,CAAhBE,QACbE,CAAAA,OAAO,CAACC,MAARD,CACY,IAARH,EAAAA,CADJG,CAEI,6CAFJA,CAGIJ,CAHJI,EAKOH,EAOX,QAASK,CAAAA,CAAT,CAAuBC,CAAvB,CAA6B,OACG,KAAxBA,EAAAA,CAAI,CAACC,eADgB,MAarB,CAACD,CAAI,CAACP,KAALO,CAAWE,UAbS,GAiBzBF,CAAI,CAACG,QAALH,GAjByB,CAkBgB,UAArC,QAAOA,CAAAA,CAAI,CAACP,KAALO,CAAWI,cAlBG,EAmBrBJ,CAAI,CAACP,KAALO,CAAWI,cAAXJ,EAnBqB,QAGE,WAAnB,QAAOH,CA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QAALF,CAAcgD,aAErBhD,CAAI,CAACE,QAALF,CAAcgD,WAAdhD,CAA0B8C,CAA1B9C,KAIAb,CAAS,CAAC2D,CAAD,QAIb9C,CAAI,CAAGA,CAAI,CAACG,WAEhBb,CAAAA,CAAkB,CAACwD,CAAD,CAAe,IAAf,EAClB1D,CAAa,CAAC0D,CAAD,CAAe,CAAf,EACbzD,CAAgB,CAACyD,CAAD,CAAe,IAAf,EAET,CAACA,CAAY,CAAChB,iBAvKL,EA4KxB1E,MAAM,CAACC,cAAPD,CAAsB0D,CAAW,CAACxC,SAAlClB,CAA6C,aAA7CA,CAA4D,CACxDE,KAAK,CAAEwD,CADiD,CAExDjD,YAAY,GAF4C,CAGxDY,QAAQ,GAHgD,CAA5DrB,EAQsB,WAAlB,QAAOgF,CAAAA,MAAP,EAC8B,WAA9B,QAAOA,CAAAA,MAAM,CAACtB,aAEd1D,MAAM,CAACiF,cAAPjF,CAAsB0D,CAAW,CAACxC,SAAlClB,CAA6CgF,MAAM,CAACtB,WAAPsB,CAAmB9D,SAAhElB"} \ No newline at end of file diff --git a/node_modules/event-target-shim/index.d.ts b/node_modules/event-target-shim/index.d.ts deleted file mode 100644 index 7aceffd..0000000 --- a/node_modules/event-target-shim/index.d.ts +++ /dev/null @@ -1,200 +0,0 @@ -export as namespace EventTargetShim; - -export interface Event { - /** - * The type of this event. - */ - readonly type: string; - - /** - * The target of this event. - */ - readonly target: EventTarget | null; - - /** - * The current target of this event. - */ - readonly currentTarget: EventTarget | null; - - /** - * The target of this event. - */ - readonly srcElement: any | null; - - /** - * The composed path of this event. - */ - composedPath(): EventTarget[]; - - /** - * Constant of NONE. - */ - readonly NONE: number; - - /** - * Constant of CAPTURING_PHASE. - */ - readonly CAPTURING_PHASE: number; - - /** - * Constant of BUBBLING_PHASE. - */ - readonly BUBBLING_PHASE: number; - - /** - * Constant of AT_TARGET. - */ - readonly AT_TARGET: number; - - /** - * Indicates which phase of the event flow is currently being evaluated. - */ - readonly eventPhase: number; - - /** - * Stop event bubbling. - */ - stopPropagation(): void; - - /** - * Stop event bubbling. - */ - stopImmediatePropagation(): void; - - /** - * Initialize event. - * @deprecated - */ - initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; - - /** - * The flag indicating bubbling. - */ - readonly bubbles: boolean; - - /** - * Stop event bubbling. - */ - cancelBubble: boolean; - - /** - * Set or get cancellation flag. - */ - returnValue: boolean; - - /** - * The flag indicating whether the event can be canceled. - */ - readonly cancelable: boolean; - - /** - * Cancel this event. - */ - preventDefault(): void; - - /** - * The flag to indicating whether the event was canceled. - */ - readonly defaultPrevented: boolean; - - /** - * The flag to indicating if event is composed. - */ - readonly composed: boolean; - - /** - * Indicates whether the event was dispatched by the user agent. - */ - readonly isTrusted: boolean; - - /** - * The unix time of this event. - */ - readonly timeStamp: number; -} - -export interface EventListenerOptions { - capture?: boolean; -} - -export interface AddEventListenerOptions extends EventListenerOptions { - passive?: boolean; - once?: boolean; -} - -export type EventTargetListener = ((event: Event) => void) | { handleEvent(event: Event): void }; - -export interface PartialEvent extends Partial { - type: string; - [key: string]: any; -} - -export interface EventTarget { - /** - * Add a given listener to this event target. - * @param eventName The event name to add. - * @param listener The listener to add. - * @param options The options for this listener. - */ - addEventListener( - eventName: string, - listener: EventTargetListener | null, - options?: boolean | AddEventListenerOptions, - ): void; - - /** - * Remove a given listener from this event target. - * @param eventName The event name to remove. - * @param listener The listener to remove. - * @param options The options for this listener. - */ - removeEventListener( - eventName: string, - listener: EventTargetListener | null, - options?: boolean | EventListenerOptions, - ): void; - - /** - * Dispatch a given event. - * @param event The event to dispatch. - * @returns `false` if canceled. - */ - dispatchEvent(event: PartialEvent): boolean; -} - -type EventAttributes = { - [K in T]: ((ev: Event) => void) | null; -}; - -type EventTargetConstructor = { - prototype: EventTarget; - new(): EventTarget; -}; - -type ExEventTarget = EventTarget & EventAttributes; - -type ExEventTargetConstructor = { - prototype: ExEventTarget; - new(): ExEventTarget; -}; - -export const EventTarget: { - new(): EventTarget; - new(): ExEventTarget; - /** - * The event target wrapper to be used when extending objects. - * @param events Optional event attributes (e.g. passing in `"click"` adds `onclick` to prototype). - */ - (events: string[]): EventTargetConstructor; - (...events: string[]): EventTargetConstructor; - (events: string[]): ExEventTargetConstructor; - (...events: string[]): ExEventTargetConstructor; -}; -export default EventTarget; - -/** - * Define an event attribute (e.g. `eventTarget.onclick`). - * @param eventTargetPrototype The event target prototype to define an event attribute. - * @param eventName The event name to define. - */ -export function defineEventAttribute(eventTargetPrototype: EventTarget, eventName: string): void; diff --git a/node_modules/event-target-shim/package.json b/node_modules/event-target-shim/package.json deleted file mode 100644 index 0942ddf..0000000 --- a/node_modules/event-target-shim/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_from": "event-target-shim@^4.0.3", - "_id": "event-target-shim@4.0.3", - "_inBundle": false, - "_integrity": "sha512-YXVJDPGzU0yhSzrXGoEFAByEaLnZXSlJDHXkq4Hp6WrlnV66tADiZugYf1utTaCP/dsYRcLndAhecbq9mnbbqg==", - "_location": "/event-target-shim", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "event-target-shim@^4.0.3", - "name": "event-target-shim", - "escapedName": "event-target-shim", - "rawSpec": "^4.0.3", - "saveSpec": null, - "fetchSpec": "^4.0.3" - }, - "_requiredBy": [ - "/@mux/upchunk" - ], - "_resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-4.0.3.tgz", - "_shasum": "758cd632cd4241f5a73ceec64f93f0d7b0ae77d6", - "_spec": "event-target-shim@^4.0.3", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/@mux/upchunk", - "author": { - "name": "Toru Nagashima" - }, - "bugs": { - "url": "https://github.com/mysticatea/event-target-shim/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "An implementation of WHATWG EventTarget interface.", - "devDependencies": { - "@babel/core": "^7.1.6", - "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@babel/preset-env": "^7.1.6", - "@babel/register": "^7.0.0", - "@mysticatea/eslint-plugin": "^7.0.0", - "@mysticatea/spy": "^0.1.2", - "assert": "^1.4.1", - "codecov": "^3.1.0", - "eslint": "^5.9.0", - "karma": "^3.1.1", - "karma-chrome-launcher": "^2.2.0", - "karma-coverage": "^1.1.2", - "karma-firefox-launcher": "^1.0.0", - "karma-growl-reporter": "^1.0.0", - "karma-ie-launcher": "^1.0.0", - "karma-mocha": "^1.3.0", - "karma-rollup-preprocessor": "^6.1.1", - "mocha": "^5.2.0", - "npm-run-all": "^4.1.5", - "nyc": "^13.1.0", - "opener": "^1.5.1", - "rimraf": "^2.6.2", - "rollup": "^0.66.6", - "rollup-plugin-babel": "^4.0.3", - "rollup-plugin-babel-minify": "^6.2.0", - "rollup-plugin-commonjs": "^9.2.0", - "rollup-plugin-json": "^3.1.0", - "rollup-plugin-node-resolve": "^3.4.0", - "rollup-watch": "^4.3.1", - "typescript": "~3.2.1" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "dist", - "index.d.ts" - ], - "homepage": "https://github.com/mysticatea/event-target-shim", - "keywords": [ - "w3c", - "whatwg", - "eventtarget", - "event", - "events", - "shim" - ], - "license": "MIT", - "main": "dist/event-target-shim", - "name": "event-target-shim", - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/event-target-shim.git" - }, - "scripts": { - "build": "rollup -c scripts/rollup.config.js", - "clean": "rimraf .nyc_output coverage", - "codecov": "codecov", - "coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html", - "lint": "eslint src test scripts --ext .js,.mjs", - "postversion": "git push && git push --tags", - "pretest": "npm run lint", - "preversion": "npm test", - "test": "run-s test:*", - "test:karma": "karma start scripts/karma.conf.js --single-run", - "test:mocha": "nyc --require ./scripts/babel-register mocha test/index.mjs", - "test:types": "tsc", - "version": "npm run build && git add dist/*", - "watch": "run-p watch:*", - "watch:karma": "karma start scripts/karma.conf.js --watch", - "watch:mocha": "mocha test/index.mjs --require ./scripts/babel-register --watch --watch-extensions js,mjs --growl" - }, - "types": "index.d.ts", - "version": "4.0.3" -} diff --git a/node_modules/global/.travis.yml b/node_modules/global/.travis.yml deleted file mode 100644 index ed178f6..0000000 --- a/node_modules/global/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 diff --git a/node_modules/global/LICENSE b/node_modules/global/LICENSE deleted file mode 100644 index 822d880..0000000 --- a/node_modules/global/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Colingo. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/global/README.md b/node_modules/global/README.md deleted file mode 100644 index 289d305..0000000 --- a/node_modules/global/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# global - - - -Require global variables - -## Example - -```js -var global = require("global") -var document = require("global/document") -var window = require("global/window") -``` - -## Installation - -`npm install global` - -## Contributors - - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Colingo/global.png - [2]: http://travis-ci.org/Colingo/global - [3]: http://ci.testling.com/Colingo/global.png - [4]: http://ci.testling.com/Colingo/global diff --git a/node_modules/global/console.js b/node_modules/global/console.js deleted file mode 100644 index 5cb1dfa..0000000 --- a/node_modules/global/console.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = console; diff --git a/node_modules/global/document.js b/node_modules/global/document.js deleted file mode 100644 index 7c0f50d..0000000 --- a/node_modules/global/document.js +++ /dev/null @@ -1,17 +0,0 @@ -var topLevel = typeof global !== 'undefined' ? global : - typeof window !== 'undefined' ? window : {} -var minDoc = require('min-document'); - -var doccy; - -if (typeof document !== 'undefined') { - doccy = document; -} else { - doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; - - if (!doccy) { - doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; - } -} - -module.exports = doccy; diff --git a/node_modules/global/package.json b/node_modules/global/package.json deleted file mode 100644 index f8a9a47..0000000 --- a/node_modules/global/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_from": "global@~4.4.0", - "_id": "global@4.4.0", - "_inBundle": false, - "_integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", - "_location": "/global", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "global@~4.4.0", - "name": "global", - "escapedName": "global", - "rawSpec": "~4.4.0", - "saveSpec": null, - "fetchSpec": "~4.4.0" - }, - "_requiredBy": [ - "/xhr" - ], - "_resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", - "_shasum": "3e7b105179006a323ed71aafca3e9c57a5cc6406", - "_spec": "global@~4.4.0", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/xhr", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "browser": { - "min-document": false, - "individual": false - }, - "bugs": { - "url": "https://github.com/Raynos/global/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Raynos" - } - ], - "dependencies": { - "min-document": "^2.19.0", - "process": "^0.11.10" - }, - "deprecated": false, - "description": "Require global variables", - "devDependencies": { - "tape": "^2.12.0" - }, - "homepage": "https://github.com/Raynos/global", - "keywords": [], - "license": "MIT", - "main": "window.js", - "name": "global", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/global.git" - }, - "scripts": { - "build": "browserify test/index.js -o test/static/bundle.js", - "test": "node ./test", - "testem": "testem" - }, - "testling": { - "files": "test/index.js", - "browsers": { - "ie": [ - "8", - "9", - "10" - ], - "firefox": [ - "16", - "17", - "nightly" - ], - "chrome": [ - "22", - "23", - "canary" - ], - "opera": [ - "12", - "next" - ], - "safari": [ - "5.1" - ] - } - }, - "version": "4.4.0" -} diff --git a/node_modules/global/process.js b/node_modules/global/process.js deleted file mode 100644 index 00a8e37..0000000 --- a/node_modules/global/process.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('process'); diff --git a/node_modules/global/window.js b/node_modules/global/window.js deleted file mode 100644 index ae6c11c..0000000 --- a/node_modules/global/window.js +++ /dev/null @@ -1,13 +0,0 @@ -var win; - -if (typeof window !== "undefined") { - win = window; -} else if (typeof global !== "undefined") { - win = global; -} else if (typeof self !== "undefined"){ - win = self; -} else { - win = {}; -} - -module.exports = win; diff --git a/node_modules/is-function/LICENSE b/node_modules/is-function/LICENSE deleted file mode 100644 index 0b4aed1..0000000 --- a/node_modules/is-function/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Stephen Sugden - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/is-function/README.md b/node_modules/is-function/README.md deleted file mode 100644 index 0a67128..0000000 --- a/node_modules/is-function/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# is-function - -[![browser support](https://ci.testling.com/grncdr/js-is-function.png)](https://ci.testling.com/grncdr/js-is-function) - -Is that thing a function? Use this module to find out. - -## API - -### module.exports = function isFunction(fn) -> Boolean - -Return `true` if `fn` is a function, otherwise `false`. - -## Why not typeof fn === 'function' - -Because certain old browsers misreport the type of `RegExp` objects as functions. - -## Acknowledgements - -I stole this from https://github.com/ljharb/object-keys - -## License - -MIT diff --git a/node_modules/is-function/index.js b/node_modules/is-function/index.js deleted file mode 100644 index 3e64897..0000000 --- a/node_modules/is-function/index.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = isFunction - -var toString = Object.prototype.toString - -function isFunction (fn) { - if (!fn) { - return false - } - var string = toString.call(fn) - return string === '[object Function]' || - (typeof fn === 'function' && string !== '[object RegExp]') || - (typeof window !== 'undefined' && - // IE8 and below - (fn === window.setTimeout || - fn === window.alert || - fn === window.confirm || - fn === window.prompt)) -}; diff --git a/node_modules/is-function/package.json b/node_modules/is-function/package.json deleted file mode 100644 index 0db56df..0000000 --- a/node_modules/is-function/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "is-function@^1.0.1", - "_id": "is-function@1.0.2", - "_inBundle": false, - "_integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==", - "_location": "/is-function", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "is-function@^1.0.1", - "name": "is-function", - "escapedName": "is-function", - "rawSpec": "^1.0.1", - "saveSpec": null, - "fetchSpec": "^1.0.1" - }, - "_requiredBy": [ - "/xhr" - ], - "_resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "_shasum": "4f097f30abf6efadac9833b17ca5dc03f8144e08", - "_spec": "is-function@^1.0.1", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/xhr", - "author": { - "name": "Stephen Sugden", - "email": "me@stephensugden.com" - }, - "bugs": { - "url": "https://github.com/grncdr/js-is-function/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "is that thing a function? Use this module to find out", - "devDependencies": { - "tape": "~2.3.2" - }, - "homepage": "https://github.com/grncdr/js-is-function", - "keywords": [ - "polyfill", - "is-function", - "ie6" - ], - "license": "MIT", - "main": "index.js", - "name": "is-function", - "repository": { - "type": "git", - "url": "git://github.com/grncdr/js-is-function.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "files": "test.js", - "browsers": [ - "iexplore/6.0..latest", - "firefox/3.0..6.0", - "firefox/15.0..latest", - "firefox/nightly", - "chrome/4.0..10.0", - "chrome/20.0..latest", - "chrome/canary", - "opera/10.0..latest", - "opera/next", - "safari/4.0..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2" - ] - }, - "version": "1.0.2" -} diff --git a/node_modules/is-function/test.js b/node_modules/is-function/test.js deleted file mode 100644 index b3ac5e4..0000000 --- a/node_modules/is-function/test.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tape') -var isFunction = require('./index.js') - -test('isFunction', function (t) { - t.ok(!isFunction(), 'undefined is not a function') - t.ok(!isFunction(null), 'null is not a function') - t.ok(!isFunction(''), 'string is not a function') - t.ok(!isFunction(/a/), 'regex is not a function') - t.ok(!isFunction(true), 'true is not a function') - t.ok(!isFunction(false), 'false is not a function') - t.ok(!isFunction(NaN), 'NaN is not a function') - t.ok(!isFunction(42), '42 is not a function') - t.ok(isFunction(function () {}), 'function is a function') - t.ok(isFunction(setTimeout), 'setTimeout is a function') - t.end() -}) - -if (typeof window !== 'undefined') { - test('browser quirks', function (t) { - t.plan(2) - - t.ok(isFunction(window.alert), 'alert is a function') - - window.testRegExpFromIframe = function (regexp) { - t.ok(!isFunction(regexp)) - } - - var iframe = document.createElement('iframe') - document.body.appendChild(iframe) - - iframe.contentWindow.document.write([ - "" - ].join("\n")); - }) -} diff --git a/node_modules/min-document/.jshintrc b/node_modules/min-document/.jshintrc deleted file mode 100644 index 77887b5..0000000 --- a/node_modules/min-document/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "maxdepth": 4, - "maxstatements": 200, - "maxcomplexity": 12, - "maxlen": 80, - "maxparams": 5, - - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "noarg": true, - "noempty": true, - "nonew": true, - "undef": true, - "unused": "vars", - "trailing": true, - - "quotmark": true, - "expr": true, - "asi": true, - - "browser": false, - "esnext": true, - "devel": false, - "node": false, - "nonstandard": false, - - "predef": ["require", "module", "__dirname", "__filename"] -} diff --git a/node_modules/min-document/.npmignore b/node_modules/min-document/.npmignore deleted file mode 100644 index fd31f5e..0000000 --- a/node_modules/min-document/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -.DS_Store -.monitor -.*.swp -.nodemonignore -releases -*.log -*.err -fleet.json -public/browserify -bin/*.json -.bin -build -compile -.lock-wscript -node_modules diff --git a/node_modules/min-document/.testem.json b/node_modules/min-document/.testem.json deleted file mode 100644 index 41ab90e..0000000 --- a/node_modules/min-document/.testem.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "launchers": { - "node": { - "command": "node ./test" - } - }, - "src_files": [ - "./**/*.js" - ], - "before_tests": "npm run build-test", - "on_exit": "rm test/static/bundle.js", - "test_page": "test/static/index.html", - "launch_in_dev": ["node", "phantomjs"] -} diff --git a/node_modules/min-document/.travis.yml b/node_modules/min-document/.travis.yml deleted file mode 100644 index 52424f8..0000000 --- a/node_modules/min-document/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 0.8 - - 0.9 - - 0.10 -script: node ./test/index.js diff --git a/node_modules/min-document/CONTRIBUTION.md b/node_modules/min-document/CONTRIBUTION.md deleted file mode 100644 index 4e78bdf..0000000 --- a/node_modules/min-document/CONTRIBUTION.md +++ /dev/null @@ -1,48 +0,0 @@ -# This is an OPEN Open Source Project - -## What? - -Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. - -## Rules - -There are a few basic ground-rules for contributors: - - - No --force pushes or modifying the Git history in any way. - - Non-master branches ought to be used for ongoing work. - - External API changes and significant modifications ought to be subject to an internal pull-request to solicit feedback from other contributors. - - Internal pull-requests to solicit feedback are encouraged for any other non-trivial contribution but left to the discretion of the contributor. - - For significant changes wait a full 24 hours before merging so that active contributors who are distributed throughout the world have a chance to weigh in. - - Contributors should attempt to adhere to the prevailing code-style. -Releases - -Declaring formal releases requires peer review. - - - A reviewer of a pull request should recommend a new version number (patch, minor or major). - - Once your change is merged feel free to bump the version as recommended by the reviewer. - - A new version number should not be cut without peer review unless done by the project maintainer. - -## Want to contribute? - -Even though collaborators may contribute as they see fit, if you are not sure what to do, here's a suggested process: - -## Cutting a new version - - - Get your branch merged on master - - Run `npm version major` or `npm version minor` or `npm version patch` - - `git push origin master --tags` - - If you are a project owner, then `npm publish` - -## If you want to have a bug fixed or a feature added: - - - Check open issues for what you want. - - If there is an open issue, comment on it, otherwise open an issue describing your bug or feature with use cases. - - Discussion happens on the issue about how to solve your problem. - - You or a core contributor opens a pull request solving the issue with tests and documentation. - - The pull requests gets reviewed and then merged. - - A new release version get's cut. - - (Disclaimer: Your feature might get rejected.) - -### Changes to this arrangement - -This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change. diff --git a/node_modules/min-document/LICENCE b/node_modules/min-document/LICENCE deleted file mode 100644 index 72d356c..0000000 --- a/node_modules/min-document/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Colingo. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/min-document/README.md b/node_modules/min-document/README.md deleted file mode 100644 index 970b47d..0000000 --- a/node_modules/min-document/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# min-document - -[![build status][1]][2] [![dependency status][3]][4] - - - -A minimal DOM implementation - -## Example - -```js -var document = require("min-document") - -var div = document.createElement("div") -div.className = "foo bar" - -var span = document.createElement("span") -div.appendChild(span) -span.textContent = "Hello!" - -/*
- Hello! -
-*/ -var html = String(div) -``` - -## Installation - -`npm install min-document` - -## Contributors - - - Raynos - -## MIT Licenced - - [1]: https://secure.travis-ci.org/Raynos/min-document.png - [2]: https://travis-ci.org/Raynos/min-document - [3]: https://david-dm.org/Raynos/min-document.png - [4]: https://david-dm.org/Raynos/min-document - [5]: https://ci.testling.com/Raynos/min-document.png - [6]: https://ci.testling.com/Raynos/min-document diff --git a/node_modules/min-document/docs.mli b/node_modules/min-document/docs.mli deleted file mode 100644 index ad17b4a..0000000 --- a/node_modules/min-document/docs.mli +++ /dev/null @@ -1,156 +0,0 @@ -type Comment := { - data: String, - length: Number, - nodeName: "#comment", - nodeType: 8, - nodeValue: String, - ownerDoucment: null | Document, - - toString: (this: Comment) => String -} - -type DOMText := { - data: String, - type: "DOMTextNode", - length: Number, - nodeType: 3, - - toString: (this: DOMText) => String, - replaceChild: ( - this: DOMText, - index: Number, - length: Number, - value: String - ) => void -} - -type DOMNode := DOMText | DOMElement | DocumentFragment -type DOMChild := DOMText | DOMElement - -type DOMElement := { - tagName: String, - className: String, - dataset: Object, - childNodes: Array, - parentNode: null | DOMElement, - style: Object, - type: "DOMElement", - nodeType: 1, - ownerDoucment: null | Document, - namespaceURI: null | String, - - appendChild: (this: DOMElement, child: DOMChild) => DOMChild, - replaceChild:( - this: DOMElement, - elem: DOMChild, - needle: DOMChild - ) => DOMChild, - removeChild: (this: DOMElement, child: DOMChild) => DOMChild, - insertBefore: ( - this: DOMElement, - elem: DOMChild, - needle: DOMChild | null | undefined - ) => DOMChild, - addEventListener: addEventListener, - dispatchEvent: dispatchEvent, - focus: () => void, - toString: (this: DOMElement) => String, - getElementsByClassName: ( - this: DOMElement, - className: String - ) => Array, - getElementsByTagName: ( - this: DOMElement, - tagName: String - ) => Array, -} - -type DocumentFragment := { - childNodes: Array, - parentNode: null | DOMElement, - type: "DocumentFragment", - nodeType: 11, - nodeName: "#document-fragment", - ownerDoucment: Document | null, - - appendChild: (this: DocumentFragment, child: DOMChild), - replaceChild: - (this: DocumentFragment, elem: DOMChild, needle: DOMChild), - removeChild: (this: DocumentFragment, child: DOMChild), - toString: (this: DocumentFragment) => String -} - -type Document := { - body: DOMElement, - childNodes: Array, - documentElement: DOMElement, - nodeType: 9, - - createComment: (this: Document, data: String) => Commment, - createTextNode: (this: Document, value: String) => DOMText, - createElement: (this: Document, tagName: String) => DOMElement, - createElementNS: ( - this: Document, - namespace: String | null, - tagName: String - ) => DOMElement, - createDocumentFragment: (this: Document) => DocumentFragment, - createEvent: () => Event, - getElementById: ( - this: Document, - id: String, - ) => null | DOMElement, - getElementsByClassName: ( - this: Document, - className: String - ) => Array, - getElementsByTagName: ( - this: Document, - tagName: String - ) => Array -} - -type Event := { - type: String, - bubbles: Boolean, - cancelable: Boolean, - - initEvent: ( - this: Event, - type: String, - bubbles: Boolean, - cancelable: Boolean - ) => void -} - -type addEventListener := ( - this: DOMElement, - type: String, - listener: Listener -) => void - -type dispatchEvent := ( - this: DOMElement, - ev: Event -) - -min-document/event/add-event-listener := addEventListener - -min-document/event/dispatch-event := dispatchEvent - -min-document/document := () => Document - -min-document/dom-element := - (tagName: String, owner?: Document, namespace?: String | null) => DOMElement - -min-document/dom-fragment := - (owner?: Document) => DocumentFragment - -min-document/dom-text := - (value: String, owner?: Document) => DOMText - -min-document/event := () => Event - -min-document/serialize := (DOMElement) => String - -min-document := Document diff --git a/node_modules/min-document/document.js b/node_modules/min-document/document.js deleted file mode 100644 index d929cbd..0000000 --- a/node_modules/min-document/document.js +++ /dev/null @@ -1,72 +0,0 @@ -var domWalk = require("dom-walk") - -var Comment = require("./dom-comment.js") -var DOMText = require("./dom-text.js") -var DOMElement = require("./dom-element.js") -var DocumentFragment = require("./dom-fragment.js") -var Event = require("./event.js") -var dispatchEvent = require("./event/dispatch-event.js") -var addEventListener = require("./event/add-event-listener.js") -var removeEventListener = require("./event/remove-event-listener.js") - -module.exports = Document; - -function Document() { - if (!(this instanceof Document)) { - return new Document(); - } - - this.head = this.createElement("head") - this.body = this.createElement("body") - this.documentElement = this.createElement("html") - this.documentElement.appendChild(this.head) - this.documentElement.appendChild(this.body) - this.childNodes = [this.documentElement] - this.nodeType = 9 -} - -var proto = Document.prototype; -proto.createTextNode = function createTextNode(value) { - return new DOMText(value, this) -} - -proto.createElementNS = function createElementNS(namespace, tagName) { - var ns = namespace === null ? null : String(namespace) - return new DOMElement(tagName, this, ns) -} - -proto.createElement = function createElement(tagName) { - return new DOMElement(tagName, this) -} - -proto.createDocumentFragment = function createDocumentFragment() { - return new DocumentFragment(this) -} - -proto.createEvent = function createEvent(family) { - return new Event(family) -} - -proto.createComment = function createComment(data) { - return new Comment(data, this) -} - -proto.getElementById = function getElementById(id) { - id = String(id) - - var result = domWalk(this.childNodes, function (node) { - if (String(node.id) === id) { - return node - } - }) - - return result || null -} - -proto.getElementsByClassName = DOMElement.prototype.getElementsByClassName -proto.getElementsByTagName = DOMElement.prototype.getElementsByTagName -proto.contains = DOMElement.prototype.contains - -proto.removeEventListener = removeEventListener -proto.addEventListener = addEventListener -proto.dispatchEvent = dispatchEvent diff --git a/node_modules/min-document/dom-comment.js b/node_modules/min-document/dom-comment.js deleted file mode 100644 index 132ea37..0000000 --- a/node_modules/min-document/dom-comment.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = Comment - -function Comment(data, owner) { - if (!(this instanceof Comment)) { - return new Comment(data, owner) - } - - this.data = data - this.nodeValue = data - this.length = data.length - this.ownerDocument = owner || null -} - -Comment.prototype.nodeType = 8 -Comment.prototype.nodeName = "#comment" - -Comment.prototype.toString = function _Comment_toString() { - return "[object Comment]" -} diff --git a/node_modules/min-document/dom-element.js b/node_modules/min-document/dom-element.js deleted file mode 100644 index 73ff10e..0000000 --- a/node_modules/min-document/dom-element.js +++ /dev/null @@ -1,209 +0,0 @@ -var domWalk = require("dom-walk") -var dispatchEvent = require("./event/dispatch-event.js") -var addEventListener = require("./event/add-event-listener.js") -var removeEventListener = require("./event/remove-event-listener.js") -var serializeNode = require("./serialize.js") - -var htmlns = "http://www.w3.org/1999/xhtml" - -module.exports = DOMElement - -function DOMElement(tagName, owner, namespace) { - if (!(this instanceof DOMElement)) { - return new DOMElement(tagName) - } - - var ns = namespace === undefined ? htmlns : (namespace || null) - - this.tagName = ns === htmlns ? String(tagName).toUpperCase() : tagName - this.nodeName = this.tagName - this.className = "" - this.dataset = {} - this.childNodes = [] - this.parentNode = null - this.style = {} - this.ownerDocument = owner || null - this.namespaceURI = ns - this._attributes = {} - - if (this.tagName === 'INPUT') { - this.type = 'text' - } -} - -DOMElement.prototype.type = "DOMElement" -DOMElement.prototype.nodeType = 1 - -DOMElement.prototype.appendChild = function _Element_appendChild(child) { - if (child.parentNode) { - child.parentNode.removeChild(child) - } - - this.childNodes.push(child) - child.parentNode = this - - return child -} - -DOMElement.prototype.replaceChild = - function _Element_replaceChild(elem, needle) { - // TODO: Throw NotFoundError if needle.parentNode !== this - - if (elem.parentNode) { - elem.parentNode.removeChild(elem) - } - - var index = this.childNodes.indexOf(needle) - - needle.parentNode = null - this.childNodes[index] = elem - elem.parentNode = this - - return needle - } - -DOMElement.prototype.removeChild = function _Element_removeChild(elem) { - // TODO: Throw NotFoundError if elem.parentNode !== this - - var index = this.childNodes.indexOf(elem) - this.childNodes.splice(index, 1) - - elem.parentNode = null - return elem -} - -DOMElement.prototype.insertBefore = - function _Element_insertBefore(elem, needle) { - // TODO: Throw NotFoundError if referenceElement is a dom node - // and parentNode !== this - - if (elem.parentNode) { - elem.parentNode.removeChild(elem) - } - - var index = needle === null || needle === undefined ? - -1 : - this.childNodes.indexOf(needle) - - if (index > -1) { - this.childNodes.splice(index, 0, elem) - } else { - this.childNodes.push(elem) - } - - elem.parentNode = this - return elem - } - -DOMElement.prototype.setAttributeNS = - function _Element_setAttributeNS(namespace, name, value) { - var prefix = null - var localName = name - var colonPosition = name.indexOf(":") - if (colonPosition > -1) { - prefix = name.substr(0, colonPosition) - localName = name.substr(colonPosition + 1) - } - if (this.tagName === 'INPUT' && name === 'type') { - this.type = value; - } - else { - var attributes = this._attributes[namespace] || (this._attributes[namespace] = {}) - attributes[localName] = {value: value, prefix: prefix} - } - } - -DOMElement.prototype.getAttributeNS = - function _Element_getAttributeNS(namespace, name) { - var attributes = this._attributes[namespace]; - var value = attributes && attributes[name] && attributes[name].value - if (this.tagName === 'INPUT' && name === 'type') { - return this.type; - } - if (typeof value !== "string") { - return null - } - return value - } - -DOMElement.prototype.removeAttributeNS = - function _Element_removeAttributeNS(namespace, name) { - var attributes = this._attributes[namespace]; - if (attributes) { - delete attributes[name] - } - } - -DOMElement.prototype.hasAttributeNS = - function _Element_hasAttributeNS(namespace, name) { - var attributes = this._attributes[namespace] - return !!attributes && name in attributes; - } - -DOMElement.prototype.setAttribute = function _Element_setAttribute(name, value) { - return this.setAttributeNS(null, name, value) -} - -DOMElement.prototype.getAttribute = function _Element_getAttribute(name) { - return this.getAttributeNS(null, name) -} - -DOMElement.prototype.removeAttribute = function _Element_removeAttribute(name) { - return this.removeAttributeNS(null, name) -} - -DOMElement.prototype.hasAttribute = function _Element_hasAttribute(name) { - return this.hasAttributeNS(null, name) -} - -DOMElement.prototype.removeEventListener = removeEventListener -DOMElement.prototype.addEventListener = addEventListener -DOMElement.prototype.dispatchEvent = dispatchEvent - -// Un-implemented -DOMElement.prototype.focus = function _Element_focus() { - return void 0 -} - -DOMElement.prototype.toString = function _Element_toString() { - return serializeNode(this) -} - -DOMElement.prototype.getElementsByClassName = function _Element_getElementsByClassName(classNames) { - var classes = classNames.split(" "); - var elems = [] - - domWalk(this, function (node) { - if (node.nodeType === 1) { - var nodeClassName = node.className || "" - var nodeClasses = nodeClassName.split(" ") - - if (classes.every(function (item) { - return nodeClasses.indexOf(item) !== -1 - })) { - elems.push(node) - } - } - }) - - return elems -} - -DOMElement.prototype.getElementsByTagName = function _Element_getElementsByTagName(tagName) { - tagName = tagName.toLowerCase() - var elems = [] - - domWalk(this.childNodes, function (node) { - if (node.nodeType === 1 && (tagName === '*' || node.tagName.toLowerCase() === tagName)) { - elems.push(node) - } - }) - - return elems -} - -DOMElement.prototype.contains = function _Element_contains(element) { - return domWalk(this, function (node) { - return element === node - }) || false -} diff --git a/node_modules/min-document/dom-fragment.js b/node_modules/min-document/dom-fragment.js deleted file mode 100644 index d4bac92..0000000 --- a/node_modules/min-document/dom-fragment.js +++ /dev/null @@ -1,28 +0,0 @@ -var DOMElement = require("./dom-element.js") - -module.exports = DocumentFragment - -function DocumentFragment(owner) { - if (!(this instanceof DocumentFragment)) { - return new DocumentFragment() - } - - this.childNodes = [] - this.parentNode = null - this.ownerDocument = owner || null -} - -DocumentFragment.prototype.type = "DocumentFragment" -DocumentFragment.prototype.nodeType = 11 -DocumentFragment.prototype.nodeName = "#document-fragment" - -DocumentFragment.prototype.appendChild = DOMElement.prototype.appendChild -DocumentFragment.prototype.replaceChild = DOMElement.prototype.replaceChild -DocumentFragment.prototype.removeChild = DOMElement.prototype.removeChild - -DocumentFragment.prototype.toString = - function _DocumentFragment_toString() { - return this.childNodes.map(function (node) { - return String(node) - }).join("") - } diff --git a/node_modules/min-document/dom-text.js b/node_modules/min-document/dom-text.js deleted file mode 100644 index 4a6c6b9..0000000 --- a/node_modules/min-document/dom-text.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = DOMText - -function DOMText(value, owner) { - if (!(this instanceof DOMText)) { - return new DOMText(value) - } - - this.data = value || "" - this.length = this.data.length - this.ownerDocument = owner || null -} - -DOMText.prototype.type = "DOMTextNode" -DOMText.prototype.nodeType = 3 -DOMText.prototype.nodeName = "#text" - -DOMText.prototype.toString = function _Text_toString() { - return this.data -} - -DOMText.prototype.replaceData = function replaceData(index, length, value) { - var current = this.data - var left = current.substring(0, index) - var right = current.substring(index + length, current.length) - this.data = left + value + right - this.length = this.data.length -} diff --git a/node_modules/min-document/event.js b/node_modules/min-document/event.js deleted file mode 100644 index 0a989c3..0000000 --- a/node_modules/min-document/event.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = Event - -function Event(family) {} - -Event.prototype.initEvent = function _Event_initEvent(type, bubbles, cancelable) { - this.type = type - this.bubbles = bubbles - this.cancelable = cancelable -} - -Event.prototype.preventDefault = function _Event_preventDefault() { - -} diff --git a/node_modules/min-document/event/add-event-listener.js b/node_modules/min-document/event/add-event-listener.js deleted file mode 100644 index 022c7ef..0000000 --- a/node_modules/min-document/event/add-event-listener.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = addEventListener - -function addEventListener(type, listener) { - var elem = this - - if (!elem.listeners) { - elem.listeners = {} - } - - if (!elem.listeners[type]) { - elem.listeners[type] = [] - } - - if (elem.listeners[type].indexOf(listener) === -1) { - elem.listeners[type].push(listener) - } -} diff --git a/node_modules/min-document/event/dispatch-event.js b/node_modules/min-document/event/dispatch-event.js deleted file mode 100644 index 8febc99..0000000 --- a/node_modules/min-document/event/dispatch-event.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = dispatchEvent - -function dispatchEvent(ev) { - var elem = this - var type = ev.type - - if (!ev.target) { - ev.target = elem - } - - if (!elem.listeners) { - elem.listeners = {} - } - - var listeners = elem.listeners[type] - - if (listeners) { - return listeners.forEach(function (listener) { - ev.currentTarget = elem - if (typeof listener === 'function') { - listener(ev) - } else { - listener.handleEvent(ev) - } - }) - } - - if (elem.parentNode) { - elem.parentNode.dispatchEvent(ev) - } -} diff --git a/node_modules/min-document/event/remove-event-listener.js b/node_modules/min-document/event/remove-event-listener.js deleted file mode 100644 index d96091b..0000000 --- a/node_modules/min-document/event/remove-event-listener.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = removeEventListener - -function removeEventListener(type, listener) { - var elem = this - - if (!elem.listeners) { - return - } - - if (!elem.listeners[type]) { - return - } - - var list = elem.listeners[type] - var index = list.indexOf(listener) - if (index !== -1) { - list.splice(index, 1) - } -} diff --git a/node_modules/min-document/index.js b/node_modules/min-document/index.js deleted file mode 100644 index 0d97e8e..0000000 --- a/node_modules/min-document/index.js +++ /dev/null @@ -1,3 +0,0 @@ -var Document = require('./document.js'); - -module.exports = new Document(); diff --git a/node_modules/min-document/package.json b/node_modules/min-document/package.json deleted file mode 100644 index 0b20b6a..0000000 --- a/node_modules/min-document/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_from": "min-document@^2.19.0", - "_id": "min-document@2.19.0", - "_inBundle": false, - "_integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", - "_location": "/min-document", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "min-document@^2.19.0", - "name": "min-document", - "escapedName": "min-document", - "rawSpec": "^2.19.0", - "saveSpec": null, - "fetchSpec": "^2.19.0" - }, - "_requiredBy": [ - "/global" - ], - "_resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "_shasum": "7bd282e3f5842ed295bb748cdd9f1ffa2c824685", - "_spec": "min-document@^2.19.0", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/global", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/min-document/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Raynos" - } - ], - "dependencies": { - "dom-walk": "^0.1.0" - }, - "deprecated": false, - "description": "A minimal DOM implementation", - "devDependencies": { - "run-browser": "git://github.com/Raynos/run-browser.git", - "tap-dot": "^0.2.1", - "tap-spec": "^0.1.8", - "tape": "^2.12.3" - }, - "homepage": "https://github.com/Raynos/min-document", - "keywords": [], - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/Raynos/min-document/raw/master/LICENSE" - } - ], - "main": "index", - "name": "min-document", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/min-document.git" - }, - "scripts": { - "browser": "run-browser test/index.js", - "cover": "istanbul cover --report none --print detail ./test/index.js", - "dot": "node ./test/index.js | tap-dot", - "phantom": "run-browser test/index.js -b | tap-spec", - "test": "node ./test/index.js | tap-spec", - "view-cover": "istanbul report html && google-chrome ./coverage/index.html" - }, - "testling": { - "files": "test/index.js", - "browsers": [ - "ie/8..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "2.19.0" -} diff --git a/node_modules/min-document/serialize.js b/node_modules/min-document/serialize.js deleted file mode 100644 index 4411d3c..0000000 --- a/node_modules/min-document/serialize.js +++ /dev/null @@ -1,139 +0,0 @@ -module.exports = serializeNode - -var voidElements = ["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]; - -function serializeNode(node) { - switch (node.nodeType) { - case 3: - return escapeText(node.data) - case 8: - return "" - default: - return serializeElement(node) - } -} - -function serializeElement(elem) { - var strings = [] - - var tagname = elem.tagName - - if (elem.namespaceURI === "http://www.w3.org/1999/xhtml") { - tagname = tagname.toLowerCase() - } - - strings.push("<" + tagname + properties(elem) + datasetify(elem)) - - if (voidElements.indexOf(tagname) > -1) { - strings.push(" />") - } else { - strings.push(">") - - if (elem.childNodes.length) { - strings.push.apply(strings, elem.childNodes.map(serializeNode)) - } else if (elem.textContent || elem.innerText) { - strings.push(escapeText(elem.textContent || elem.innerText)) - } else if (elem.innerHTML) { - strings.push(elem.innerHTML) - } - - strings.push("") - } - - return strings.join("") -} - -function isProperty(elem, key) { - var type = typeof elem[key] - - if (key === "style" && Object.keys(elem.style).length > 0) { - return true - } - - return elem.hasOwnProperty(key) && - (type === "string" || type === "boolean" || type === "number") && - key !== "nodeName" && key !== "className" && key !== "tagName" && - key !== "textContent" && key !== "innerText" && key !== "namespaceURI" && key !== "innerHTML" -} - -function stylify(styles) { - if (typeof styles === 'string') return styles - var attr = "" - Object.keys(styles).forEach(function (key) { - var value = styles[key] - key = key.replace(/[A-Z]/g, function(c) { - return "-" + c.toLowerCase(); - }) - attr += key + ":" + value + ";" - }) - return attr -} - -function datasetify(elem) { - var ds = elem.dataset - var props = [] - - for (var key in ds) { - props.push({ name: "data-" + key, value: ds[key] }) - } - - return props.length ? stringify(props) : "" -} - -function stringify(list) { - var attributes = [] - list.forEach(function (tuple) { - var name = tuple.name - var value = tuple.value - - if (name === "style") { - value = stylify(value) - } - - attributes.push(name + "=" + "\"" + escapeAttributeValue(value) + "\"") - }) - - return attributes.length ? " " + attributes.join(" ") : "" -} - -function properties(elem) { - var props = [] - for (var key in elem) { - if (isProperty(elem, key)) { - props.push({ name: key, value: elem[key] }) - } - } - - for (var ns in elem._attributes) { - for (var attribute in elem._attributes[ns]) { - var prop = elem._attributes[ns][attribute] - var name = (prop.prefix ? prop.prefix + ":" : "") + attribute - props.push({ name: name, value: prop.value }) - } - } - - if (elem.className) { - props.push({ name: "class", value: elem.className }) - } - - return props.length ? stringify(props) : "" -} - -function escapeText(s) { - var str = ''; - - if (typeof(s) === 'string') { - str = s; - } else if (s) { - str = s.toString(); - } - - return str - .replace(/&/g, "&") - .replace(//g, ">") -} - -function escapeAttributeValue(str) { - return escapeText(str).replace(/"/g, """) -} diff --git a/node_modules/min-document/test/cleanup.js b/node_modules/min-document/test/cleanup.js deleted file mode 100644 index d3ae66a..0000000 --- a/node_modules/min-document/test/cleanup.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = Cleanup - -function Cleanup (document) { - - return cleanup - - function cleanup () { - var childNodes = document.body.childNodes - for (var i = 0; i < childNodes.length; i++) { - document.body.removeChild(childNodes[i]) - } - } -} diff --git a/node_modules/min-document/test/index.js b/node_modules/min-document/test/index.js deleted file mode 100644 index 14b736a..0000000 --- a/node_modules/min-document/test/index.js +++ /dev/null @@ -1,14 +0,0 @@ -var testDocument = require("./test-document") -var testDomElement = require("./test-dom-element") -var testDomComment = require("./test-dom-comment") -var document = require("../index") - -testDocument(document) -testDomElement(document) -testDomComment(document) - -if (typeof window !== "undefined" && window.document) { - testDocument(window.document) - testDomElement(window.document) - testDomComment(window.document) -} diff --git a/node_modules/min-document/test/static/index.html b/node_modules/min-document/test/static/index.html deleted file mode 100644 index 60f6ef8..0000000 --- a/node_modules/min-document/test/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - TAPE Example - - - - - - - diff --git a/node_modules/min-document/test/static/test-adapter.js b/node_modules/min-document/test/static/test-adapter.js deleted file mode 100644 index c512792..0000000 --- a/node_modules/min-document/test/static/test-adapter.js +++ /dev/null @@ -1,49 +0,0 @@ -(function () { - var Testem = window.Testem - var regex = /^((?:not )?ok) (\d+) (.+)$/ - - Testem.useCustomAdapter(tapAdapter) - - function tapAdapter(socket){ - var results = { - failed: 0 - , passed: 0 - , total: 0 - , tests: [] - } - - socket.emit('tests-start') - - Testem.handleConsoleMessage = function(msg){ - var m = msg.match(regex) - if (m) { - var passed = m[1] === 'ok' - var test = { - passed: passed ? 1 : 0, - failed: passed ? 0 : 1, - total: 1, - id: m[2], - name: m[3], - items: [] - } - - if (passed) { - results.passed++ - } else { - results.failed++ - } - - results.total++ - - socket.emit('test-result', test) - results.tests.push(test) - } else if (msg === '# ok' || msg.match(/^# tests \d+/)){ - socket.emit('all-test-results', results) - } - - // return false if you want to prevent the console message from - // going to the console - // return false - } - } -}()) diff --git a/node_modules/min-document/test/test-document.js b/node_modules/min-document/test/test-document.js deleted file mode 100644 index 282d9df..0000000 --- a/node_modules/min-document/test/test-document.js +++ /dev/null @@ -1,564 +0,0 @@ -var test = require("tape") - -module.exports = testDocument - -function testDocument(document) { - var cleanup = require('./cleanup')(document) - var Event = require('../event'); - - test("document is a Document", function (assert) { - assert.equal(typeof document.createTextNode, "function") - assert.equal(typeof document.createElement, "function") - assert.equal(typeof document.createDocumentFragment, "function") - - assert.end() - }) - - test("document has a head property", function(assert) { - assert.equal(document.head.tagName, "HEAD") - assert.end() - }) - - test("document has nodeType 9", function (assert) { - assert.equal(document.nodeType, 9) - assert.end() - }) - - test("can do stuff", function (assert) { - var div = document.createElement("div") - div.className = "foo bar" - - var span = document.createElement("span") - div.appendChild(span) - span.textContent = "Hello! <&>" - - var html = String(div.outerHTML || div) - - assert.equal(html, "
" + - "Hello! <&>
") - - cleanup() - assert.end() - }) - - test("can createDocumentFragment", function (assert) { - var frag = document.createDocumentFragment() - - assert.equal(frag.nodeType, 11) - - var h1 = document.createElement("h1") - var h2 = document.createElement("h2") - - assert.equal(h1.nodeType, 1) - assert.equal(h1.nodeType, 1) - - frag.appendChild(h1) - assert.equal(fragString(frag), "

") - - frag.appendChild(h2) - assert.equal(fragString(frag), "

") - - frag.removeChild(h1) - assert.equal(fragString(frag), "

") - - frag.replaceChild(h1, h2) - assert.equal(fragString(frag), "

") - - cleanup() - assert.end() - }) - - test("can getElementById", function (assert) { - - function append_div(id, parent) { - var div = document.createElement("div") - div.id = id - parent.appendChild(div) - return div - } - - var div1 = append_div(1, document.body) - var div2 = append_div(2, document.body) - var div3 = append_div(3, document.body) - - var div11 = append_div(11, div1) - var div12 = append_div(12, div1) - var div21 = append_div(21, div2) - var div22 = append_div(22, div2) - var div221 = append_div(221, div22) - var div222 = append_div(222, div22) - - assert.equal(document.getElementById(1), div1) - assert.equal(document.getElementById("2"), div2) - assert.equal(document.getElementById(3), div3) - assert.equal(document.getElementById(11), div11) - assert.equal(document.getElementById(12), div12) - assert.equal(document.getElementById(21), div21) - assert.equal(document.getElementById(22), div22) - assert.equal(document.getElementById(221), div221) - assert.equal(document.getElementById(222), div222) - - cleanup() - assert.end() - }) - - test("can getElementsByClassName for a single class", function(assert) { - function append_div(className, parent) { - var div = document.createElement("div") - div.className = className - parent.appendChild(div) - return div - } - - function assertSingleMatch(className, expectedElement) { - var result = document.getElementsByClassName(className) - assert.equal(result.length, 1) - assert.equal(result[0], expectedElement) - } - - var divA = append_div("A", document.body) - var divB = append_div("B", document.body) - var divC = append_div("C", document.body) - - var divA1 = append_div("A1", divA) - var divA2 = append_div("A2", divA) - var divB1 = append_div("B1", divB) - var divB2 = append_div("B2", divB) - var divB2a = append_div("B2a", divB2) - var divB2b = append_div("B2b", divB2) - - assertSingleMatch("A", divA) - assertSingleMatch("B", divB) - assertSingleMatch("C", divC) - assertSingleMatch("A1", divA1) - assertSingleMatch("A2", divA2) - assertSingleMatch("B1", divB1) - assertSingleMatch("B2", divB2) - assertSingleMatch("B2a", divB2a) - assertSingleMatch("B2b", divB2b) - - cleanup() - assert.end() - }) - - test("can getElementsByClassName for many elements", function (assert) { - function h(className) { - var div = document.createElement("div") - div.className = className - return div - } - - document.body.appendChild(h("multi-class-bar")) - document.body.appendChild(h("multi-class-bar")) - - var elems = document.getElementsByClassName("multi-class-bar") - assert.equal(elems.length, 2) - - cleanup() - assert.end() - }) - - test("can getElementsByClassName for many classes", function(assert) { - function append_div(classNames, parent) { - var div = document.createElement("div") - div.className = classNames - parent.appendChild(div) - return div - } - - function assertMatch(classNames, expectedElements) { - var result = document.getElementsByClassName(classNames) - assert.equal(result.length, expectedElements.length) - for (var i = 0; i < expectedElements.length; i++) { - assert.notEqual(expectedElements.indexOf(result[i]), -1) - } - } - - var divXYZ = append_div("X Y Z", document.body) - var divYZ = append_div("Y Z", document.body) - var divZX = append_div("Z X", document.body) - - var divX1X2 = append_div("X1 X2", divXYZ) - var divX1X2Y1 = append_div("X1 X2 Y1", divXYZ) - - - assertMatch("X", [divXYZ, divZX]) - assertMatch("Y Z", [divXYZ, divYZ]) - assertMatch("X Y Z", [divXYZ]) - assertMatch("X1 X2", [divX1X2, divX1X2Y1]) - - cleanup() - assert.end() - }) - - test("can create/manipulate textnodes", function (assert) { - var textnode = document.createTextNode("hello") - - assert.equal(textnode.nodeType, 3) - assert.equal(textnode.data, "hello") - assert.equal(typeof textnode.replaceData, "function") - - textnode.replaceData(0, 7, "nightly") - assert.equal(textnode.nodeType, 3) - assert.equal(textnode.data, "nightly") - assert.equal(typeof textnode.replaceData, "function") - - textnode.replaceData(1, 1, "ou") - assert.equal(textnode.nodeType, 3) - assert.equal(textnode.data, "noughtly") - - assert.end() - }) - - test("owner document is set", function (assert) { - var textnode = document.createTextNode("hello") - var domnode = document.createElement("div") - var fragment = document.createDocumentFragment() - - assert.equal(textnode.ownerDocument, document) - assert.equal(domnode.ownerDocument, document) - assert.equal(fragment.ownerDocument, document) - - assert.end() - }) - - test("Create namespaced nodes", function (assert) { - var svgURI = "http://www.w3.org/2000/svg" - var htmlURI = "http://www.w3.org/1999/xhtml" - - var noNS = document.createElement("div") - var svgNS = document.createElementNS(svgURI, "svg") - var emptyNS = document.createElementNS("", "div") - var nullNS = document.createElementNS(null, "div") - var undefNS = document.createElementNS(undefined, "div") - var caseNS = document.createElementNS("Oops", "AbC") - var htmlNS = document.createElement("div") - - assert.equal(noNS.tagName, "DIV") - assert.equal(noNS.namespaceURI, htmlURI) - assert.equal(elemString(noNS), "
") - - assert.equal(svgNS.tagName, "svg") - assert.equal(svgNS.namespaceURI, svgURI) - assert.equal(elemString(svgNS), "") - - assert.equal(emptyNS.tagName, "div") - assert.equal(emptyNS.namespaceURI, null) - assert.equal(elemString(emptyNS), "
") - - assert.equal(nullNS.tagName, "div") - assert.equal(nullNS.namespaceURI, null) - assert.equal(elemString(nullNS), "
") - - assert.equal(undefNS.tagName, "div") - assert.equal(undefNS.namespaceURI, "undefined") - assert.equal(elemString(undefNS), "
") - - assert.equal(caseNS.tagName, "AbC") - assert.equal(caseNS.namespaceURI, "Oops") - assert.equal(elemString(caseNS), "") - - assert.equal(htmlNS.tagName, "DIV") - assert.equal(htmlNS.namespaceURI, htmlURI) - assert.equal(elemString(htmlNS), "
") - - assert.end() - }) - - test("Can insert before", function (assert) { - var rootNode = document.createElement("div") - var child = document.createElement("div") - var newElement = document.createElement("div") - rootNode.appendChild(child) - var el = rootNode.insertBefore(newElement, child) - assert.equal(el, newElement) - assert.equal(rootNode.childNodes.length, 2) - assert.equal(rootNode.childNodes[0], newElement) - assert.equal(rootNode.childNodes[1], child) - cleanup() - assert.end() - }) - - test("Insert before null appends to end", function (assert) { - var rootNode = document.createElement("div") - var child = document.createElement("div") - var newElement = document.createElement("div") - rootNode.appendChild(child) - var el = rootNode.insertBefore(newElement, null) - assert.equal(el, newElement) - assert.equal(rootNode.childNodes.length, 2) - assert.equal(rootNode.childNodes[0], child) - assert.equal(rootNode.childNodes[1], newElement) - cleanup() - assert.end() - }) - - test("Node insertions remove node from parent", function (assert) { - var parent = document.createElement("div") - var c1 = document.createElement("div") - var c2 = document.createElement("div") - var c3 = document.createElement("div") - parent.appendChild(c1) - parent.appendChild(c2) - parent.appendChild(c3) - - var rootNode = document.createElement("div") - - var node1 = rootNode.appendChild(c1) - assert.equal(node1, c1) - assert.equal(parent.childNodes.length, 2) - assert.equal(c1.parentNode, rootNode) - - var node2 = rootNode.insertBefore(c2, c1) - assert.equal(node2, c2) - assert.equal(parent.childNodes.length, 1) - assert.equal(c2.parentNode, rootNode) - - var node3 = rootNode.replaceChild(c3, c2) - assert.equal(node3, c2) - assert.equal(parent.childNodes.length, 0) - assert.equal(c3.parentNode, rootNode) - assert.equal(c2.parentNode, null) - - cleanup() - assert.end() - }) - - test("input has type=text by default", function (assert) { - var elem = document.createElement("input") - assert.equal(elem.getAttribute("type"), "text"); - assert.equal(elemString(elem), "") - assert.end() - }) - - test("input type=text can be overridden", function (assert) { - var elem = document.createElement("input") - elem.setAttribute("type", "hidden") - assert.equal(elem.getAttribute("type"), "hidden"); - assert.equal(elemString(elem), "") - assert.end() - }) - - test("can set and get attributes", function (assert) { - var elem = document.createElement("div") - assert.equal(elem.getAttribute("foo"), null) - assert.equal(elemString(elem), "
") - assert.notOk(elem.hasAttribute('foo')) - - elem.setAttribute("foo", "bar") - assert.equal(elem.getAttribute("foo"), "bar") - assert.equal(elemString(elem), "
") - assert.ok(elem.hasAttribute('foo')) - - elem.removeAttribute("foo") - assert.equal(elem.getAttribute("foo"), null) - assert.equal(elemString(elem), "
") - assert.notOk(elem.hasAttribute('foo')) - - assert.end() - }) - - test("can set and set style properties", function(assert) { - var elem = document.createElement("div") - assert.equal(elemString(elem), "
") - - elem.style.color = "red"; - assert.equal(elem.style.color, "red") - assert.equal(elemString(elem), "
") - - elem.style.background = "blue"; - assert.equal(elem.style.color, "red") - assert.equal(elem.style.background, "blue") - assert.equal(elemString(elem), - "
") - - assert.end() - }) - - test("can set and get namespaced attributes", function(assert) { - var elem = document.createElement("div") - - var ns = "http://ns.com/my" - assert.equal(elem.getAttributeNS(ns, "myattr"), blankAttributeNS()) - elem.setAttributeNS(ns, "myns:myattr", "the value") - assert.equal(elem.getAttributeNS(ns, "myattr"), "the value") - assert.equal(elemString(elem), '
') - elem.removeAttributeNS(ns, "myattr") - assert.equal(elem.getAttributeNS(ns, "myattr"), blankAttributeNS()) - - // Should work much like get/setAttribute when namespace is null. - assert.equal(elem.getAttributeNS(null, "foo"), blankAttributeNS()) - assert.equal(elem.getAttribute("foo"), null) - elem.setAttributeNS(null, "foo", "bar") - assert.equal(elem.getAttributeNS(null, "foo"), "bar") - assert.equal(elem.getAttribute("foo"), "bar") - elem.removeAttributeNS(null, "foo") - assert.equal(elem.getAttributeNS(null, "foo"), blankAttributeNS()) - assert.equal(elem.getAttribute("foo"), null) - assert.end() - }) - - test("can getElementsByTagName", function(assert) { - var parent = document.createElement("div") - var child1 = document.createElement("span") - var child2 = document.createElement("span") - - child1.id = "foo" - child2.id = "bar" - - child1.appendChild(child2) - parent.appendChild(child1) - document.body.appendChild(parent) - - var elems = document.getElementsByTagName("SPAN") - - assert.equal(elems.length, 2) - assert.equal(elems[0].id, "foo") - assert.equal(elems[1].id, "bar") - - cleanup() - assert.end() - }) - - test("can getElementsByTagName with *", function(assert) { - document.body.appendChild(document.createElement("div")) - - var elems = document.getElementsByTagName("*") - - assert.equal(elems.length, 4) - assert.equal(elems[0].tagName, "HTML") - assert.equal(elems[1].tagName, "HEAD") - assert.equal(elems[2].tagName, "BODY") - assert.equal(elems[3].tagName, "DIV") - - cleanup() - assert.end() - }) - - test("getElement* methods search outside the body", function(assert) { - var html = document.documentElement; - assert.equal(document.getElementsByTagName("html")[0], html) - - html.id = "foo" - assert.equal(document.getElementById("foo"), html) - - html.className = "bar" - assert.equal(document.getElementsByClassName("bar")[0], html) - - // cleanup - html.id = "" - html.className = "" - - cleanup() - assert.end() - }) - - test("getElement* methods can be passed to map()", function(assert) { - var e1 = document.createElement("div") - var e2 = document.createElement("span") - - document.body.appendChild(e1) - document.body.appendChild(e2) - - assert.deepEqual( - ["div", "span"].map(document.getElementsByTagName.bind(document)), - [[e1], [e2]] - ) - - e1.id = "1" - e2.id = "2" - - assert.deepEqual( - ["1", "2"].map(document.getElementById.bind(document)), - [e1, e2] - ) - - e1.className = "foo" - e2.className = "bar" - - assert.deepEqual( - ["foo", "bar"].map(document.getElementsByClassName.bind(document)), - [[e1], [e2]] - ) - - cleanup() - assert.end() - }) - - test("can check if it contains an element", function(assert) { - var el = document.createElement("div") - document.body.appendChild(el) - - assert.equals(document.contains(document.body), true) - assert.equals(document.contains(el), true) - - cleanup() - assert.end() - }) - - test("can do events", function (assert) { - var x = 1 - function incx() { x++ } - - var ev = new Event(); - ev.initEvent("click"); - document.addEventListener("click", incx) - document.dispatchEvent(ev) - - assert.equal(x, 2) - - document.removeEventListener("click", incx) - document.dispatchEvent(ev) - - assert.equal(x, 2) - assert.end() - }) - - function blankAttributeNS() { - // Most browsers conform to the latest version of the DOM spec, - // which requires `getAttributeNS` to return `null` when the attribute - // doesn't exist, but some browsers (including phantomjs) implement the - // old version of the spec and return an empty string instead, see: - // https://developer.mozilla.org/en-US/docs/Web/API/element.getAttributeNS#Return_value - var div = document.createElement("div") - var blank = div.getAttributeNS(null, "foo") - if (!(blank === null || blank === "")) { - throw "Expected blank attribute to be either null or empty string" - } - return blank; - } - - function elemString(element) { - var html = String(element) || "[]" - - if (html.charAt(0) === "[") { - html = element.outerHTML - if (!html && !element.parentNode) { - var div = document.createElement("div") - div.appendChild(element) - html = div.innerHTML - div.removeChild(element) - } - } - - return html - } - - function fragString(fragment) { - var html = String(fragment) - - - if (html === "[object DocumentFragment]") { - var innerHTML = [] - for (var i = 0; i < fragment.childNodes.length; i++) { - var node = fragment.childNodes[i] - innerHTML.push(String(node.outerHTML || node)) - } - html = innerHTML.join("") - } - - return html - } -} - - diff --git a/node_modules/min-document/test/test-dom-comment.js b/node_modules/min-document/test/test-dom-comment.js deleted file mode 100644 index 7ecf175..0000000 --- a/node_modules/min-document/test/test-dom-comment.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require("tape") - -module.exports = testDomComment - -function testDomComment(document) { - var cleanup = require('./cleanup')(document) - - test("can createComment", function(assert) { - var comment = document.createComment("test") - assert.equal(comment.data, "test") - assert.equal(comment.length, 4) - assert.equal(comment.nodeName, "#comment") - assert.equal(comment.nodeType, 8) - assert.equal(comment.nodeValue, "test") - assert.equal(comment.ownerDocument, document) - assert.equal(comment.toString(), "[object Comment]") - cleanup() - assert.end() - }) -} diff --git a/node_modules/min-document/test/test-dom-element.js b/node_modules/min-document/test/test-dom-element.js deleted file mode 100644 index b7f2baa..0000000 --- a/node_modules/min-document/test/test-dom-element.js +++ /dev/null @@ -1,219 +0,0 @@ -var test = require("tape") - -module.exports = testDomElement - -function testDomElement(document) { - - var cleanup = require('./cleanup')(document) - - test("can getElementsByClassName", function(assert) { - function append_div(classNames, parent) { - var div = document.createElement("div") - div.className = classNames - parent.appendChild(div) - return div - } - - function assertMatch(classNames, expectedElements, parent) { - var parent = parent || document - var result = parent.getElementsByClassName(classNames) - assert.equal(result.length, expectedElements.length) - for (var i = 0; i < expectedElements.length; i++) { - assert.notEqual(expectedElements.indexOf(result[i]), -1) - } - } - - var divA = append_div("A", document.body) - var divB = append_div("B", document.body) - var divC = append_div("C", document.body) - - var divA1 = append_div("A1", divA) - var divA2 = append_div("A2", divA) - var divB1 = append_div("B1", divB) - var divB2 = append_div("B2", divB) - var divB2a = append_div("B2a", divB2) - var divB2b = append_div("B2b", divB2) - - assertMatch("A", [divA]) - assertMatch("B", [divB]) - assertMatch("C", [divC]) - assertMatch("A1", [divA1]) - assertMatch("A2", [divA2]) - assertMatch("B1", [divB1]) - assertMatch("B2", [divB2]) - assertMatch("B2a", [divB2a]) - assertMatch("B2b", [divB2b]) - - assertMatch("A1", [divA1], divA) - assertMatch("A2", [divA2], divA) - assertMatch("A1", [], divB) - assertMatch("A2", [], divC) - assertMatch("B1", [divB1], divB) - assertMatch("B2", [divB2], divB) - assertMatch("B2a", [divB2a], divB) - assertMatch("B2a", [divB2a], divB2) - assertMatch("B2b", [], divA) - - cleanup() - assert.end() - }) - - test("does not serialize innerText as an attribute", function(assert) { - var div = document.createElement("div") - div.innerText = "Test <&>" - assert.equal(div.toString(), "
Test <&>
") - cleanup() - assert.end() - }) - - test("does not serialize innerHTML as an attribute", function(assert) { - var div = document.createElement("div") - div.innerHTML = "Test " - assert.equal(div.toString(), "
Test
") - cleanup() - assert.end() - }) - - test("can getElementsByTagName", function(assert) { - var parent = document.createElement("div") - var child1 = document.createElement("span") - var child2 = document.createElement("span") - - child1.id = "foo" - child2.id = "bar" - - child1.appendChild(child2) - parent.appendChild(child1) - - var elems = parent.getElementsByTagName("SPAN") - - assert.equal(elems.length, 2) - assert.equal(elems[0].id, "foo") - assert.equal(elems[1].id, "bar") - - cleanup() - assert.end() - }) - - test("can getElementsByTagName with *", function(assert) { - var e1 = document.createElement("div") - var e2 = document.createElement("p") - var e3 = document.createElement("span") - - e1.appendChild(e2) - e2.appendChild(e3) - // non-elements should be ignored - e3.appendChild(document.createTextNode('foo')) - e3.appendChild(document.createComment('bar')) - - var elems = e1.getElementsByTagName("*") - - assert.equal(elems.length, 2) - assert.equal(elems[0].tagName, "P") - assert.equal(elems[1].tagName, "SPAN") - - cleanup() - assert.end() - }) - - test("getElement* methods can be passed to map()", function(assert) { - var container = document.createElement("div") - var e1 = document.createElement("div") - var e2 = document.createElement("span") - container.appendChild(e1) - container.appendChild(e2) - - assert.deepEqual( - ["div", "span"].map(container.getElementsByTagName.bind(container)), - [[e1], [e2]] - ) - - e1.className = "foo" - e2.className = "bar" - - assert.deepEqual( - ["foo", "bar"].map(container.getElementsByClassName.bind(container)), - [[e1], [e2]] - ) - - cleanup() - assert.end() - }) - - test("can serialize comment nodes", function(assert) { - var div = document.createElement("div") - div.appendChild(document.createComment("test")) - assert.equal(div.toString(), "
") - cleanup() - assert.end() - }) - - test("can serialize style property", function(assert) { - var div = document.createElement("div") - div.style.fontSize = "16px" - assert.equal(div.toString(), "
") - cleanup(); - assert.end() - }) - - test("can serialize style as a string", function(assert) { - var div = document.createElement("div") - div.setAttribute('style', 'display: none') - assert.equal(div.toString(), "
") - cleanup() - assert.end() - }) - - test("can serialize text nodes", function(assert) { - var div = document.createElement("div") - div.appendChild(document.createTextNode(' "&')) - assert.equal(div.toString(), '
<test> "&
') - cleanup() - assert.end() - }) - - test("escapes serialized attribute values", function(assert) { - var div = document.createElement("div") - div.setAttribute("data-foo", '

"&') - assert.equal(div.toString(), '

') - cleanup() - assert.end() - }) - - test("can check if an element contains another", function(assert) { - var parent = document.createElement("div") - var sibling = document.createElement("div") - var child1 = document.createElement("div") - var child2 = document.createElement("div") - - child1.appendChild(child2) - parent.appendChild(child1) - - assert.equal(parent.contains(parent), true) - assert.equal(parent.contains(sibling), false) - assert.equal(parent.contains(child1), true) - assert.equal(parent.contains(child2), true) - - cleanup() - assert.end() - }) - - test("can handle non string attribute values", function(assert) { - var div = document.createElement("div") - div.setAttribute("data-number", 100) - div.setAttribute("data-boolean", true) - div.setAttribute("data-null", null) - assert.equal(div.toString(), '
') - cleanup() - assert.end() - }) - - test("can serialize textarea correctly", function(assert) { - var input = document.createElement("textarea") - input.setAttribute("name", "comment") - input.innerHTML = "user input here" - assert.equal(input.toString(), '') - cleanup() - assert.end() - }) -} diff --git a/node_modules/parse-headers/.travis.yml b/node_modules/parse-headers/.travis.yml deleted file mode 100644 index 851fb95..0000000 --- a/node_modules/parse-headers/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: -- node diff --git a/node_modules/parse-headers/LICENCE b/node_modules/parse-headers/LICENCE deleted file mode 100644 index 6ca87bb..0000000 --- a/node_modules/parse-headers/LICENCE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2014 David Björklund - -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/parse-headers/example.js b/node_modules/parse-headers/example.js deleted file mode 100644 index 1b02863..0000000 --- a/node_modules/parse-headers/example.js +++ /dev/null @@ -1,11 +0,0 @@ -var parse = require('./parse-headers') - - , headers = [ - 'Date: Sun, 17 Aug 2014 16:24:52 GMT' - , 'Content-Type: text/html; charset=utf-8' - , 'Transfer-Encoding: chunked' - , 'X-Custom-Header: beep' - , 'X-Custom-Header: boop' - ].join('\n') - -console.log(parse(headers)) \ No newline at end of file diff --git a/node_modules/parse-headers/package.json b/node_modules/parse-headers/package.json deleted file mode 100644 index d922026..0000000 --- a/node_modules/parse-headers/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "_from": "parse-headers@^2.0.0", - "_id": "parse-headers@2.0.3", - "_inBundle": false, - "_integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==", - "_location": "/parse-headers", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "parse-headers@^2.0.0", - "name": "parse-headers", - "escapedName": "parse-headers", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/xhr" - ], - "_resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", - "_shasum": "5e8e7512383d140ba02f0c7aa9f49b4399c92515", - "_spec": "parse-headers@^2.0.0", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/xhr", - "author": { - "name": "David Björklund", - "email": "david.bjorklund@gmail.com" - }, - "bugs": { - "url": "https://github.com/kesla/parse-headers/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Parse http headers, works with browserify/xhr", - "devDependencies": { - "tape": "^4.10.1" - }, - "homepage": "https://github.com/kesla/parse-headers", - "keywords": [ - "http", - "headers" - ], - "license": "MIT", - "main": "parse-headers.js", - "name": "parse-headers", - "repository": { - "type": "git", - "url": "git+https://github.com/kesla/parse-headers.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "2.0.3" -} diff --git a/node_modules/parse-headers/parse-headers.js b/node_modules/parse-headers/parse-headers.js deleted file mode 100644 index 0d51e70..0000000 --- a/node_modules/parse-headers/parse-headers.js +++ /dev/null @@ -1,32 +0,0 @@ -var trim = function(string) { - return string.replace(/^\s+|\s+$/g, ''); -} - , isArray = function(arg) { - return Object.prototype.toString.call(arg) === '[object Array]'; - } - -module.exports = function (headers) { - if (!headers) - return {} - - var result = {} - - var headersArr = trim(headers).split('\n') - - for (var i = 0; i < headersArr.length; i++) { - var row = headersArr[i] - var index = row.indexOf(':') - , key = trim(row.slice(0, index)).toLowerCase() - , value = trim(row.slice(index + 1)) - - if (typeof(result[key]) === 'undefined') { - result[key] = value - } else if (isArray(result[key])) { - result[key].push(value) - } else { - result[key] = [ result[key], value ] - } - } - - return result -} diff --git a/node_modules/parse-headers/readme.md b/node_modules/parse-headers/readme.md deleted file mode 100644 index 7c40247..0000000 --- a/node_modules/parse-headers/readme.md +++ /dev/null @@ -1,70 +0,0 @@ -# parse-headers[![build status](https://secure.travis-ci.org/kesla/parse-headers.svg)](http://travis-ci.org/kesla/parse-headers) - -Parse http headers, works with browserify/xhr - -[![NPM](https://nodei.co/npm/parse-headers.png?downloads&stars)](https://nodei.co/npm/parse-headers/) - -[![NPM](https://nodei.co/npm-dl/parse-headers.png)](https://nodei.co/npm/parse-headers/) - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/kesla-xhr-headers.svg)](https://saucelabs.com/u/kesla-xhr-headers) - -## Installation - -``` -npm install parse-headers -``` - -## Example - -### Input - -```javascript -var parse = require('./parse-headers') - - , headers = [ - 'Date: Sun, 17 Aug 2014 16:24:52 GMT' - , 'Content-Type: text/html; charset=utf-8' - , 'Transfer-Encoding: chunked' - , 'X-Custom-Header: beep' - , 'X-Custom-Header: boop' - ].join('\n') - -console.log(parse(headers)) -``` - -### Output - -``` -{ date: 'Sun, 17 Aug 2014 16:24:52 GMT', - 'content-type': 'text/html; charset=utf-8', - 'transfer-encoding': 'chunked', - 'x-custom-header': [ 'beep', 'boop' ] } -``` - -## Kudos - -Looked at https://github.com/watson/http-headers before creating this. - -## Licence - -Copyright (c) 2014 David Björklund - -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/parse-headers/test.js b/node_modules/parse-headers/test.js deleted file mode 100644 index b324ced..0000000 --- a/node_modules/parse-headers/test.js +++ /dev/null @@ -1,70 +0,0 @@ -var test = require('tape') - , parse = require('./parse-headers') - - , headers1 = [ - '' - , 'Date: Sun, 17 Aug 2014 16:24:52 GMT' - , 'Content-Type: text/html; charset=utf-8' - , 'Transfer-Encoding: chunked' - , '' - ] - , headers2 = [ - '' - , 'Date: Sun, 17 Aug 2014 16:24:52 GMT' - , 'Content-Type: text/html; charset=utf-8' - , 'Transfer-Encoding: chunked' - , 'Set-Cookie: Foo' - , 'set-Cookie: bar' - , 'set-cookie: bong' - ] - -test('sanity check', function (t) { - - t.deepEqual(parse(), {}) - t.deepEqual(parse(''), {}) - t.end() -}) - -test('simple', function (t) { - t.deepEqual( - parse(headers1.join('\r\n')) - , { - date: 'Sun, 17 Aug 2014 16:24:52 GMT' - , 'content-type': 'text/html; charset=utf-8' - , 'transfer-encoding': 'chunked' - } - ) - t.deepEqual( - parse(headers1.join('\n')) - , { - date: 'Sun, 17 Aug 2014 16:24:52 GMT' - , 'content-type': 'text/html; charset=utf-8' - , 'transfer-encoding': 'chunked' - } - ) - - t.end() -}) - -test('duplicate keys', function (t) { - t.deepEqual( - parse(headers2.join('\r\n')) - , { - date: 'Sun, 17 Aug 2014 16:24:52 GMT' - , 'content-type': 'text/html; charset=utf-8' - , 'transfer-encoding': 'chunked' - , 'set-cookie': [ 'Foo', 'bar', 'bong' ] - } - ) - t.deepEqual( - parse(headers2.join('\n')) - , { - date: 'Sun, 17 Aug 2014 16:24:52 GMT' - , 'content-type': 'text/html; charset=utf-8' - , 'transfer-encoding': 'chunked' - , 'set-cookie': [ 'Foo', 'bar', 'bong' ] - } - ) - - t.end() -}) \ No newline at end of file diff --git a/node_modules/parse-headers/yarn.lock b/node_modules/parse-headers/yarn.lock deleted file mode 100644 index f365b05..0000000 --- a/node_modules/parse-headers/yarn.lock +++ /dev/null @@ -1,253 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -deep-equal@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" - integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= - -define-properties@^1.1.2, define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -defined@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= - -es-abstract@^1.5.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.0.tgz#d3a26dc9c3283ac9750dca569586e976d9dcc06d" - integrity sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.0" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-inspect "^1.6.0" - object-keys "^1.1.1" - string.prototype.trimleft "^2.1.0" - string.prototype.trimright "^2.1.0" - -es-to-primitive@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -for-each@~0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" - integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== - dependencies: - is-callable "^1.1.3" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -glob@~7.1.4: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= - -has@^1.0.1, has@^1.0.3, has@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@~2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-callable@^1.1.3, is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= - dependencies: - has "^1.0.1" - -is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== - dependencies: - has-symbols "^1.0.0" - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -object-inspect@^1.6.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-inspect@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" - integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== - -object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -resolve@~1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" - integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== - dependencies: - path-parse "^1.0.6" - -resumer@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= - dependencies: - through "~2.3.4" - -string.prototype.trim@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" - integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.0" - function-bind "^1.0.2" - -string.prototype.trimleft@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" - integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -string.prototype.trimright@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" - integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -tape@^4.10.1: - version "4.11.0" - resolved "https://registry.yarnpkg.com/tape/-/tape-4.11.0.tgz#63d41accd95e45a23a874473051c57fdbc58edc1" - integrity sha512-yixvDMX7q7JIs/omJSzSZrqulOV51EC9dK8dM0TzImTIkHWfe2/kFyL5v+d9C+SrCMaICk59ujsqFAVidDqDaA== - dependencies: - deep-equal "~1.0.1" - defined "~1.0.0" - for-each "~0.3.3" - function-bind "~1.1.1" - glob "~7.1.4" - has "~1.0.3" - inherits "~2.0.4" - minimist "~1.2.0" - object-inspect "~1.6.0" - resolve "~1.11.1" - resumer "~0.0.0" - string.prototype.trim "~1.1.2" - through "~2.3.8" - -through@~2.3.4, through@~2.3.8: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/node_modules/process/.eslintrc b/node_modules/process/.eslintrc deleted file mode 100644 index 1e7aab7..0000000 --- a/node_modules/process/.eslintrc +++ /dev/null @@ -1,21 +0,0 @@ -{ -extends: "eslint:recommended", - "env": { - "node": true, - "browser": true, - "es6" : true, - "mocha": true - }, - "rules": { - "indent": [2, 4], - "brace-style": [2, "1tbs"], - "quotes": [2, "single"], - "no-console": 0, - "no-shadow": 0, - "no-use-before-define": [2, "nofunc"], - "no-underscore-dangle": 0, - "no-constant-condition": 0, - "space-after-function-name": 0, - "consistent-return": 0 - } -} diff --git a/node_modules/process/LICENSE b/node_modules/process/LICENSE deleted file mode 100644 index b8c1246..0000000 --- a/node_modules/process/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 Roman Shtylman - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/process/README.md b/node_modules/process/README.md deleted file mode 100644 index 6570729..0000000 --- a/node_modules/process/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# process - -```require('process');``` just like any other module. - -Works in node.js and browsers via the browser.js shim provided with the module. - -## browser implementation - -The goal of this module is not to be a full-fledged alternative to the builtin process module. This module mostly exists to provide the nextTick functionality and little more. We keep this module lean because it will often be included by default by tools like browserify when it detects a module has used the `process` global. - -It also exposes a "browser" member (i.e. `process.browser`) which is `true` in this implementation but `undefined` in node. This can be used in isomorphic code that adjusts it's behavior depending on which environment it's running in. - -If you are looking to provide other process methods, I suggest you monkey patch them onto the process global in your app. A list of user created patches is below. - -* [hrtime](https://github.com/kumavis/browser-process-hrtime) -* [stdout](https://github.com/kumavis/browser-stdout) - -## package manager notes - -If you are writing a bundler to package modules for client side use, make sure you use the ```browser``` field hint in package.json. - -See https://gist.github.com/4339901 for details. - -The [browserify](https://github.com/substack/node-browserify) module will properly handle this field when bundling your files. - - diff --git a/node_modules/process/browser.js b/node_modules/process/browser.js deleted file mode 100644 index d059362..0000000 --- a/node_modules/process/browser.js +++ /dev/null @@ -1,184 +0,0 @@ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; diff --git a/node_modules/process/index.js b/node_modules/process/index.js deleted file mode 100644 index 8d8ed7d..0000000 --- a/node_modules/process/index.js +++ /dev/null @@ -1,2 +0,0 @@ -// for now just expose the builtin process global from node.js -module.exports = global.process; diff --git a/node_modules/process/package.json b/node_modules/process/package.json deleted file mode 100644 index c6887da..0000000 --- a/node_modules/process/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "process@^0.11.10", - "_id": "process@0.11.10", - "_inBundle": false, - "_integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "_location": "/process", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "process@^0.11.10", - "name": "process", - "escapedName": "process", - "rawSpec": "^0.11.10", - "saveSpec": null, - "fetchSpec": "^0.11.10" - }, - "_requiredBy": [ - "/global" - ], - "_resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "_shasum": "7332300e840161bda3e69a1d1d91a7d4bc16f182", - "_spec": "process@^0.11.10", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/global", - "author": { - "name": "Roman Shtylman", - "email": "shtylman@gmail.com" - }, - "browser": "./browser.js", - "bugs": { - "url": "https://github.com/shtylman/node-process/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "process information for node.js and browsers", - "devDependencies": { - "mocha": "2.2.1", - "zuul": "^3.10.3" - }, - "engines": { - "node": ">= 0.6.0" - }, - "homepage": "https://github.com/shtylman/node-process#readme", - "keywords": [ - "process" - ], - "license": "MIT", - "main": "./index.js", - "name": "process", - "repository": { - "type": "git", - "url": "git://github.com/shtylman/node-process.git" - }, - "scripts": { - "browser": "zuul --no-coverage --ui mocha-bdd --local 8080 -- test.js", - "test": "mocha test.js" - }, - "version": "0.11.10" -} diff --git a/node_modules/process/test.js b/node_modules/process/test.js deleted file mode 100644 index 8ba579c..0000000 --- a/node_modules/process/test.js +++ /dev/null @@ -1,199 +0,0 @@ -var assert = require('assert'); -var ourProcess = require('./browser'); -describe('test against our process', function () { - test(ourProcess); -}); -if (!process.browser) { - describe('test against node', function () { - test(process); - }); - vmtest(); -} -function test (ourProcess) { - describe('test arguments', function () { - it ('works', function (done) { - var order = 0; - - - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'first one works'); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'recursive one is 4th'); - }, 3); - }, 0); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'second one starts'); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'this is third'); - ourProcess.nextTick(function (num) { - assert.equal(num, order++, 'this is last'); - done(); - }, 5); - }, 4); - }, 1); - ourProcess.nextTick(function (num) { - - assert.equal(num, order++, '3rd schedualed happens after the error'); - }, 2); - }); - }); -if (!process.browser) { - describe('test errors', function (t) { - it ('works', function (done) { - var order = 0; - process.removeAllListeners('uncaughtException'); - process.once('uncaughtException', function(err) { - assert.equal(2, order++, 'error is third'); - ourProcess.nextTick(function () { - assert.equal(5, order++, 'schedualed in error is last'); - done(); - }); - }); - ourProcess.nextTick(function () { - assert.equal(0, order++, 'first one works'); - ourProcess.nextTick(function () { - assert.equal(4, order++, 'recursive one is 4th'); - }); - }); - ourProcess.nextTick(function () { - assert.equal(1, order++, 'second one starts'); - throw(new Error('an error is thrown')); - }); - ourProcess.nextTick(function () { - assert.equal(3, order++, '3rd schedualed happens after the error'); - }); - }); - }); -} - describe('rename globals', function (t) { - var oldTimeout = setTimeout; - var oldClear = clearTimeout; - - it('clearTimeout', function (done){ - - var ok = true; - clearTimeout = function () { - ok = false; - } - var ran = false; - function cleanup() { - clearTimeout = oldClear; - var err; - try { - assert.ok(ok, 'fake clearTimeout ran'); - assert.ok(ran, 'should have run'); - } catch (e) { - err = e; - } - done(err); - } - setTimeout(cleanup, 1000); - ourProcess.nextTick(function () { - ran = true; - }); - }); - it('just setTimeout', function (done){ - - - setTimeout = function () { - setTimeout = oldTimeout; - try { - assert.ok(false, 'fake setTimeout called') - } catch (e) { - done(e); - } - - } - - ourProcess.nextTick(function () { - setTimeout = oldTimeout; - done(); - }); - }); - }); -} -function vmtest() { - var vm = require('vm'); - var fs = require('fs'); - var process = fs.readFileSync('./browser.js', {encoding: 'utf8'}); - - - describe('should work in vm in strict mode with no globals', function () { - it('should parse', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'this.works = process.browser;'; - var script = new vm.Script(str); - var context = { - works: false - }; - script.runInNewContext(context); - assert.ok(context.works); - done(); - }); - it('setTimeout throws error', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'try {process.nextTick(function () {})} catch (e){this.works = e;}'; - var script = new vm.Script(str); - var context = { - works: false - }; - script.runInNewContext(context); - assert.ok(context.works); - done(); - }); - it('should generally work', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'process.nextTick(function () {assert.ok(true);done();})'; - var script = new vm.Script(str); - var context = { - clearTimeout: clearTimeout, - setTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - it('late defs setTimeout', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {assert.ok(true);done();})'; - var script = new vm.Script(str); - var context = { - clearTimeout: clearTimeout, - hiddenSetTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - it('late defs clearTimeout', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'var clearTimeout = hiddenClearTimeout;process.nextTick(function () {assert.ok(true);done();})'; - var script = new vm.Script(str); - var context = { - hiddenClearTimeout: clearTimeout, - setTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - it('late defs setTimeout and then redefine', function (done) { - var str = '"use strict";var module = {exports:{}};'; - str += process; - str += 'var setTimeout = hiddenSetTimeout;process.nextTick(function () {setTimeout = function (){throw new Error("foo")};hiddenSetTimeout(function(){process.nextTick(function (){assert.ok(true);done();});});});'; - var script = new vm.Script(str); - var context = { - clearTimeout: clearTimeout, - hiddenSetTimeout: setTimeout, - done: done, - assert: assert - }; - script.runInNewContext(context); - }); - }); -} diff --git a/node_modules/xhr/.vscode/settings.json b/node_modules/xhr/.vscode/settings.json deleted file mode 100755 index 6bd5b92..0000000 --- a/node_modules/xhr/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "standard.enable": false -} \ No newline at end of file diff --git a/node_modules/xhr/CONTRIBUTING.md b/node_modules/xhr/CONTRIBUTING.md deleted file mode 100644 index 3d4053b..0000000 --- a/node_modules/xhr/CONTRIBUTING.md +++ /dev/null @@ -1,27 +0,0 @@ -# XHR is an OPEN Open Source Project - ------------------------------------------ - -## What? - -Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. - -## Rules - -There are a few basic ground-rules for contributors: - -1. **No `--force` pushes** or modifying the Git history in any way. -1. **Non-master branches** ought to be used for ongoing work. -1. **External API changes and significant modifications** ought to be subject to an **internal pull-request** to solicit feedback from other contributors. -1. Internal pull-requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor. -1. Contributors should attempt to adhere to the prevailing code-style. - -## Releases - -Declaring formal releases remains the prerogative of the project maintainer. - -## Changes to this arrangement - -This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change. - ------------------------------------------ diff --git a/node_modules/xhr/LICENCE b/node_modules/xhr/LICENCE deleted file mode 100644 index a23e08a..0000000 --- a/node_modules/xhr/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/xhr/README.md b/node_modules/xhr/README.md deleted file mode 100644 index 1cb2ba7..0000000 --- a/node_modules/xhr/README.md +++ /dev/null @@ -1,255 +0,0 @@ -# xhr - -[![Join the chat at https://gitter.im/naugtur-xhr/Lobby](https://badges.gitter.im/naugtur-xhr/Lobby.svg)](https://gitter.im/naugtur-xhr/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - - - -A small XMLHttpRequest wrapper. Designed for use with [browserify](http://browserify.org/), [webpack](https://webpack.github.io/) etc. - -API is a subset of [request](https://github.com/request/request) so you can write code that works in both node.js and the browser by using `require('request')` in your code and telling your browser bundler to load `xhr` instead of `request`. - -For browserify, add a [browser](https://github.com/substack/node-browserify#browser-field) field to your `package.json`: - -``` -"browser": { - "request": "xhr" -} -``` - -For webpack, add a [resolve.alias](http://webpack.github.io/docs/configuration.html#resolve-alias) field to your configuration: - -``` -"resolve": { - "alias": { - "request$": "xhr" - } -} -``` - -Browser support: IE8+ and everything else. - -## Installation - -``` -npm install xhr -``` - -## Example - -```js -var xhr = require("xhr") - -xhr({ - method: "post", - body: someJSONString, - uri: "/foo", - headers: { - "Content-Type": "application/json" - } -}, function (err, resp, body) { - // check resp.statusCode -}) -``` - -## `var req = xhr(options, callback)` - -```js -type XhrOptions = String | { - useXDR: Boolean?, - sync: Boolean?, - uri: String, - url: String, - method: String?, - timeout: Number?, - headers: Object?, - body: String? | Object?, - json: Boolean? | Object?, - username: String?, - password: String?, - withCredentials: Boolean?, - responseType: String?, - beforeSend: Function? -} -xhr := (XhrOptions, Callback) => Request -``` -the returned object is either an [`XMLHttpRequest`][3] instance - or an [`XDomainRequest`][4] instance (if on IE8/IE9 && - `options.useXDR` is set to `true`) - -Your callback will be called once with the arguments - ( [`Error`][5], `response` , `body` ) where the response is an object: -```js -{ - body: Object||String, - statusCode: Number, - method: String, - headers: {}, - url: String, - rawRequest: xhr -} -``` - - `body`: HTTP response body - [`XMLHttpRequest.response`][6], [`XMLHttpRequest.responseText`][7] or - [`XMLHttpRequest.responseXML`][8] depending on the request type. - - `rawRequest`: Original [`XMLHttpRequest`][3] instance - or [`XDomainRequest`][4] instance (if on IE8/IE9 && - `options.useXDR` is set to `true`) - - `headers`: A collection of headers where keys are header names converted to lowercase - - -Your callback will be called with an [`Error`][5] if there is an error in the browser that prevents sending the request. -A HTTP 500 response is not going to cause an error to be returned. - -## Other signatures - -* `var req = xhr(url, callback)` - -a simple string instead of the options. In this case, a GET request will be made to that url. - -* `var req = xhr(url, options, callback)` - -the above may also be called with the standard set of options. - -### Convience methods -* `var req = xhr.{post, put, patch, del, head, get}(url, callback)` -* `var req = xhr.{post, put, patch, del, head, get}(options, callback)` -* `var req = xhr.{post, put, patch, del, head, get}(url, options, callback)` - -The `xhr` module has convience functions attached that will make requests with the given method. -Each function is named after its method, with the exception of `DELETE` which is called `xhr.del` for compatibility. - -The method shorthands may be combined with the url-first form of `xhr` for succinct and descriptive requests. For example, - -```js -xhr.post('/post-to-me', function(err, resp) { - console.log(resp.body) -}) -``` - -or - -```js -xhr.del('/delete-me', { headers: { my: 'auth' } }, function (err, resp) { - console.log(resp.statusCode); -}) -``` - -## Options - -### `options.method` - -Specify the method the [`XMLHttpRequest`][3] should be opened - with. Passed to [`XMLHttpRequest.open`][2]. Defaults to "GET" - -### `options.useXDR` - -Specify whether this is a cross origin (CORS) request for IE<10. - Switches IE to use [`XDomainRequest`][4] instead of `XMLHttpRequest`. - Ignored in other browsers. - -Note that headers cannot be set on an XDomainRequest instance. - -### `options.sync` - -Specify whether this is a synchrounous request. Note that when - this is true the callback will be called synchronously. In - most cases this option should not be used. Only use if you - know what you are doing! - -### `options.body` - -Pass in body to be send across the [`XMLHttpRequest`][3]. - Generally should be a string. But anything that's valid as - a parameter to [`XMLHttpRequest.send`][1] should work (Buffer for file, etc.). - -If `options.json` is `true`, then this must be a JSON-serializable object. `options.body` is passed to `JSON.stringify` and sent. - -### `options.uri` or `options.url` - -The uri to send a request to. Passed to [`XMLHttpRequest.open`][2]. `options.url` and `options.uri` are aliases for each other. - -### `options.headers` - -An object of headers that should be set on the request. The - key, value pair is passed to [`XMLHttpRequest.setRequestHeader`][9] - -### `options.timeout` - -Number of miliseconds to wait for response. Defaults to 0 (no timeout). Ignored when `options.sync` is true. - -### `options.json` - -Set to `true` to send request as `application/json` (see `options.body`) and parse response from JSON. - -For backwards compatibility `options.json` can also be a valid JSON-serializable value to be sent to the server. Additionally the response body is still parsed as JSON - -For sending booleans as JSON body see FAQ - -### `options.withCredentials` - -Specify whether user credentials are to be included in a cross-origin - request. Sets [`XMLHttpRequest.withCredentials`][10]. Defaults to false. - -A wildcard `*` cannot be used in the `Access-Control-Allow-Origin` header when `withCredentials` is true. - The header needs to specify your origin explicitly or browser will abort the request. - -### `options.responseType` - -Determines the data type of the `response`. Sets [`XMLHttpRequest.responseType`][11]. For example, a `responseType` of `document` will return a parsed `Document` object as the `response.body` for an XML resource. - -### `options.beforeSend` - -A function being called right before the `send` method of the `XMLHttpRequest` or `XDomainRequest` instance is called. The `XMLHttpRequest` or `XDomainRequest` instance is passed as an argument. - -### `options.xhr` - -Pass an `XMLHttpRequest` object (or something that acts like one) to use instead of constructing a new one using the `XMLHttpRequest` or `XDomainRequest` constructors. Useful for testing. - -## FAQ - -- Why is my server's JSON response not parsed? I returned the right content-type. - - See `options.json` - you can set it to `true` on a GET request to tell `xhr` to parse the response body. - - Without `options.json` body is returned as-is (a string or when `responseType` is set and the browser supports it - a result of parsing JSON or XML) -- How do I send an object or array as POST body? - - `options.body` should be a string. You need to serialize your object before passing to `xhr` for sending. - - To serialize to JSON you can use - `options.json:true` with `options.body` for convenience - then `xhr` will do the serialization and set content-type accordingly. -- Where's stream API? `.pipe()` etc. - - Not implemented. You can't reasonably have that in the browser. -- Why can't I send `"true"` as body by passing it as `options.json` anymore? - - Accepting `true` as a value was a bug. Despite what `JSON.stringify` does, the string `"true"` is not valid JSON. If you're sending booleans as JSON, please consider wrapping them in an object or array to save yourself from more trouble in the future. To bring back the old behavior, hardcode `options.json` to `true` and set `options.body` to your boolean value. -- How do I add an `onprogress` listener? - - use `beforeSend` function for non-standard things that are browser specific. In this case: - ```js - xhr({ - ... - beforeSend: function(xhrObject){ - xhrObject.onprogress = function(){} - } - }) - ``` - -## Mocking Requests -You can override the constructor used to create new requests for testing. When you're making a new request: - -```js -xhr({ xhr: new MockXMLHttpRequest() }) -``` - -or you can override the constructors used to create requests at the module level: - -```js -xhr.XMLHttpRequest = MockXMLHttpRequest -xhr.XDomainRequest = MockXDomainRequest -``` - -## MIT Licenced - - [1]: http://xhr.spec.whatwg.org/#the-send()-method - [2]: http://xhr.spec.whatwg.org/#the-open()-method - [3]: http://xhr.spec.whatwg.org/#interface-xmlhttprequest - [4]: http://msdn.microsoft.com/en-us/library/ie/cc288060(v=vs.85).aspx - [5]: http://es5.github.com/#x15.11 - [6]: http://xhr.spec.whatwg.org/#the-response-attribute - [7]: http://xhr.spec.whatwg.org/#the-responsetext-attribute - [8]: http://xhr.spec.whatwg.org/#the-responsexml-attribute - [9]: http://xhr.spec.whatwg.org/#the-setrequestheader()-method - [10]: http://xhr.spec.whatwg.org/#the-withcredentials-attribute - [11]: https://xhr.spec.whatwg.org/#the-responsetype-attribute diff --git a/node_modules/xhr/index.d.ts b/node_modules/xhr/index.d.ts deleted file mode 100644 index 0de08c2..0000000 --- a/node_modules/xhr/index.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export type XhrCallback = ( - error: Error, - response: XhrResponse, - body: any -) => void; - -export interface XhrResponse { - body: Object | string; - statusCode: number; - method: string; - headers: XhrHeaders; - url: string; - rawRequest: XMLHttpRequest; -} - -export interface XhrHeaders { - [key: string]: string; -} - -export interface XhrBaseConfig { - useXDR?: boolean; - sync?: boolean; - method?: 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH'; - timeout?: number; - headers?: XhrHeaders; - body?: string | any; - json?: boolean; - username?: string; - password?: string; - withCredentials?: boolean; - responseType?: '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text'; - beforeSend?: (xhrObject: XMLHttpRequest) => void; - xhr?: XMLHttpRequest; -} - -export interface XhrUriConfig extends XhrBaseConfig { - uri: string; -} - -export interface XhrUrlConfig extends XhrBaseConfig { - url: string; -} - -export interface XhrInstance { - (options: XhrUriConfig | XhrUrlConfig, callback: XhrCallback): any; - (url: string, callback: XhrCallback): any; - (url: string, options: XhrBaseConfig, callback: XhrCallback): any; -} - -export interface XhrStatic extends XhrInstance { - del: XhrInstance; - get: XhrInstance; - head: XhrInstance; - patch: XhrInstance; - post: XhrInstance; - put: XhrInstance; -} - -declare const Xhr: XhrStatic; - -export default Xhr; diff --git a/node_modules/xhr/index.js b/node_modules/xhr/index.js deleted file mode 100644 index 1bc328f..0000000 --- a/node_modules/xhr/index.js +++ /dev/null @@ -1,247 +0,0 @@ -"use strict"; -var window = require("global/window") -var isFunction = require("is-function") -var parseHeaders = require("parse-headers") -var xtend = require("xtend") - -module.exports = createXHR -// Allow use of default import syntax in TypeScript -module.exports.default = createXHR; -createXHR.XMLHttpRequest = window.XMLHttpRequest || noop -createXHR.XDomainRequest = "withCredentials" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest - -forEachArray(["get", "put", "post", "patch", "head", "delete"], function(method) { - createXHR[method === "delete" ? "del" : method] = function(uri, options, callback) { - options = initParams(uri, options, callback) - options.method = method.toUpperCase() - return _createXHR(options) - } -}) - -function forEachArray(array, iterator) { - for (var i = 0; i < array.length; i++) { - iterator(array[i]) - } -} - -function isEmpty(obj){ - for(var i in obj){ - if(obj.hasOwnProperty(i)) return false - } - return true -} - -function initParams(uri, options, callback) { - var params = uri - - if (isFunction(options)) { - callback = options - if (typeof uri === "string") { - params = {uri:uri} - } - } else { - params = xtend(options, {uri: uri}) - } - - params.callback = callback - return params -} - -function createXHR(uri, options, callback) { - options = initParams(uri, options, callback) - return _createXHR(options) -} - -function _createXHR(options) { - if(typeof options.callback === "undefined"){ - throw new Error("callback argument missing") - } - - var called = false - var callback = function cbOnce(err, response, body){ - if(!called){ - called = true - options.callback(err, response, body) - } - } - - function readystatechange() { - if (xhr.readyState === 4) { - setTimeout(loadFunc, 0) - } - } - - function getBody() { - // Chrome with requestType=blob throws errors arround when even testing access to responseText - var body = undefined - - if (xhr.response) { - body = xhr.response - } else { - body = xhr.responseText || getXml(xhr) - } - - if (isJson) { - try { - body = JSON.parse(body) - } catch (e) {} - } - - return body - } - - function errorFunc(evt) { - clearTimeout(timeoutTimer) - if(!(evt instanceof Error)){ - evt = new Error("" + (evt || "Unknown XMLHttpRequest Error") ) - } - evt.statusCode = 0 - return callback(evt, failureResponse) - } - - // will load the data & process the response in a special response object - function loadFunc() { - if (aborted) return - var status - clearTimeout(timeoutTimer) - if(options.useXDR && xhr.status===undefined) { - //IE8 CORS GET successful response doesn't have a status field, but body is fine - status = 200 - } else { - status = (xhr.status === 1223 ? 204 : xhr.status) - } - var response = failureResponse - var err = null - - if (status !== 0){ - response = { - body: getBody(), - statusCode: status, - method: method, - headers: {}, - url: uri, - rawRequest: xhr - } - if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE - response.headers = parseHeaders(xhr.getAllResponseHeaders()) - } - } else { - err = new Error("Internal XMLHttpRequest Error") - } - return callback(err, response, response.body) - } - - var xhr = options.xhr || null - - if (!xhr) { - if (options.cors || options.useXDR) { - xhr = new createXHR.XDomainRequest() - }else{ - xhr = new createXHR.XMLHttpRequest() - } - } - - var key - var aborted - var uri = xhr.url = options.uri || options.url - var method = xhr.method = options.method || "GET" - var body = options.body || options.data - var headers = xhr.headers = options.headers || {} - var sync = !!options.sync - var isJson = false - var timeoutTimer - var failureResponse = { - body: undefined, - headers: {}, - statusCode: 0, - method: method, - url: uri, - rawRequest: xhr - } - - if ("json" in options && options.json !== false) { - isJson = true - headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json") //Don't override existing accept header declared by user - if (method !== "GET" && method !== "HEAD") { - headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json") //Don't override existing accept header declared by user - body = JSON.stringify(options.json === true ? body : options.json) - } - } - - xhr.onreadystatechange = readystatechange - xhr.onload = loadFunc - xhr.onerror = errorFunc - // IE9 must have onprogress be set to a unique function. - xhr.onprogress = function () { - // IE must die - } - xhr.onabort = function(){ - aborted = true; - } - xhr.ontimeout = errorFunc - xhr.open(method, uri, !sync, options.username, options.password) - //has to be after open - if(!sync) { - xhr.withCredentials = !!options.withCredentials - } - // Cannot set timeout with sync request - // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly - // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent - if (!sync && options.timeout > 0 ) { - timeoutTimer = setTimeout(function(){ - if (aborted) return - aborted = true//IE9 may still call readystatechange - xhr.abort("timeout") - var e = new Error("XMLHttpRequest timeout") - e.code = "ETIMEDOUT" - errorFunc(e) - }, options.timeout ) - } - - if (xhr.setRequestHeader) { - for(key in headers){ - if(headers.hasOwnProperty(key)){ - xhr.setRequestHeader(key, headers[key]) - } - } - } else if (options.headers && !isEmpty(options.headers)) { - throw new Error("Headers cannot be set on an XDomainRequest object") - } - - if ("responseType" in options) { - xhr.responseType = options.responseType - } - - if ("beforeSend" in options && - typeof options.beforeSend === "function" - ) { - options.beforeSend(xhr) - } - - // Microsoft Edge browser sends "undefined" when send is called with undefined value. - // XMLHttpRequest spec says to pass null as body to indicate no body - // See https://github.com/naugtur/xhr/issues/100. - xhr.send(body || null) - - return xhr - - -} - -function getXml(xhr) { - // xhr.responseXML will throw Exception "InvalidStateError" or "DOMException" - // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML. - try { - if (xhr.responseType === "document") { - return xhr.responseXML - } - var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror" - if (xhr.responseType === "" && !firefoxBugTakenEffect) { - return xhr.responseXML - } - } catch (e) {} - - return null -} - -function noop() {} diff --git a/node_modules/xhr/package.json b/node_modules/xhr/package.json deleted file mode 100644 index 43ef297..0000000 --- a/node_modules/xhr/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "xhr@^2.6.0", - "_id": "xhr@2.6.0", - "_inBundle": false, - "_integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "_location": "/xhr", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xhr@^2.6.0", - "name": "xhr", - "escapedName": "xhr", - "rawSpec": "^2.6.0", - "saveSpec": null, - "fetchSpec": "^2.6.0" - }, - "_requiredBy": [ - "/@mux/upchunk" - ], - "_resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "_shasum": "b69d4395e792b4173d6b7df077f0fc5e4e2b249d", - "_spec": "xhr@^2.6.0", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/@mux/upchunk", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/naugtur/xhr/issues", - "email": "naugtur@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Zbyszek Tenerowicz", - "email": "naugtur@gmail.com" - } - ], - "dependencies": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - }, - "deprecated": false, - "description": "small xhr abstraction", - "devDependencies": { - "for-each": "^0.3.2", - "pre-commit": "1.2.2", - "run-browser": "github:naugtur/run-browser", - "tap-spec": "^4.0.2", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/naugtur/xhr", - "keywords": [ - "xhr", - "http", - "xmlhttprequest", - "xhr2", - "browserify" - ], - "license": "MIT", - "main": "index", - "name": "xhr", - "repository": { - "type": "git", - "url": "git://github.com/naugtur/xhr.git" - }, - "scripts": { - "browser": "run-browser -m test/mock-server.js test/index.js", - "test": "run-browser test/index.js -b -m test/mock-server.js | tap-spec" - }, - "typings": "./index.d.ts", - "version": "2.6.0" -} diff --git a/node_modules/xtend/.jshintrc b/node_modules/xtend/.jshintrc deleted file mode 100644 index 77887b5..0000000 --- a/node_modules/xtend/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "maxdepth": 4, - "maxstatements": 200, - "maxcomplexity": 12, - "maxlen": 80, - "maxparams": 5, - - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "noarg": true, - "noempty": true, - "nonew": true, - "undef": true, - "unused": "vars", - "trailing": true, - - "quotmark": true, - "expr": true, - "asi": true, - - "browser": false, - "esnext": true, - "devel": false, - "node": false, - "nonstandard": false, - - "predef": ["require", "module", "__dirname", "__filename"] -} diff --git a/node_modules/xtend/LICENSE b/node_modules/xtend/LICENSE deleted file mode 100644 index 0099f4f..0000000 --- a/node_modules/xtend/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2012-2014 Raynos. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/xtend/README.md b/node_modules/xtend/README.md deleted file mode 100644 index 4a2703c..0000000 --- a/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: "c" -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licensed - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/xtend/immutable.js b/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9..0000000 --- a/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/xtend/mutable.js b/node_modules/xtend/mutable.js deleted file mode 100644 index 72debed..0000000 --- a/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/xtend/package.json b/node_modules/xtend/package.json deleted file mode 100644 index 00ef22d..0000000 --- a/node_modules/xtend/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "xtend@^4.0.0", - "_id": "xtend@4.0.2", - "_inBundle": false, - "_integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "_location": "/xtend", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "xtend@^4.0.0", - "name": "xtend", - "escapedName": "xtend", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/xhr" - ], - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "_shasum": "bb72779f5fa465186b1f438f674fa347fdb5db54", - "_spec": "xtend@^4.0.0", - "_where": "/var/vagrant/ilias_5-4/ilias/Customizing/global/plugins/Modules/Cloud/CloudHook/OneDrive/node_modules/xhr", - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "dependencies": {}, - "deprecated": false, - "description": "extend like a boss", - "devDependencies": { - "tape": "~1.1.0" - }, - "engines": { - "node": ">=0.4" - }, - "homepage": "https://github.com/Raynos/xtend", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "license": "MIT", - "main": "immutable", - "name": "xtend", - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "scripts": { - "test": "node test" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "version": "4.0.2" -} diff --git a/node_modules/xtend/test.js b/node_modules/xtend/test.js deleted file mode 100644 index b895b42..0000000 --- a/node_modules/xtend/test.js +++ /dev/null @@ -1,103 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("prototype pollution", function (assert) { - var a = {} - var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' - - assert.strictEqual(a.oops, undefined) - extend({}, maliciousPayload) - assert.strictEqual(a.oops, undefined) - assert.end() -}) - -test("prototype pollution mutable", function (assert) { - var a = {} - var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' - - assert.strictEqual(a.oops, undefined) - mutableExtend({}, maliciousPayload) - assert.strictEqual(a.oops, undefined) - assert.end() -}) diff --git a/package-lock.json b/package-lock.json index bdd6e0a..a0aa9f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,102 +1,75 @@ { "name": "srag.plugins.onedrive", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@mux/upchunk": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@mux/upchunk/-/upchunk-2.2.0.tgz", - "integrity": "sha512-z2tJH6yhpFe5Yz97ynI7BcGMq04yn5rRnS7nbXhq6Y58fgts9UKnsa6KDXsQq/yCbg+ImlgzoHXV0XNnF/bA2g==", - "requires": { - "event-target-shim": "^4.0.3", - "xhr": "^2.6.0" + "packages": { + "": { + "name": "srag.plugins.onedrive", + "license": "GPL-3.0-only", + "dependencies": { + "blueimp-file-upload": "^10.31.0" } }, - "blueimp-canvas-to-blob": { + "node_modules/blueimp-canvas-to-blob": { "version": "3.28.0", "resolved": "https://registry.npmjs.org/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.28.0.tgz", "integrity": "sha512-5q+YHzgGsuHQ01iouGgJaPJXod2AzTxJXmVv90PpGrRxU7G7IqgPqWXz+PBmt3520jKKi6irWbNV87DicEa7wg==", "optional": true }, - "blueimp-file-upload": { + "node_modules/blueimp-file-upload": { "version": "10.31.0", "resolved": "https://registry.npmjs.org/blueimp-file-upload/-/blueimp-file-upload-10.31.0.tgz", "integrity": "sha512-dGAxOf9+SsMDvZPTsIUpe0cOk57taMJYE3FocHEUebhn5BnDbu1hcWOmrP8oswIe6V61Qcm9UDuhq/Pv1t/eRw==", - "requires": { + "optionalDependencies": { "blueimp-canvas-to-blob": "3", "blueimp-load-image": "5", "blueimp-tmpl": "3" } }, - "blueimp-load-image": { + "node_modules/blueimp-load-image": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/blueimp-load-image/-/blueimp-load-image-5.14.0.tgz", "integrity": "sha512-g5l+4dCOESBG8HkPLdGnBx8dhEwpQHaOZ0en623sl54o3bGhGMLYGc54L5cWfGmPvfKUjbsY7LOAmcW/xlkBSA==", "optional": true }, - "blueimp-tmpl": { + "node_modules/blueimp-tmpl": { "version": "3.19.0", "resolved": "https://registry.npmjs.org/blueimp-tmpl/-/blueimp-tmpl-3.19.0.tgz", "integrity": "sha512-v8/Vge6U3uwlAjO9TxeHoYl77C1GJDZBN45pUp+39WyHU/VRzYbnGDhRNYvcT6Lh8jihVsXNZttnDpnYVA4m9w==", - "optional": true - }, - "dom-walk": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz", - "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==" - }, - "event-target-shim": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-4.0.3.tgz", - "integrity": "sha512-YXVJDPGzU0yhSzrXGoEFAByEaLnZXSlJDHXkq4Hp6WrlnV66tADiZugYf1utTaCP/dsYRcLndAhecbq9mnbbqg==" - }, - "global": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/global/-/global-4.4.0.tgz", - "integrity": "sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==", - "requires": { - "min-document": "^2.19.0", - "process": "^0.11.10" + "optional": true, + "bin": { + "tmpl.js": "js/compile.js" } + } + }, + "dependencies": { + "blueimp-canvas-to-blob": { + "version": "3.28.0", + "resolved": "https://registry.npmjs.org/blueimp-canvas-to-blob/-/blueimp-canvas-to-blob-3.28.0.tgz", + "integrity": "sha512-5q+YHzgGsuHQ01iouGgJaPJXod2AzTxJXmVv90PpGrRxU7G7IqgPqWXz+PBmt3520jKKi6irWbNV87DicEa7wg==", + "optional": true }, - "is-function": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz", - "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==" - }, - "min-document": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", - "integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=", + "blueimp-file-upload": { + "version": "10.31.0", + "resolved": "https://registry.npmjs.org/blueimp-file-upload/-/blueimp-file-upload-10.31.0.tgz", + "integrity": "sha512-dGAxOf9+SsMDvZPTsIUpe0cOk57taMJYE3FocHEUebhn5BnDbu1hcWOmrP8oswIe6V61Qcm9UDuhq/Pv1t/eRw==", "requires": { - "dom-walk": "^0.1.0" + "blueimp-canvas-to-blob": "3", + "blueimp-load-image": "5", + "blueimp-tmpl": "3" } }, - "parse-headers": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", - "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==" - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" - }, - "xhr": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", - "integrity": "sha512-/eCGLb5rxjx5e3mF1A7s+pLlR6CGyqWN91fv1JgER5mVWg1MZmlhBvy9kjcsOdRk8RrIujotWyJamfyrp+WIcA==", - "requires": { - "global": "~4.4.0", - "is-function": "^1.0.1", - "parse-headers": "^2.0.0", - "xtend": "^4.0.0" - } + "blueimp-load-image": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/blueimp-load-image/-/blueimp-load-image-5.14.0.tgz", + "integrity": "sha512-g5l+4dCOESBG8HkPLdGnBx8dhEwpQHaOZ0en623sl54o3bGhGMLYGc54L5cWfGmPvfKUjbsY7LOAmcW/xlkBSA==", + "optional": true }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "blueimp-tmpl": { + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/blueimp-tmpl/-/blueimp-tmpl-3.19.0.tgz", + "integrity": "sha512-v8/Vge6U3uwlAjO9TxeHoYl77C1GJDZBN45pUp+39WyHU/VRzYbnGDhRNYvcT6Lh8jihVsXNZttnDpnYVA4m9w==", + "optional": true } } } diff --git a/package.json b/package.json index affa97f..8217911 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "url": "https://plugins.studer-raimann.ch/goto.php?target=uihk_srsu_PLONEDRIVE" }, "dependencies": { - "@mux/upchunk": "^2.2.0", "blueimp-file-upload": "^10.31.0" }, "private": true diff --git a/src/EventLog/EventLogEntryAR.php b/src/EventLog/EventLogEntryAR.php index 2d57e8a..1a23de6 100644 --- a/src/EventLog/EventLogEntryAR.php +++ b/src/EventLog/EventLogEntryAR.php @@ -54,7 +54,7 @@ class EventLogEntryAR extends ActiveRecord * @con_is_notnull true * @con_length 64 */ - protected $object_name; + protected $path; /** * @var ObjectType * @con_is_unique true @@ -64,15 +64,6 @@ class EventLogEntryAR extends ActiveRecord * @con_length 64 */ protected $object_type; - /** - * @var string - * @con_is_unique true - * @con_has_field true - * @con_fieldtype text - * @con_is_notnull true - * @con_length 512 - */ - protected $parent; /** * @var array * @con_is_unique true @@ -125,17 +116,17 @@ public function setUserId(int $user_id) /** * @return string */ - public function getObjectName() : string + public function getPath() : string { - return $this->object_name; + return $this->path; } /** - * @param string $object_name + * @param string $path */ - public function setObjectName(string $object_name) + public function setPath(string $path) { - $this->object_name = $object_name; + $this->path = $path; } /** @@ -154,22 +145,6 @@ public function setObjectType(ObjectType $object_type) $this->object_type = $object_type; } - /** - * @return string - */ - public function getParent() : string - { - return $this->parent; - } - - /** - * @param string $parent - */ - public function setParent(string $parent) - { - $this->parent = $parent; - } - /** * @return array */ diff --git a/src/EventLog/EventLogger.php b/src/EventLog/EventLogger.php index 779402c..cf18595 100644 --- a/src/EventLog/EventLogger.php +++ b/src/EventLog/EventLogger.php @@ -9,78 +9,69 @@ class EventLogger { public static function logUploadStarted( int $user_id, - string $file_name, - string $parent + string $file_path, ) { self::log( $user_id, EventType::uploadStarted(), - $file_name, + $file_path, ObjectType::file(), - $parent, [] ); } public static function logUploadComplete( int $user_id, - string $file_name, - string $parent + string $file_path ) { self::log( $user_id, EventType::uploadComplete(), - $file_name, + $file_path, ObjectType::file(), - $parent, [] ); } public static function logUploadAborted( int $user_id, - string $file_name, + string $file_path, string $parent ) { self::log( $user_id, EventType::uploadAborted(), - $file_name, + $file_path, ObjectType::file(), - $parent, [] ); } public static function logObjectDeleted( int $user_id, - string $object_name, - ObjectType $object_type, - string $parent + string $object_path, + ObjectType $object_type ) { self::log( $user_id, EventType::uploadAborted(), - $object_name, + $object_path, $object_type, - $parent, [] ); } public static function logObjectRenamed( int $user_id, - string $object_name_old, + string $object_path_old, string $object_name_new, - ObjectType $object_type, - string $parent + ObjectType $object_type ) { self::log( $user_id, EventType::uploadAborted(), - $object_name_old, + $object_path_old, $object_type, - $parent, ['new_name' => $object_name_new] ); } @@ -88,18 +79,16 @@ public static function logObjectRenamed( protected static function log( int $user_id, EventType $event_type, - string $object_name, + string $object_path, ObjectType $object_type, - string $parent, array $additional_data ) { $entry = new EventLogEntryAR(); $entry->setTimestamp(date('Y-m-d H:i:s', time())); $entry->setEventType($event_type); $entry->setUserId($user_id); - $entry->setObjectName($object_name); + $entry->setPath($object_path); $entry->setObjectType($object_type); - $entry->setParent($parent); $entry->setAdditionalData($additional_data); $entry->create(); } diff --git a/src/EventLog/ObjectType.php b/src/EventLog/ObjectType.php index 772c41e..f7b7377 100644 --- a/src/EventLog/ObjectType.php +++ b/src/EventLog/ObjectType.php @@ -2,6 +2,9 @@ namespace srag\Plugins\OneDrive\EventLog; use ilCloudException; +use exodItem; +use exodFile; +use exodFolder; /** * Class ObjectType @@ -46,7 +49,7 @@ public static function folder() : self * @return ObjectType * @throws ilCloudException */ - public static function fromValue(string $type) + public static function fromValue(string $type) : self { if (!in_array($type, self::$types)) { throw new ilCloudException('OneDrive EventLog: unknown object type "' . $type . '"'); @@ -54,6 +57,22 @@ public static function fromValue(string $type) return new self($type); } + /** + * @param exodItem $item + * @return static + * @throws ilCloudException + */ + public static function fromExodItem(exodItem $item) : self + { + if ($item instanceof exodFile) { + return self::file(); + } + if ($item instanceof exodFolder) { + return self::folder(); + } + throw new ilCloudException('OneDrive EventLog: unknown item type "' . get_class($item) . '"'); + } + public function value() : string { return $this->type;