summaryrefslogtreecommitdiff
path: root/includes/external/matrix/node_modules/loglevel
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/matrix/node_modules/loglevel
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/loglevel')
-rw-r--r--includes/external/matrix/node_modules/loglevel/.editorconfig21
-rw-r--r--includes/external/matrix/node_modules/loglevel/.github/FUNDING.yml1
-rw-r--r--includes/external/matrix/node_modules/loglevel/.jshintrc14
-rw-r--r--includes/external/matrix/node_modules/loglevel/.travis.yml10
-rw-r--r--includes/external/matrix/node_modules/loglevel/CONTRIBUTING.md65
-rw-r--r--includes/external/matrix/node_modules/loglevel/Gruntfile.js230
-rw-r--r--includes/external/matrix/node_modules/loglevel/LICENSE-MIT22
-rw-r--r--includes/external/matrix/node_modules/loglevel/README.md362
-rw-r--r--includes/external/matrix/node_modules/loglevel/_config.yml1
-rw-r--r--includes/external/matrix/node_modules/loglevel/bower.json11
-rw-r--r--includes/external/matrix/node_modules/loglevel/dist/loglevel.js292
-rw-r--r--includes/external/matrix/node_modules/loglevel/dist/loglevel.min.js2
-rw-r--r--includes/external/matrix/node_modules/loglevel/index.d.ts194
-rw-r--r--includes/external/matrix/node_modules/loglevel/lib/.jshintrc21
-rw-r--r--includes/external/matrix/node_modules/loglevel/lib/loglevel.js297
-rw-r--r--includes/external/matrix/node_modules/loglevel/package.json64
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/.jshintrc34
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/console-fallback-test.js98
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/cookie-test.js122
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/default-level-test.js77
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/get-current-level-test.js48
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/global-integration-with-new-context.js29
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/global-integration.js25
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/integration-smoke-test.js71
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/level-setting-test.js281
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/local-storage-test.js208
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/manual-test.html8
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/method-factory-test.js42
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/multiple-logger-test.js139
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/node-integration.js44
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/test-context-using-apply.js6
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/test-helpers.js170
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/test-qunit.html19
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/test-qunit.js51
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/type-test.ts8
-rw-r--r--includes/external/matrix/node_modules/loglevel/test/vendor/json2.js486
36 files changed, 0 insertions, 3573 deletions
diff --git a/includes/external/matrix/node_modules/loglevel/.editorconfig b/includes/external/matrix/node_modules/loglevel/.editorconfig
deleted file mode 100644
index e773d8d..0000000
--- a/includes/external/matrix/node_modules/loglevel/.editorconfig
+++ /dev/null
@@ -1,21 +0,0 @@
-
-# EditorConfig defines and maintains consistent coding styles between different
-# editors and IDEs: http://EditorConfig.org/
-# Top-most EditorConfig file
-root = true
-
-# All files
-[*.*]
-charset = utf-8
-end_of_line = lf
-insert_final_newline = true
-indent_style = space
-indent_size = 4
-trim_trailing_whitespace = true
-max_line_length = 80
-
-[*.md]
-indent_size = 2
-
-[*.json]
-indent_size = 2
diff --git a/includes/external/matrix/node_modules/loglevel/.github/FUNDING.yml b/includes/external/matrix/node_modules/loglevel/.github/FUNDING.yml
deleted file mode 100644
index 1adbb7f..0000000
--- a/includes/external/matrix/node_modules/loglevel/.github/FUNDING.yml
+++ /dev/null
@@ -1 +0,0 @@
-tidelift: "npm/loglevel"
diff --git a/includes/external/matrix/node_modules/loglevel/.jshintrc b/includes/external/matrix/node_modules/loglevel/.jshintrc
deleted file mode 100644
index 7813175..0000000
--- a/includes/external/matrix/node_modules/loglevel/.jshintrc
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "curly": false,
- "eqeqeq": true,
- "immed": true,
- "latedef": true,
- "newcap": true,
- "noarg": true,
- "sub": true,
- "undef": true,
- "unused": true,
- "boss": true,
- "eqnull": true,
- "node": true
-}
diff --git a/includes/external/matrix/node_modules/loglevel/.travis.yml b/includes/external/matrix/node_modules/loglevel/.travis.yml
deleted file mode 100644
index 2e63065..0000000
--- a/includes/external/matrix/node_modules/loglevel/.travis.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-language: node_js
-node_js:
- # - "12" Doesn't work yet - requires Jasmine updates/replacement
- # - "10" Doesn't work yet - requires Jasmine updates/replacement
- - "8"
- - "6"
- - "4"
- - "0.12"
- - "0.10"
-script: "npm run-script ci"
diff --git a/includes/external/matrix/node_modules/loglevel/CONTRIBUTING.md b/includes/external/matrix/node_modules/loglevel/CONTRIBUTING.md
deleted file mode 100644
index c28856c..0000000
--- a/includes/external/matrix/node_modules/loglevel/CONTRIBUTING.md
+++ /dev/null
@@ -1,65 +0,0 @@
-Filing tickets against loglevel
-===============================
-
-If you'd like to file a bug or a feature request for loglevel, the best option is to [open an issue on Github](https://github.com/pimterry/loglevel/issues/new).
-
-If you're filing a feature request, please remember:
-
-* Feature requests significantly expanding the scope of loglevel outside the description in [the readme](https://github.com/pimterry/loglevel/blob/master/README.md) will probably be rejected.
-* Features that can't be meaningfully implemented in a cross-environment compatible manner won't be implemented.
-* Please check the previously opened issues to see if somebody else has suggested it first.
-* Consider submitting a pull request to add the feature instead, if you're confident it fits within the above
-
-If you're filing a bug, please remember:
-
-* To provide detailed steps to reproduce the behaviour
-* If possible, provide a Jasmine test which reproduces the behaviour
-* Please specify the exact details of the environment in which it fails: OS + Environment (i.e. Browser or Node) + version
-* Consider submitting a pull request to fix the bug instead
-
-Helping develop loglevel
-================================
-
-If you'd like to help develop loglevel further, please submit a pull request! I'm very keen to improve loglevel further, and good pull requests will be enthusiastically merged.
-
-Before submitting a pull request to fix a bug or add a new feature, please check the lists above to ensure it'll be accepted. Browser compatibility is particularly important here; if you add a feature or fix a bug which breaks things on other browsers it will not be merged, no matter how awesome it may be.
-
-To be more specific, before submitting your pull request please ensure:
-
-* You haven't broken the existing test suite in any obvious browsers (at least check latest IE/FF/Chrome - automatic saucelabs tests for this are coming soon too)
-* You've added relevant tests for the bug you're fixing/the new feature you're adding/etc, which pass in all the relevant browsers
-* JSHint is happy with your new code
-* You've updated the API docs (in README.md) to detail any changes you've made to the public interface
-* Your change is backward compatible (or you've explicitly said if it's not; this isn't great, but will be considered)
-* You haven't changed any files in dist/ (these are auto-generated, and should only be changed on release)
-
-Project structure
------------------
-
-The core project code is all in lib/loglevel.js, and this should be the only file you need to touch for functional changes themselves.
-
-The released code is in dist/*.js, and should not be touched by anything except releases
-
-The test suite is entirely in test/*.js:
-
-* Every file ending in '-test.js' is a unit test, is written in RequireJS, and should pass in any environment
-* global-integration.js and node-integration.js are quick integration smoke tests for node and for browser global usage
-* test-helpers.js contains some test utilities
-* manual-test.html is a test page which includes the current loglevel build, so you can manually check it works in a given browser
-
-How to make your change and submit it
--------------------------------------
-
-1. Fork loglevel
-2. Clone your fork locally
-3. Create a branch from master for your change
-4. Write some tests in /test for your change, as relevant
-5. Make your code changes in /lib/loglevel.js
-6. Check your code all passes (run `grunt`) - if you have any issues try running `grunt jasmine:requirejs:src:build` (or a different test build instead of 'requirejs': see the jasmine config in Gruntfile.js) and debugging the generated _SpecRunner.html in a browser
-7. Commit your changes
-8. Open a pull request back to master in loglevel
-
-Reporting security issues
--------------------------
-
-Tidelift acts as the security contact for loglevel. Issues can be reported to security@tidelift.com, see https://tidelift.com/security for more details.
diff --git a/includes/external/matrix/node_modules/loglevel/Gruntfile.js b/includes/external/matrix/node_modules/loglevel/Gruntfile.js
deleted file mode 100644
index 5630d80..0000000
--- a/includes/external/matrix/node_modules/loglevel/Gruntfile.js
+++ /dev/null
@@ -1,230 +0,0 @@
-'use strict';
-
-module.exports = function (grunt) {
-
- // Project configuration.
- grunt.initConfig({
- // Metadata.
- pkg: grunt.file.readJSON('package.json'),
- banner: '/*! <%= pkg.name %> - v<%= pkg.version %>' +
- ' - <%= pkg.homepage %>' +
- ' - (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
- ' - licensed <%= pkg.license %> */\n',
- // Task configuration.
- concat: {
- options: {
- banner: '<%= banner %>',
- stripBanners: true
- },
- dist: {
- src: ['lib/<%= pkg.name %>.js'],
- dest: 'dist/<%= pkg.name %>.js'
- }
- },
- uglify: {
- options: {
- banner: '<%= banner %>'
- },
- dist: {
- src: '<%= concat.dist.dest %>',
- dest: 'dist/<%= pkg.name %>.min.js'
- }
- },
- jasmine: {
- requirejs: {
- src: [],
- options: {
- specs: 'test/*-test.js',
- vendor: 'test/vendor/*.js',
- helpers: 'test/*-helper.js',
- template: require('grunt-template-jasmine-requirejs')
- }
- },
- global: {
- src: 'lib/**/*.js',
- options: {
- specs: 'test/global-integration.js',
- vendor: 'test/vendor/*.js'
- }
- },
- context: {
- src: 'test/test-context-using-apply.generated.js',
- options: {
- specs: 'test/global-integration-with-new-context.js',
- vendor: 'test/vendor/*.js'
- }
- },
- withCoverage: {
- src: 'lib/**/*.js',
- options: {
- specs: 'test/*-test.js',
- vendor: 'test/vendor/*.js',
- helpers: 'test/*-helper.js',
- template: require('grunt-template-jasmine-istanbul'),
- templateOptions: {
- coverage: 'coverage/coverage.json',
- report: [
- {
- type: 'html',
- options: {
- dir: 'coverage'
- }
- },
- {
- type: 'lcov',
- options: {
- dir: 'coverage'
- }
- }
- ],
-
- template: require('grunt-template-jasmine-requirejs'),
- templateOptions: {
- requireConfig: {
- paths: {
- "lib": '.grunt/grunt-contrib-jasmine/lib/'
- }
- }
- }
- }
- }
- }
- },
- "jasmine_node": {
- test: {
- options: {
- match: "node-integration.",
- matchall: true,
- projectRoot: "./test",
- useHelpers: false
- }
- }
- },
- coveralls: {
- src: 'coverage/lcov.info'
- },
- open: {
- jasmine: {
- path: 'http://127.0.0.1:8000/_SpecRunner.html'
- }
- },
- connect: {
- test: {
- port: 8000,
- keepalive: true
- }
- },
- 'saucelabs-jasmine': {
- // Requires valid SAUCE_USERNAME and SAUCE_ACCESS_KEY in env to run.
- all: {
- options: {
- urls: ['http://localhost:8000/_SpecRunner.html'],
- browsers: [
- {"browserName": "firefox", "platform": "Windows 2003", "version": "3.6"},
- {"browserName": "firefox", "platform": "Windows 2003", "version": "4"},
- {"browserName": "firefox", "platform": "Windows 2003", "version": "25"},
- {"browserName": "safari", "platform": "Mac 10.6", "version": "5"},
- {"browserName": "safari", "platform": "Mac 10.8", "version": "6"},
- {"browserName": "googlechrome", "platform": "Windows 7"},
- {"browserName": "opera", "platform": "Windows 2003", "version": "12"},
- // Disabled because old IE breaks the Jasmine runner; these have to be manually tested
- // {"browserName": "iehta", "platform": "Windows XP", "version": "6"},
- // {"browserName": "iehta", "platform": "Windows XP", "version": "7"},
- // {"browserName": "iehta", "platform": "Windows XP", "version": "8"},
- {"browserName": "iehta", "platform": "Windows 7", "version": "9"},
- {"browserName": "iehta", "platform": "Windows 7", "version": "10"},
- {"browserName": "opera", "platform": "Windows 7", "version": "12"},
- {"browserName": "android", "platform": "Linux", "version": "4.0"},
- {"browserName": "iphone", "platform": "OS X 10.8", "version": "6"}
- ],
- concurrency: 3,
- detailedError: true,
- testTimeout:10000,
- testInterval:1000,
- testReadyTimeout:2000,
- testname: 'loglevel jasmine test',
- tags: [process.env.TRAVIS_REPO_SLUG || "local", process.env.TRAVIS_COMMIT || "manual"]
- }
- }
- },
- jshint: {
- options: {
- jshintrc: '.jshintrc'
- },
- gruntfile: {
- src: 'Gruntfile.js'
- },
- lib: {
- options: {
- jshintrc: 'lib/.jshintrc'
- },
- src: ['lib/**/*.js']
- },
- test: {
- options: {
- jshintrc: 'test/.jshintrc'
- },
- src: ['test/*.js', '!test/*.generated.js']
- }
- },
- watch: {
- gruntfile: {
- files: '<%= jshint.gruntfile.src %>',
- tasks: ['jshint:gruntfile']
- },
- lib: {
- files: '<%= jshint.lib.src %>',
- tasks: ['jshint:lib', 'test']
- },
- test: {
- files: '<%= jshint.test.src %>',
- tasks: ['jshint:test', 'test']
- }
- },
- qunit: {
- all: ['test/*-qunit.html']
- },
- preprocess: {
- "test-context-using-apply": {
- src: 'test/test-context-using-apply.js',
- dest: 'test/test-context-using-apply.generated.js'
- }
- },
- clean:{
- test:['test/test-context-using-apply.generated.js']
- }
- });
-
- // These plugins provide necessary tasks.
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-contrib-jasmine');
- grunt.loadNpmTasks('grunt-coveralls');
- grunt.loadNpmTasks('grunt-jasmine-node');
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.loadNpmTasks('grunt-contrib-qunit');
-
- grunt.loadNpmTasks('grunt-contrib-connect');
- grunt.loadNpmTasks('grunt-open');
- grunt.loadNpmTasks('grunt-saucelabs');
- grunt.loadNpmTasks('grunt-preprocess');
- grunt.loadNpmTasks('grunt-contrib-clean');
-
- // Build a distributable release
- grunt.registerTask('dist', ['test', 'concat', 'uglify']);
-
- // Check everything is good
- grunt.registerTask('test', ['jshint', 'jasmine:requirejs', 'jasmine:global', 'preprocess', 'jasmine:context', 'clean:test', 'jasmine_node', 'jasmine:withCoverage', 'qunit']);
-
- // Test with a live server and an actual browser
- grunt.registerTask('integration-test', ['jasmine:requirejs:src:build', 'open:jasmine', 'connect:test:keepalive']);
-
- // Test with lots of browsers on saucelabs. Requires valid SAUCE_USERNAME and SAUCE_ACCESS_KEY in env to run.
- grunt.registerTask('saucelabs', ['jasmine:requirejs:src:build', 'connect:test', 'saucelabs-jasmine']);
-
- // Default task.
- grunt.registerTask('default', 'test');
- grunt.registerTask('ci', ['test', 'coveralls']);
-
-};
diff --git a/includes/external/matrix/node_modules/loglevel/LICENSE-MIT b/includes/external/matrix/node_modules/loglevel/LICENSE-MIT
deleted file mode 100644
index d384208..0000000
--- a/includes/external/matrix/node_modules/loglevel/LICENSE-MIT
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2013 Tim Perry
-
-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/includes/external/matrix/node_modules/loglevel/README.md b/includes/external/matrix/node_modules/loglevel/README.md
deleted file mode 100644
index a9f8ffe..0000000
--- a/includes/external/matrix/node_modules/loglevel/README.md
+++ /dev/null
@@ -1,362 +0,0 @@
-
-# loglevel [![NPM version][npm-image]][npm-url] [![NPM downloads](https://img.shields.io/npm/dw/loglevel.svg)](https://www.npmjs.com/package/loglevel) [![Build status](https://travis-ci.org/pimterry/loglevel.png)](https://travis-ci.org/pimterry/loglevel) [![Coveralls percentage](https://img.shields.io/coveralls/pimterry/loglevel.svg)](https://coveralls.io/r/pimterry/loglevel?branch=master)
-
-[npm-image]: https://img.shields.io/npm/v/loglevel.svg?style=flat
-[npm-url]: https://npmjs.org/package/loglevel
-
-> _Don't debug with logs alone - check out [HTTP Toolkit](https://httptoolkit.tech/javascript): beautiful, powerful & open-source tools for building, testing & debugging HTTP(S)_
-
-Minimal lightweight simple logging for JavaScript. loglevel replaces console.log() and friends with level-based logging and filtering, with none of console's downsides.
-
-This is a barebones reliable everyday logging library. It does not do fancy things, it does not let you reconfigure appenders or add complex log filtering rules or boil tea (more's the pity), but it does have the all core functionality that you actually use:
-
-## Features
-
-### Simple
-
-* Log things at a given level (trace/debug/info/warn/error) to the console object (as seen in all modern browsers & node.js)
-* Filter logging by level (all the above or 'silent'), so you can disable all but error logging in production, and then run log.setLevel("trace") in your console to turn it all back on for a furious debugging session
-* Single file, no dependencies, weighs in at 1.1KB minified and gzipped
-
-### Effective
-
-* Log methods gracefully fall back to simpler console logging methods if more specific ones aren't available: so calls to log.debug() go to console.debug() if possible, or console.log() if not
-* Logging calls still succeed even if there's no console object at all, so your site doesn't break when people visit with old browsers that don't support the console object (here's looking at you IE) and similar
-* This then comes together giving a consistent reliable API that works in every JavaScript environment with a console available, and never breaks anything anywhere else
-
-### Convenient
-
-* Log output keeps line numbers: most JS logging frameworks call console.log methods through wrapper functions, clobbering your stacktrace and making the extra info many browsers provide useless. We'll have none of that thanks.
-* It works with all the standard JavaScript loading systems out of the box (CommonJS, AMD, or just as a global)
-* Logging is filtered to "warn" level by default, to keep your live site clean in normal usage (or you can trivially re-enable everything with an initial log.enableAll() call)
-* Magically handles situations where console logging is not initially available (IE8/9), and automatically enables logging as soon as it does become available (when developer console is opened)
-* TypeScript type definitions included, so no need for extra `@types` packages
-* Extensible, to add other log redirection, filtering, or formatting functionality, while keeping all the above (except you will clobber your stacktrace, see Plugins below)
-
-## Downloading loglevel
-
-If you're using NPM, you can just run `npm install loglevel`.
-
-Alternatively, loglevel is also available via [Bower](https://github.com/bower/bower) (`bower install loglevel`), as a [Webjar](http://www.webjars.org/), or an [Atmosphere package](https://atmospherejs.com/spacejamio/loglevel) (for Meteor)
-
-Alternatively if you just want to grab the file yourself, you can download either the current stable [production version][min] or the [development version][max] directly, or reference it remotely on unpkg at [`https://unpkg.com/loglevel/dist/loglevel.min.js`][cdn] (this will redirect to a latest version, use the resulting redirected URL if you want to pin that version).
-
-Finally, if you want to tweak loglevel to your own needs or you immediately need the cutting-edge version, clone this repo and see [Developing & Contributing](#developing--contributing) below for build instructions.
-
-[min]: https://raw.github.com/pimterry/loglevel/master/dist/loglevel.min.js
-[max]: https://raw.github.com/pimterry/loglevel/master/dist/loglevel.js
-[cdn]: https://unpkg.com/loglevel/dist/loglevel.min.js
-
-## Setting it up
-
-loglevel supports AMD (e.g. RequireJS), CommonJS (e.g. Node.js) and direct usage (e.g. loading globally with a &lt;script&gt; tag) loading methods. You should be able to do nearly anything, and then skip to the next section anyway and have it work. Just in case though, here's some specific examples that definitely do the right thing:
-
-### CommonsJS (e.g. Node)
-
-```javascript
-var log = require('loglevel');
-log.warn("unreasonably simple");
-```
-
-### AMD (e.g. RequireJS)
-
-```javascript
-define(['loglevel'], function(log) {
- log.warn("dangerously convenient");
-});
-```
-
-### Directly in your web page:
-
-```html
-<script src="loglevel.min.js"></script>
-<script>
-log.warn("too easy");
-</script>
-```
-
-### As an ES6 module:
-
-loglevel is written as a UMD module, with a single object exported. Unfortunately ES6 module loaders & transpilers don't all handle this the same way. Some will treat the object as the default export, while others use it as the root exported object. In addition, loglevel includes `default` property on the root object, designed to help handle this differences. Nonetheless, there's two possible syntaxes that might work for you:
-
-For most tools, using the default import is the most convenient and flexible option:
-
-```javascript
-import log from 'loglevel';
-log.warn("module-tastic");
-```
-
-For some tools though, it might better to wildcard import the whole object:
-
-```javascript
-import * as log from 'loglevel';
-log.warn("module-tastic");
-```
-
-There's no major difference, unless you're using TypeScript & building a loglevel plugin (in that case, see https://github.com/pimterry/loglevel/issues/149). In general though, just use whichever suits your environment, and everything should work out fine.
-
-### With noConflict():
-
-If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel. Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded onto the page. This resets to 'log' global to its value before loglevel was loaded (typically `undefined`), and returns the loglevel object, which you can then bind to another name yourself.
-
-For example:
-
-```html
-<script src="loglevel.min.js"></script>
-<script>
-var logging = log.noConflict();
-
-logging.warn("still pretty easy");
-</script>
-```
-
-### TypeScript:
-
-loglevel includes its own type definitions, assuming you're using a modern module environment (e.g. Node.JS, webpack, etc), you should be able to use the ES6 syntax above, and everything will work immediately. If not, file a bug!
-
-If you really want to use LogLevel as a global however, but from TypeScript, you'll need to declare it as such first. To do that:
-
-* Create a `loglevel.d.ts` file
-* Ensure that file is included in your build (e.g. add it to `include` in your tsconfig, pass it on the command line, or use `///<reference path="./loglevel.d.ts" />`)
-* In that file, add:
- ```typescript
- import * as log from 'loglevel';
- export as namespace log;
- export = log;
- ```
-
-## Documentation
-
-The loglevel API is extremely minimal. All methods are available on the root loglevel object, which it's suggested you name 'log' (this is the default if you import it in globally, and is what's set up in the above examples). The API consists of:
-
-* 5 actual logging methods, ordered and available as:
- * `log.trace(msg)`
- * `log.debug(msg)`
- * `log.info(msg)`
- * `log.warn(msg)`
- * `log.error(msg)`
-
- `log.log(msg)` is also available, as an alias for `log.debug(msg)`, to improve compatibility with `console`, and make migration easier.
-
- Exact output formatting of these will depend on the console available in the current context of your application. For example, many environments will include a full stack trace with all trace() calls, and icons or similar to highlight other calls.
-
- These methods should never fail in any environment, even if no console object is currently available, and should always fall back to an available log method even if the specific method called (e.g. warn) isn't available.
-
- Be aware that all this means that these method won't necessarily always produce exactly the output you expect in every environment; loglevel only guarantees that these methods will never explode on you, and that it will call the most relevant method it can find, with your argument. For example, `log.trace(msg)` in Firefox before version 64 prints the stacktrace by itself, and doesn't include your message (see [#84](https://github.com/pimterry/loglevel/issues/84)).
-
-* A `log.setLevel(level, [persist])` method.
-
- This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") or log.error("something") will output messages, but log.info("something") will not.
-
- This can take either a log level name or 'silent' (which disables everything) in one of a few forms:
- * As a log level from the internal levels list, e.g. log.levels.SILENT ← _for type safety_
- * As a string, like 'error' (case-insensitive) ← _for a reasonable practical balance_
- * As a numeric index from 0 (trace) to 5 (silent) ← _deliciously terse, and more easily programmable (...although, why?)_
-
- Where possible the log level will be persisted. LocalStorage will be used if available, falling back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass `false` as the optional 'persist' second argument, persistence will be skipped.
-
- If log.setLevel() is called when a console object is not available (in IE 8 or 9 before the developer tools have been opened, for example) logging will remain silent until the console becomes available, and then begin logging at the requested level.
-
-* A `log.setDefaultLevel(level)` method.
-
- This sets the current log level only if one has not been persisted and can’t be loaded. This is useful when initializing scripts; if a developer or user has previously called `setLevel()`, this won’t alter their settings. For example, your application might set the log level to `error` in a production environment, but when debugging an issue, you might call `setLevel("trace")` on the console to see all the logs. If that `error` setting was set using `setDefaultLevel()`, it will still stay as `trace` on subsequent page loads and refreshes instead of resetting to `error`.
-
- The `level` argument takes is the same values that you might pass to `setLevel()`. Levels set using `setDefaultLevel()` never persist to subsequent page loads.
-
-* A `log.resetLevel()` method.
-
- This resets the current log level to the default level (or `warn` if no explicit default was set) and clears the persisted level if one was previously persisted.
-
-* `log.enableAll()` and `log.disableAll()` methods.
-
- These enable or disable all log messages, and are equivalent to log.setLevel("trace") and log.setLevel("silent") respectively.
-
-* A `log.getLevel()` method.
-
- Returns the current logging level, as a number from 0 (trace) to 5 (silent)
-
- It's very unlikely you'll need to use this for normal application logging; it's provided partly to help plugin development, and partly to let you optimize logging code as below, where debug data is only generated if the level is set such that it'll actually be logged. This probably doesn't affect you, unless you've run profiling on your code and you have hard numbers telling you that your log data generation is a real performance problem.
-
- ```javascript
- if (log.getLevel() <= log.levels.DEBUG) {
- var logData = runExpensiveDataGeneration();
- log.debug(logData);
- }
- ```
-
- This notably isn't the right solution to avoid the cost of string concatenation in your logging. Firstly, it's very unlikely that string concatenation in your logging is really an important performance problem. Even if you do genuinely have hard metrics showing that it is though, the better solution that wrapping your log statements in this is to use multiple arguments, as below. The underlying console API will automatically concatenate these for you if logging is enabled, and if it isn't then all log methods are no-ops, and no concatenation will be done at all.
-
- ```javascript
- // Prints 'My concatenated log message'
- log.debug("My ", "concatenated ", "log message");
- ```
-
-* A `log.getLogger(loggerName)` method.
-
- This gets you a new logger object that works exactly like the root `log` object, but can have its level and logging methods set independently. All loggers must have a name (which is a non-empty string, or a [Symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)). Calling `getLogger()` multiple times with the same name will return an identical logger object.
-
- In large applications, it can be incredibly useful to turn logging on and off for particular modules as you are working with them. Using the `getLogger()` method lets you create a separate logger for each part of your application with its own logging level.
-
- Likewise, for small, independent modules, using a named logger instead of the default root logger allows developers using your module to selectively turn on deep, trace-level logging when trying to debug problems, while logging only errors or silencing logging altogether under normal circumstances.
-
- Example usage *(using CommonJS modules, but you could do the same with any module system):*
-
- ```javascript
- // In module-one.js:
- var log = require("loglevel").getLogger("module-one");
- function doSomethingAmazing() {
- log.debug("Amazing message from module one.");
- }
-
- // In module-two.js:
- var log = require("loglevel").getLogger("module-two");
- function doSomethingSpecial() {
- log.debug("Special message from module two.");
- }
-
- // In your main application module:
- var log = require("loglevel");
- var moduleOne = require("module-one");
- var moduleTwo = require("module-two");
- log.getLogger("module-two").setLevel("TRACE");
-
- moduleOne.doSomethingAmazing();
- moduleTwo.doSomethingSpecial();
- // logs "Special message from module two."
- // (but nothing from module one.)
- ```
-
- Loggers returned by `getLogger()` support all the same properties and methods as the default root logger, excepting `noConflict()` and the `getLogger()` method itself.
-
- Like the root logger, other loggers can have their logging level saved. If a logger’s level has not been saved, it will inherit the root logger’s level when it is first created. If the root logger’s level changes later, the new level will not affect other loggers that have already been created. Loggers with Symbol names (rather than string names) will be always considered as unique instances, and will never have their logging level saved or restored.
-
- Likewise, loggers will inherit the root logger’s `methodFactory`. After creation, each logger can have its `methodFactory` independently set. See the *plugins* section below for more about `methodFactory`.
-
-* A `log.getLoggers()` method.
-
- This will return you the dictionary of all loggers created with `getLogger`, keyed off of their names.
-
-## Plugins
-
-### Existing plugins:
-
-[loglevel-plugin-prefix](https://github.com/kutuluk/loglevel-plugin-prefix) - plugin for loglevel message prefixing.
-
-[loglevel-plugin-remote](https://github.com/kutuluk/loglevel-plugin-remote) - plugin for sending loglevel messages to a remote log server.
-
-ServerSend - https://github.com/artemyarulin/loglevel-serverSend - Forward your log messages to a remote server.
-
-DEBUG - https://github.com/vectrlabs/loglevel-debug - Control logging from a DEBUG environmental variable (similar to the classic [Debug](https://github.com/visionmedia/debug) module)
-
-### Writing plugins:
-
-Loglevel provides a simple reliable minimal base for console logging that works everywhere. This means it doesn't include lots of fancy functionality that might be useful in some cases, such as log formatting and redirection (e.g. also sending log messages to a server over AJAX)
-
-Including that would increase the size and complexity of the library, but more importantly would remove stacktrace information. Currently log methods are either disabled, or enabled with directly bound versions of the console.log methods (where possible). This means your browser shows the log message as coming from your code at the call to `log.info("message!")` not from within loglevel, since it really calls the bound console method directly, without indirection. The indirection required to dynamically format, further filter, or redirect log messages would stop this.
-
-There's clearly enough enthusiasm for this even at that cost though that loglevel now includes a plugin API. To use it, redefine `log.methodFactory(methodName, logLevel, loggerName)` with a function of your own. This will be called for each enabled method each time the level is set (including initially), and should return a function to be used for the given log method `methodName`, at the given *configured* (not actual) level `logLevel`, for a logger with the given name `loggerName`. If you'd like to retain all the reliability and features of loglevel, it's recommended that this wraps the initially provided value of `log.methodFactory`.
-
-For example, a plugin to prefix all log messages with "Newsflash: " would look like:
-
-```javascript
-var originalFactory = log.methodFactory;
-log.methodFactory = function (methodName, logLevel, loggerName) {
- var rawMethod = originalFactory(methodName, logLevel, loggerName);
-
- return function (message) {
- rawMethod("Newsflash: " + message);
- };
-};
-log.setLevel(log.getLevel()); // Be sure to call setLevel method in order to apply plugin
-```
-
-*(The above supports only a single string `log.warn("...")` argument for clarity, but it's easy to extend to a [fuller variadic version](http://jsbin.com/xehoye/edit?html,console).)*
-
-If you develop and release a plugin, please get in contact! I'd be happy to reference it here for future users. Some consistency is helpful; naming your plugin 'loglevel-PLUGINNAME' (e.g. loglevel-newsflash) is preferred, as is giving it the 'loglevel-plugin' keyword in your package.json
-
-## Developing & Contributing
-In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
-
-Builds can be run with npm: run `npm run dist` to build a distributable version of the project (in /dist), or `npm test` to just run the tests and linting. During development you can run `npm run watch` and it will monitor source files, and rerun the tests and linting as appropriate when they're changed.
-
-_Also, please don't manually edit files in the "dist" subdirectory as they are generated via Grunt. You'll find source code in the "lib" subdirectory!_
-
-#### Release process
-
-To do a release of loglevel:
-
-* Update the version number in package.json and bower.json
-* Run `npm run dist` to build a distributable version in dist/
-* Update the release history in this file (below)
-* Commit the built code, tagging it with the version number and a brief message about the release
-* Push to Github
-* Run `npm publish .` to publish to NPM
-
-## Release History
-v0.1.0 - First working release with apparent compatibility with everything tested
-
-v0.2.0 - Updated release with various tweaks and polish and real proper documentation attached
-
-v0.3.0 - Some bugfixes (#12, #14), cookie-based log level persistence, doc tweaks, support for Bower and JamJS
-
-v0.3.1 - Fixed incorrect text in release build banner, various other minor tweaks
-
-v0.4.0 - Use LocalStorage for level persistence if available, compatibility improvements for IE, improved error messages, multi-environment tests
-
-v0.5.0 - Fix for Modernizr+IE8 issues, improved setLevel error handling, support for auto-activation of desired logging when console eventually turns up in IE8
-
-v0.6.0 - Handle logging in Safari private browsing mode (#33), fix TRACE level persistence bug (#35), plus various minor tweaks
-
-v1.0.0 - Official stable release! Fixed a bug with localStorage in Android webviews, improved CommonJS detection, and added noConflict().
-
-v1.1.0 - Added support for including loglevel with preprocessing and .apply() (#50), and fixed QUnit dep version which made tests potentially unstable.
-
-v1.2.0 - New plugin API! Plus various bits of refactoring and tidy up, nicely simplifying things and trimming the size down.
-
-v1.3.0 - Make persistence optional in setLevel, plus lots of documentation updates and other small tweaks
-
-v1.3.1 - With the new optional persistence, stop unnecessarily persisting the initially set default level (warn)
-
-v1.4.0 - Add getLevel(), setDefaultLevel() and getLogger() functionality for more fine-grained log level control
-
-v1.4.1 - Reorder UMD (#92) to improve bundling tool compatibility
-
-v1.5.0 - Fix log.debug (#111) after V8 changes deprecating console.debug, check for `window` upfront (#104), and add `.log` alias for `.debug` (#64)
-
-v1.5.1 - Fix bug (#112) in level-persistence cookie fallback, which failed if it wasn't the first cookie present
-
-v1.6.0 - Add a name property to loggers and add log.getLoggers() (#114), and recommend unpkg as CDN instead of CDNJS.
-
-v1.6.1 - Various small documentation & test updates
-
-v1.6.2 - Include TypeScript type definitions in the package itself
-
-v1.6.3 - Avoid TypeScript type conflicts with other global `log` types (e.g. `core-js`)
-
-v1.6.4 - Ensure package.json's 'main' is a fully qualified path, to fix webpack issues
-
-v1.6.5 - Ensure the provided message is included when calling trace() in IE11
-
-v1.6.6 - Fix bugs in v1.6.5, which caused issues in node.js & IE < 9
-
-v1.6.7 - Fix a bug in environments with `window` defined but no `window.navigator`
-
-v1.6.8 - Update TypeScript type definitions to include `log.log()`.
-
-v1.7.0 - Add support for Symbol-named loggers, and a `.default` property to help with ES6 module usage.
-
-v1.7.1 - Update TypeScript types to support Symbol-named loggers.
-
-v1.8.0 - Add resetLevel() method to clear persisted levels & reset to defaults
-
-v1.8.1 - Fix incorrect type definitions for MethodFactory
-
-## `loglevel` for enterprise
-
-Available as part of the Tidelift Subscription.
-
-The maintainers of `loglevel` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-loglevel?utm_source=npm-loglevel&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
-
-## License
-Copyright (c) 2013 Tim Perry
-Licensed under the MIT license.
diff --git a/includes/external/matrix/node_modules/loglevel/_config.yml b/includes/external/matrix/node_modules/loglevel/_config.yml
deleted file mode 100644
index 2f7efbe..0000000
--- a/includes/external/matrix/node_modules/loglevel/_config.yml
+++ /dev/null
@@ -1 +0,0 @@
-theme: jekyll-theme-minimal \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/loglevel/bower.json b/includes/external/matrix/node_modules/loglevel/bower.json
deleted file mode 100644
index ac0f958..0000000
--- a/includes/external/matrix/node_modules/loglevel/bower.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "loglevel",
- "version": "1.8.1",
- "main": "dist/loglevel.min.js",
- "dependencies": {},
- "ignore": [
- "**/.*",
- "node_modules",
- "components"
- ]
-}
diff --git a/includes/external/matrix/node_modules/loglevel/dist/loglevel.js b/includes/external/matrix/node_modules/loglevel/dist/loglevel.js
deleted file mode 100644
index 83cc77d..0000000
--- a/includes/external/matrix/node_modules/loglevel/dist/loglevel.js
+++ /dev/null
@@ -1,292 +0,0 @@
-/*! loglevel - v1.8.1 - https://github.com/pimterry/loglevel - (c) 2022 Tim Perry - licensed MIT */
-(function (root, definition) {
- "use strict";
- if (typeof define === 'function' && define.amd) {
- define(definition);
- } else if (typeof module === 'object' && module.exports) {
- module.exports = definition();
- } else {
- root.log = definition();
- }
-}(this, function () {
- "use strict";
-
- // Slightly dubious tricks to cut down minimized file size
- var noop = function() {};
- var undefinedType = "undefined";
- var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (
- /Trident\/|MSIE /.test(window.navigator.userAgent)
- );
-
- var logMethods = [
- "trace",
- "debug",
- "info",
- "warn",
- "error"
- ];
-
- // Cross-browser bind equivalent that works at least back to IE6
- function bindMethod(obj, methodName) {
- var method = obj[methodName];
- if (typeof method.bind === 'function') {
- return method.bind(obj);
- } else {
- try {
- return Function.prototype.bind.call(method, obj);
- } catch (e) {
- // Missing bind shim or IE8 + Modernizr, fallback to wrapping
- return function() {
- return Function.prototype.apply.apply(method, [obj, arguments]);
- };
- }
- }
- }
-
- // Trace() doesn't print the message in IE, so for that case we need to wrap it
- function traceForIE() {
- if (console.log) {
- if (console.log.apply) {
- console.log.apply(console, arguments);
- } else {
- // In old IE, native console methods themselves don't have apply().
- Function.prototype.apply.apply(console.log, [console, arguments]);
- }
- }
- if (console.trace) console.trace();
- }
-
- // Build the best logging method possible for this env
- // Wherever possible we want to bind, not wrap, to preserve stack traces
- function realMethod(methodName) {
- if (methodName === 'debug') {
- methodName = 'log';
- }
-
- if (typeof console === undefinedType) {
- return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives
- } else if (methodName === 'trace' && isIE) {
- return traceForIE;
- } else if (console[methodName] !== undefined) {
- return bindMethod(console, methodName);
- } else if (console.log !== undefined) {
- return bindMethod(console, 'log');
- } else {
- return noop;
- }
- }
-
- // These private functions always need `this` to be set properly
-
- function replaceLoggingMethods(level, loggerName) {
- /*jshint validthis:true */
- for (var i = 0; i < logMethods.length; i++) {
- var methodName = logMethods[i];
- this[methodName] = (i < level) ?
- noop :
- this.methodFactory(methodName, level, loggerName);
- }
-
- // Define log.log as an alias for log.debug
- this.log = this.debug;
- }
-
- // In old IE versions, the console isn't present until you first open it.
- // We build realMethod() replacements here that regenerate logging methods
- function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {
- return function () {
- if (typeof console !== undefinedType) {
- replaceLoggingMethods.call(this, level, loggerName);
- this[methodName].apply(this, arguments);
- }
- };
- }
-
- // By default, we use closely bound real methods wherever possible, and
- // otherwise we wait for a console to appear, and then try again.
- function defaultMethodFactory(methodName, level, loggerName) {
- /*jshint validthis:true */
- return realMethod(methodName) ||
- enableLoggingWhenConsoleArrives.apply(this, arguments);
- }
-
- function Logger(name, defaultLevel, factory) {
- var self = this;
- var currentLevel;
- defaultLevel = defaultLevel == null ? "WARN" : defaultLevel;
-
- var storageKey = "loglevel";
- if (typeof name === "string") {
- storageKey += ":" + name;
- } else if (typeof name === "symbol") {
- storageKey = undefined;
- }
-
- function persistLevelIfPossible(levelNum) {
- var levelName = (logMethods[levelNum] || 'silent').toUpperCase();
-
- if (typeof window === undefinedType || !storageKey) return;
-
- // Use localStorage if available
- try {
- window.localStorage[storageKey] = levelName;
- return;
- } catch (ignore) {}
-
- // Use session cookie as fallback
- try {
- window.document.cookie =
- encodeURIComponent(storageKey) + "=" + levelName + ";";
- } catch (ignore) {}
- }
-
- function getPersistedLevel() {
- var storedLevel;
-
- if (typeof window === undefinedType || !storageKey) return;
-
- try {
- storedLevel = window.localStorage[storageKey];
- } catch (ignore) {}
-
- // Fallback to cookies if local storage gives us nothing
- if (typeof storedLevel === undefinedType) {
- try {
- var cookie = window.document.cookie;
- var location = cookie.indexOf(
- encodeURIComponent(storageKey) + "=");
- if (location !== -1) {
- storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];
- }
- } catch (ignore) {}
- }
-
- // If the stored level is not valid, treat it as if nothing was stored.
- if (self.levels[storedLevel] === undefined) {
- storedLevel = undefined;
- }
-
- return storedLevel;
- }
-
- function clearPersistedLevel() {
- if (typeof window === undefinedType || !storageKey) return;
-
- // Use localStorage if available
- try {
- window.localStorage.removeItem(storageKey);
- return;
- } catch (ignore) {}
-
- // Use session cookie as fallback
- try {
- window.document.cookie =
- encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
- } catch (ignore) {}
- }
-
- /*
- *
- * Public logger API - see https://github.com/pimterry/loglevel for details
- *
- */
-
- self.name = name;
-
- self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,
- "ERROR": 4, "SILENT": 5};
-
- self.methodFactory = factory || defaultMethodFactory;
-
- self.getLevel = function () {
- return currentLevel;
- };
-
- self.setLevel = function (level, persist) {
- if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {
- level = self.levels[level.toUpperCase()];
- }
- if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {
- currentLevel = level;
- if (persist !== false) { // defaults to true
- persistLevelIfPossible(level);
- }
- replaceLoggingMethods.call(self, level, name);
- if (typeof console === undefinedType && level < self.levels.SILENT) {
- return "No console available for logging";
- }
- } else {
- throw "log.setLevel() called with invalid level: " + level;
- }
- };
-
- self.setDefaultLevel = function (level) {
- defaultLevel = level;
- if (!getPersistedLevel()) {
- self.setLevel(level, false);
- }
- };
-
- self.resetLevel = function () {
- self.setLevel(defaultLevel, false);
- clearPersistedLevel();
- };
-
- self.enableAll = function(persist) {
- self.setLevel(self.levels.TRACE, persist);
- };
-
- self.disableAll = function(persist) {
- self.setLevel(self.levels.SILENT, persist);
- };
-
- // Initialize with the right level
- var initialLevel = getPersistedLevel();
- if (initialLevel == null) {
- initialLevel = defaultLevel;
- }
- self.setLevel(initialLevel, false);
- }
-
- /*
- *
- * Top-level API
- *
- */
-
- var defaultLogger = new Logger();
-
- var _loggersByName = {};
- defaultLogger.getLogger = function getLogger(name) {
- if ((typeof name !== "symbol" && typeof name !== "string") || name === "") {
- throw new TypeError("You must supply a name when creating a logger.");
- }
-
- var logger = _loggersByName[name];
- if (!logger) {
- logger = _loggersByName[name] = new Logger(
- name, defaultLogger.getLevel(), defaultLogger.methodFactory);
- }
- return logger;
- };
-
- // Grab the current global log variable in case of overwrite
- var _log = (typeof window !== undefinedType) ? window.log : undefined;
- defaultLogger.noConflict = function() {
- if (typeof window !== undefinedType &&
- window.log === defaultLogger) {
- window.log = _log;
- }
-
- return defaultLogger;
- };
-
- defaultLogger.getLoggers = function getLoggers() {
- return _loggersByName;
- };
-
- // ES6 default export, for compatibility
- defaultLogger['default'] = defaultLogger;
-
- return defaultLogger;
-}));
diff --git a/includes/external/matrix/node_modules/loglevel/dist/loglevel.min.js b/includes/external/matrix/node_modules/loglevel/dist/loglevel.min.js
deleted file mode 100644
index 8ab9aa6..0000000
--- a/includes/external/matrix/node_modules/loglevel/dist/loglevel.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! loglevel - v1.8.1 - https://github.com/pimterry/loglevel - (c) 2022 Tim Perry - licensed MIT */
-!function(a,b){"use strict";"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.log=b()}(this,function(){"use strict";function a(a,b){var c=a[b];if("function"==typeof c.bind)return c.bind(a);try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(c){return"debug"===c&&(c="log"),typeof console!==i&&("trace"===c&&j?b:void 0!==console[c]?a(console,c):void 0!==console.log?a(console,"log"):h)}function d(a,b){for(var c=0;c<k.length;c++){var d=k[c];this[d]=c<a?h:this.methodFactory(d,a,b)}this.log=this.debug}function e(a,b,c){return function(){typeof console!==i&&(d.call(this,b,c),this[a].apply(this,arguments))}}function f(a,b,d){return c(a)||e.apply(this,arguments)}function g(a,b,c){function e(a){var b=(k[a]||"silent").toUpperCase();if(typeof window!==i&&m){try{return void(window.localStorage[m]=b)}catch(a){}try{window.document.cookie=encodeURIComponent(m)+"="+b+";"}catch(a){}}}function g(){var a;if(typeof window!==i&&m){try{a=window.localStorage[m]}catch(a){}if(typeof a===i)try{var b=window.document.cookie,c=b.indexOf(encodeURIComponent(m)+"=");-1!==c&&(a=/^([^;]+)/.exec(b.slice(c))[1])}catch(a){}return void 0===l.levels[a]&&(a=void 0),a}}function h(){if(typeof window!==i&&m){try{return void window.localStorage.removeItem(m)}catch(a){}try{window.document.cookie=encodeURIComponent(m)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(a){}}}var j,l=this;b=null==b?"WARN":b;var m="loglevel";"string"==typeof a?m+=":"+a:"symbol"==typeof a&&(m=void 0),l.name=a,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=c||f,l.getLevel=function(){return j},l.setLevel=function(b,c){if("string"==typeof b&&void 0!==l.levels[b.toUpperCase()]&&(b=l.levels[b.toUpperCase()]),!("number"==typeof b&&b>=0&&b<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+b;if(j=b,!1!==c&&e(b),d.call(l,b,a),typeof console===i&&b<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(a){b=a,g()||l.setLevel(a,!1)},l.resetLevel=function(){l.setLevel(b,!1),h()},l.enableAll=function(a){l.setLevel(l.levels.TRACE,a)},l.disableAll=function(a){l.setLevel(l.levels.SILENT,a)};var n=g();null==n&&(n=b),l.setLevel(n,!1)}var h=function(){},i="undefined",j=typeof window!==i&&typeof window.navigator!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"],l=new g,m={};l.getLogger=function(a){if("symbol"!=typeof a&&"string"!=typeof a||""===a)throw new TypeError("You must supply a name when creating a logger.");var b=m[a];return b||(b=m[a]=new g(a,l.getLevel(),l.methodFactory)),b};var n=typeof window!==i?window.log:void 0;return l.noConflict=function(){return typeof window!==i&&window.log===l&&(window.log=n),l},l.getLoggers=function(){return m},l.default=l,l}); \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/loglevel/index.d.ts b/includes/external/matrix/node_modules/loglevel/index.d.ts
deleted file mode 100644
index acb4d55..0000000
--- a/includes/external/matrix/node_modules/loglevel/index.d.ts
+++ /dev/null
@@ -1,194 +0,0 @@
-// Originally from Definitely Typed, see:
-// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b4683d7/types/loglevel/index.d.ts
-// Original definitions by: Stefan Profanter <https://github.com/Pro>
-// Gabor Szmetanko <https://github.com/szmeti>
-// Christian Rackerseder <https://github.com/screendriver>
-
-declare const log: log.RootLogger;
-export = log;
-
-declare namespace log {
- /**
- * Log levels
- */
- interface LogLevel {
- TRACE: 0;
- DEBUG: 1;
- INFO: 2;
- WARN: 3;
- ERROR: 4;
- SILENT: 5;
- }
-
- /**
- * Possible log level numbers.
- */
- type LogLevelNumbers = LogLevel[keyof LogLevel];
-
- /**
- * Possible log level descriptors, may be string, lower or upper case, or number.
- */
- type LogLevelDesc = LogLevelNumbers | LogLevelNames | 'silent' | keyof LogLevel;
-
- type LogLevelNames =
- | 'trace'
- | 'debug'
- | 'info'
- | 'warn'
- | 'error';
-
- type LoggingMethod = (...message: any[]) => void;
-
- type MethodFactory = (methodName: LogLevelNames, level: LogLevelNumbers, loggerName: string | symbol) => LoggingMethod;
-
- interface RootLogger extends Logger {
- /**
- * If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel.
- * Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded
- * onto the page. This resets to 'log' global to its value before loglevel was loaded (typically undefined), and
- * returns the loglevel object, which you can then bind to another name yourself.
- */
- noConflict(): any;
-
- /**
- * This gets you a new logger object that works exactly like the root log object, but can have its level and
- * logging methods set independently. All loggers must have a name (which is a non-empty string or a symbol)
- * Calling * getLogger() multiple times with the same name will return an identical logger object.
- * In large applications, it can be incredibly useful to turn logging on and off for particular modules as you are
- * working with them. Using the getLogger() method lets you create a separate logger for each part of your
- * application with its own logging level. Likewise, for small, independent modules, using a named logger instead
- * of the default root logger allows developers using your module to selectively turn on deep, trace-level logging
- * when trying to debug problems, while logging only errors or silencing logging altogether under normal
- * circumstances.
- * @param name The name of the produced logger
- */
- getLogger(name: string | symbol): Logger;
-
- /**
- * This will return you the dictionary of all loggers created with getLogger, keyed off of their names.
- */
- getLoggers(): { [name: string]: Logger };
-
- /**
- * A .default property for ES6 default import compatibility
- */
- default: RootLogger;
- }
-
- interface Logger {
- /**
- * Available log levels.
- */
- readonly levels: LogLevel;
-
- /**
- * Plugin API entry point. This will be called for each enabled method each time the level is set
- * (including initially), and should return a MethodFactory to be used for the given log method, at the given level,
- * for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's
- * recommended that this wraps the initially provided value of log.methodFactory
- */
- methodFactory: MethodFactory;
-
- /**
- * Output trace message to console.
- * This will also include a full stack trace
- *
- * @param msg any data to log to the console
- */
- trace(...msg: any[]): void;
-
- /**
- * Output debug message to console including appropriate icons
- *
- * @param msg any data to log to the console
- */
- debug(...msg: any[]): void;
-
- /**
- * Output debug message to console including appropriate icons
- *
- * @param msg any data to log to the console
- */
- log(...msg: any[]): void;
-
- /**
- * Output info message to console including appropriate icons
- *
- * @param msg any data to log to the console
- */
- info(...msg: any[]): void;
-
- /**
- * Output warn message to console including appropriate icons
- *
- * @param msg any data to log to the console
- */
- warn(...msg: any[]): void;
-
- /**
- * Output error message to console including appropriate icons
- *
- * @param msg any data to log to the console
- */
- error(...msg: any[]): void;
-
- /**
- * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something")
- * or log.error("something") will output messages, but log.info("something") will not.
- *
- * @param level as a string, like 'error' (case-insensitive) or as a number from 0 to 5 (or as log.levels. values)
- * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling
- * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass
- * false as the optional 'persist' second argument, persistence will be skipped.
- */
- setLevel(level: LogLevelDesc, persist?: boolean): void;
-
- /**
- * Returns the current logging level, as a value from LogLevel.
- * It's very unlikely you'll need to use this for normal application logging; it's provided partly to help plugin
- * development, and partly to let you optimize logging code as below, where debug data is only generated if the
- * level is set such that it'll actually be logged. This probably doesn't affect you, unless you've run profiling
- * on your code and you have hard numbers telling you that your log data generation is a real performance problem.
- */
- getLevel(): LogLevel[keyof LogLevel];
-
- /**
- * This sets the current log level only if one has not been persisted and can’t be loaded. This is useful when
- * initializing scripts; if a developer or user has previously called setLevel(), this won’t alter their settings.
- * For example, your application might set the log level to error in a production environment, but when debugging
- * an issue, you might call setLevel("trace") on the console to see all the logs. If that error setting was set
- * using setDefaultLevel(), it will still say as trace on subsequent page loads and refreshes instead of resetting
- * to error.
- *
- * The level argument takes is the same values that you might pass to setLevel(). Levels set using
- * setDefaultLevel() never persist to subsequent page loads.
- *
- * @param level as a string, like 'error' (case-insensitive) or as a number from 0 to 5 (or as log.levels. values)
- */
- setDefaultLevel(level: LogLevelDesc): void;
-
- /**
- * This resets the current log level to the default level (or `warn` if no explicit default was set) and clears
- * the persisted level if one was previously persisted.
- */
- resetLevel(): void;
-
- /**
- * This enables all log messages, and is equivalent to log.setLevel("trace").
- *
- * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling
- * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass
- * false as the optional 'persist' second argument, persistence will be skipped.
- */
- enableAll(persist?: boolean): void;
-
- /**
- * This disables all log messages, and is equivalent to log.setLevel("silent").
- *
- * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling
- * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass
- * false as the optional 'persist' second argument, persistence will be skipped.
- */
- disableAll(persist?: boolean): void;
- }
-}
diff --git a/includes/external/matrix/node_modules/loglevel/lib/.jshintrc b/includes/external/matrix/node_modules/loglevel/lib/.jshintrc
deleted file mode 100644
index 0eacda6..0000000
--- a/includes/external/matrix/node_modules/loglevel/lib/.jshintrc
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "curly": false,
- "eqeqeq": true,
- "immed": true,
- "latedef": true,
- "newcap": true,
- "noarg": true,
- "sub": true,
- "undef": true,
- "boss": true,
- "eqnull": true,
- "es3": true,
- "notypeof": true,
- "globals": {
- "console": false,
- "exports": false,
- "define": false,
- "module": false,
- "window": false
- }
-}
diff --git a/includes/external/matrix/node_modules/loglevel/lib/loglevel.js b/includes/external/matrix/node_modules/loglevel/lib/loglevel.js
deleted file mode 100644
index 46d3039..0000000
--- a/includes/external/matrix/node_modules/loglevel/lib/loglevel.js
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
-* loglevel - https://github.com/pimterry/loglevel
-*
-* Copyright (c) 2013 Tim Perry
-* Licensed under the MIT license.
-*/
-(function (root, definition) {
- "use strict";
- if (typeof define === 'function' && define.amd) {
- define(definition);
- } else if (typeof module === 'object' && module.exports) {
- module.exports = definition();
- } else {
- root.log = definition();
- }
-}(this, function () {
- "use strict";
-
- // Slightly dubious tricks to cut down minimized file size
- var noop = function() {};
- var undefinedType = "undefined";
- var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (
- /Trident\/|MSIE /.test(window.navigator.userAgent)
- );
-
- var logMethods = [
- "trace",
- "debug",
- "info",
- "warn",
- "error"
- ];
-
- // Cross-browser bind equivalent that works at least back to IE6
- function bindMethod(obj, methodName) {
- var method = obj[methodName];
- if (typeof method.bind === 'function') {
- return method.bind(obj);
- } else {
- try {
- return Function.prototype.bind.call(method, obj);
- } catch (e) {
- // Missing bind shim or IE8 + Modernizr, fallback to wrapping
- return function() {
- return Function.prototype.apply.apply(method, [obj, arguments]);
- };
- }
- }
- }
-
- // Trace() doesn't print the message in IE, so for that case we need to wrap it
- function traceForIE() {
- if (console.log) {
- if (console.log.apply) {
- console.log.apply(console, arguments);
- } else {
- // In old IE, native console methods themselves don't have apply().
- Function.prototype.apply.apply(console.log, [console, arguments]);
- }
- }
- if (console.trace) console.trace();
- }
-
- // Build the best logging method possible for this env
- // Wherever possible we want to bind, not wrap, to preserve stack traces
- function realMethod(methodName) {
- if (methodName === 'debug') {
- methodName = 'log';
- }
-
- if (typeof console === undefinedType) {
- return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives
- } else if (methodName === 'trace' && isIE) {
- return traceForIE;
- } else if (console[methodName] !== undefined) {
- return bindMethod(console, methodName);
- } else if (console.log !== undefined) {
- return bindMethod(console, 'log');
- } else {
- return noop;
- }
- }
-
- // These private functions always need `this` to be set properly
-
- function replaceLoggingMethods(level, loggerName) {
- /*jshint validthis:true */
- for (var i = 0; i < logMethods.length; i++) {
- var methodName = logMethods[i];
- this[methodName] = (i < level) ?
- noop :
- this.methodFactory(methodName, level, loggerName);
- }
-
- // Define log.log as an alias for log.debug
- this.log = this.debug;
- }
-
- // In old IE versions, the console isn't present until you first open it.
- // We build realMethod() replacements here that regenerate logging methods
- function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {
- return function () {
- if (typeof console !== undefinedType) {
- replaceLoggingMethods.call(this, level, loggerName);
- this[methodName].apply(this, arguments);
- }
- };
- }
-
- // By default, we use closely bound real methods wherever possible, and
- // otherwise we wait for a console to appear, and then try again.
- function defaultMethodFactory(methodName, level, loggerName) {
- /*jshint validthis:true */
- return realMethod(methodName) ||
- enableLoggingWhenConsoleArrives.apply(this, arguments);
- }
-
- function Logger(name, defaultLevel, factory) {
- var self = this;
- var currentLevel;
- defaultLevel = defaultLevel == null ? "WARN" : defaultLevel;
-
- var storageKey = "loglevel";
- if (typeof name === "string") {
- storageKey += ":" + name;
- } else if (typeof name === "symbol") {
- storageKey = undefined;
- }
-
- function persistLevelIfPossible(levelNum) {
- var levelName = (logMethods[levelNum] || 'silent').toUpperCase();
-
- if (typeof window === undefinedType || !storageKey) return;
-
- // Use localStorage if available
- try {
- window.localStorage[storageKey] = levelName;
- return;
- } catch (ignore) {}
-
- // Use session cookie as fallback
- try {
- window.document.cookie =
- encodeURIComponent(storageKey) + "=" + levelName + ";";
- } catch (ignore) {}
- }
-
- function getPersistedLevel() {
- var storedLevel;
-
- if (typeof window === undefinedType || !storageKey) return;
-
- try {
- storedLevel = window.localStorage[storageKey];
- } catch (ignore) {}
-
- // Fallback to cookies if local storage gives us nothing
- if (typeof storedLevel === undefinedType) {
- try {
- var cookie = window.document.cookie;
- var location = cookie.indexOf(
- encodeURIComponent(storageKey) + "=");
- if (location !== -1) {
- storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];
- }
- } catch (ignore) {}
- }
-
- // If the stored level is not valid, treat it as if nothing was stored.
- if (self.levels[storedLevel] === undefined) {
- storedLevel = undefined;
- }
-
- return storedLevel;
- }
-
- function clearPersistedLevel() {
- if (typeof window === undefinedType || !storageKey) return;
-
- // Use localStorage if available
- try {
- window.localStorage.removeItem(storageKey);
- return;
- } catch (ignore) {}
-
- // Use session cookie as fallback
- try {
- window.document.cookie =
- encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
- } catch (ignore) {}
- }
-
- /*
- *
- * Public logger API - see https://github.com/pimterry/loglevel for details
- *
- */
-
- self.name = name;
-
- self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,
- "ERROR": 4, "SILENT": 5};
-
- self.methodFactory = factory || defaultMethodFactory;
-
- self.getLevel = function () {
- return currentLevel;
- };
-
- self.setLevel = function (level, persist) {
- if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {
- level = self.levels[level.toUpperCase()];
- }
- if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {
- currentLevel = level;
- if (persist !== false) { // defaults to true
- persistLevelIfPossible(level);
- }
- replaceLoggingMethods.call(self, level, name);
- if (typeof console === undefinedType && level < self.levels.SILENT) {
- return "No console available for logging";
- }
- } else {
- throw "log.setLevel() called with invalid level: " + level;
- }
- };
-
- self.setDefaultLevel = function (level) {
- defaultLevel = level;
- if (!getPersistedLevel()) {
- self.setLevel(level, false);
- }
- };
-
- self.resetLevel = function () {
- self.setLevel(defaultLevel, false);
- clearPersistedLevel();
- };
-
- self.enableAll = function(persist) {
- self.setLevel(self.levels.TRACE, persist);
- };
-
- self.disableAll = function(persist) {
- self.setLevel(self.levels.SILENT, persist);
- };
-
- // Initialize with the right level
- var initialLevel = getPersistedLevel();
- if (initialLevel == null) {
- initialLevel = defaultLevel;
- }
- self.setLevel(initialLevel, false);
- }
-
- /*
- *
- * Top-level API
- *
- */
-
- var defaultLogger = new Logger();
-
- var _loggersByName = {};
- defaultLogger.getLogger = function getLogger(name) {
- if ((typeof name !== "symbol" && typeof name !== "string") || name === "") {
- throw new TypeError("You must supply a name when creating a logger.");
- }
-
- var logger = _loggersByName[name];
- if (!logger) {
- logger = _loggersByName[name] = new Logger(
- name, defaultLogger.getLevel(), defaultLogger.methodFactory);
- }
- return logger;
- };
-
- // Grab the current global log variable in case of overwrite
- var _log = (typeof window !== undefinedType) ? window.log : undefined;
- defaultLogger.noConflict = function() {
- if (typeof window !== undefinedType &&
- window.log === defaultLogger) {
- window.log = _log;
- }
-
- return defaultLogger;
- };
-
- defaultLogger.getLoggers = function getLoggers() {
- return _loggersByName;
- };
-
- // ES6 default export, for compatibility
- defaultLogger['default'] = defaultLogger;
-
- return defaultLogger;
-}));
diff --git a/includes/external/matrix/node_modules/loglevel/package.json b/includes/external/matrix/node_modules/loglevel/package.json
deleted file mode 100644
index 1053cd2..0000000
--- a/includes/external/matrix/node_modules/loglevel/package.json
+++ /dev/null
@@ -1,64 +0,0 @@
-{
- "name": "loglevel",
- "description": "Minimal lightweight logging for JavaScript, adding reliable log level methods to any available console.log methods",
- "version": "1.8.1",
- "homepage": "https://github.com/pimterry/loglevel",
- "author": {
- "name": "Tim Perry",
- "email": "pimterry@gmail.com",
- "url": "http://tim-perry.co.uk"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/pimterry/loglevel.git"
- },
- "bugs": {
- "url": "https://github.com/pimterry/loglevel/issues"
- },
- "funding": {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/loglevel"
- },
- "license": "MIT",
- "main": "lib/loglevel.js",
- "types": "./index.d.ts",
- "engines": {
- "node": ">= 0.6.0"
- },
- "scripts": {
- "test": "grunt test && tsc --noEmit ./test/type-test.ts",
- "ci": "grunt ci",
- "dist": "grunt dist",
- "watch": "grunt watch"
- },
- "dependencies": {},
- "devDependencies": {
- "@types/core-js": "2.5.0",
- "@types/node": "^12.0.4",
- "grunt": "~0.4.5",
- "grunt-cli": "~0.1.13",
- "grunt-contrib-clean": "^0.6.0",
- "grunt-contrib-concat": "~0.5.0",
- "grunt-contrib-connect": "~0.8.0",
- "grunt-contrib-jasmine": "~0.5.2",
- "grunt-contrib-jshint": "^1.1.0",
- "grunt-contrib-qunit": "~0.5.2",
- "grunt-contrib-uglify": "~0.5.1",
- "grunt-contrib-watch": "~0.6.1",
- "grunt-coveralls": "^1.0.0",
- "grunt-jasmine-node": "~0.2.1",
- "grunt-open": "~0.2.3",
- "grunt-preprocess": "^4.0.0",
- "grunt-saucelabs": "^8.2.0",
- "grunt-template-jasmine-istanbul": "~0.2.5",
- "grunt-template-jasmine-requirejs": "~0.1.6",
- "qunitjs": "1.14.0",
- "typescript": "^3.5.1"
- },
- "keywords": [
- "log",
- "logger",
- "logging",
- "browser"
- ]
-}
diff --git a/includes/external/matrix/node_modules/loglevel/test/.jshintrc b/includes/external/matrix/node_modules/loglevel/test/.jshintrc
deleted file mode 100644
index cfbbfc7..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/.jshintrc
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "curly": true,
- "globalstrict": true,
- "eqeqeq": true,
- "immed": true,
- "latedef": true,
- "newcap": true,
- "noarg": true,
- "sub": true,
- "undef": true,
- "boss": true,
- "eqnull": true,
- "es3": true,
- "globals": {
- "window": true,
- "console": true,
- "define": false,
- "require": false,
- "exports": false,
- "_": false,
- "afterEach": false,
- "beforeEach": false,
- "confirm": false,
- "context": false,
- "describe": false,
- "xdescribe": false,
- "expect": false,
- "it": false,
- "jasmine": false,
- "waitsFor": false,
- "runs": false,
- "Symbol": false
- }
-}
diff --git a/includes/external/matrix/node_modules/loglevel/test/console-fallback-test.js b/includes/external/matrix/node_modules/loglevel/test/console-fallback-test.js
deleted file mode 100644
index 58fda9d..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/console-fallback-test.js
+++ /dev/null
@@ -1,98 +0,0 @@
-"use strict";
-
-function consoleLogIsCalledBy(log, methodName) {
- it(methodName + " calls console.log", function() {
- log.setLevel(log.levels.TRACE);
- log[methodName]("Log message for call to " + methodName);
- expect(console.log.calls.length).toEqual(1);
- });
-}
-
-function mockConsole() {
- return {"log" : jasmine.createSpy("console.log")};
-}
-
-define(['../lib/loglevel'], function(log) {
- var originalConsole = window.console;
-
- describe("Fallback functionality:", function() {
- describe("with no console present", function() {
- beforeEach(function() {
- window.console = undefined;
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- it("silent method calls are allowed", function() {
- var result = log.setLevel(log.levels.SILENT);
- log.trace("hello");
-
- expect(result).toBeUndefined();
- });
-
- it("setting an active level gently returns an error string", function() {
- var result = log.setLevel(log.levels.TRACE);
- expect(result).toEqual("No console available for logging");
- });
-
- it("active method calls are allowed, once the active setLevel fails", function() {
- log.setLevel(log.levels.TRACE);
- log.trace("hello");
- });
-
- describe("if a console later appears", function () {
- it("logging is re-enabled and works correctly when next used", function () {
- log.setLevel(log.levels.WARN);
-
- window.console = mockConsole();
- log.error("error");
-
- expect(window.console.log).toHaveBeenCalled();
- });
-
- it("logging is re-enabled but does nothing when used at a blocked level", function () {
- log.setLevel(log.levels.WARN);
-
- window.console = mockConsole();
- log.trace("trace");
-
- expect(window.console.log).not.toHaveBeenCalled();
- });
-
- it("changing level works correctly from that point", function () {
- window.console = mockConsole();
- var result = log.setLevel(log.levels.WARN);
-
- expect(result).toBeUndefined();
- });
- });
- });
-
- describe("with a console that only supports console.log", function() {
- beforeEach(function() {
- window.console = mockConsole();
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- it("log can be set to silent", function() {
- log.setLevel(log.levels.SILENT);
- });
-
- it("log can be set to an active level", function() {
- log.setLevel(log.levels.ERROR);
- });
-
- consoleLogIsCalledBy(log, "trace");
- consoleLogIsCalledBy(log, "debug");
- consoleLogIsCalledBy(log, "info");
- consoleLogIsCalledBy(log, "warn");
- consoleLogIsCalledBy(log, "trace");
- });
- });
-});
-
diff --git a/includes/external/matrix/node_modules/loglevel/test/cookie-test.js b/includes/external/matrix/node_modules/loglevel/test/cookie-test.js
deleted file mode 100644
index ebe2f8f..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/cookie-test.js
+++ /dev/null
@@ -1,122 +0,0 @@
-"use strict";
-
-define(['test/test-helpers'], function(testHelpers) {
- var describeIf = testHelpers.describeIf;
- var it = testHelpers.itWithFreshLog;
-
- var originalConsole = window.console;
- var originalDocument = window.document;
-
- describeIf(testHelpers.isCookieStorageAvailable() && !testHelpers.isLocalStorageAvailable(),
- "Cookie-only persistence tests:", function() {
-
- beforeEach(function() {
- window.console = {"log" : jasmine.createSpy("console.log")};
- this.addMatchers({
- "toBeAtLevel" : testHelpers.toBeAtLevel,
- "toBeTheStoredLevel" : testHelpers.toBeTheLevelStoredByCookie
- });
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- describe("If no level is saved", function() {
- beforeEach(function() {
- testHelpers.clearStoredLevels();
- });
-
- it("log level is set to warn by default", function(log) {
- expect(log).toBeAtLevel("warn");
- });
-
- it("warn is persisted as the current level", function(log) {
- expect("warn").toBeTheStoredLevel();
- });
-
- it("log can be set to info level", function(log) {
- log.setLevel("info");
- expect(log).toBeAtLevel("info");
- });
-
- it("log.setLevel() sets a cookie with the given level", function(log) {
- log.setLevel("debug");
- expect("debug").toBeTheStoredLevel();
- });
- });
-
- describe("If info level is saved", function() {
- beforeEach(function() {
- testHelpers.setStoredLevel("info");
- });
-
- it("info is the default log level", function(log) {
- expect(log).toBeAtLevel("info");
- });
-
- it("log can be changed to warn level", function(log) {
- log.setLevel("warn");
- expect(log).toBeAtLevel("warn");
- });
-
- it("log.setLevel() overwrites the saved level", function(log) {
- log.setLevel("error");
-
- expect("error").toBeTheStoredLevel();
- expect("info").not.toBeTheStoredLevel();
- });
- });
-
- describe("If the level is saved with other data", function() {
- beforeEach(function() {
- window.document.cookie = "qwe=asd";
- window.document.cookie = "loglevel=ERROR";
- window.document.cookie = "msg=hello world";
- });
-
- it("error is the default log level", function(log) {
- expect(log).toBeAtLevel("error");
- });
-
- it("log can be changed to silent level", function(log) {
- log.setLevel("silent");
- expect(log).toBeAtLevel("silent");
- });
-
- it("log.setLevel() overrides the saved level only", function(log) {
- log.setLevel("debug");
-
- expect('debug').toBeTheStoredLevel();
- expect(window.document.cookie).toContain("msg=hello world");
- });
- });
-
- describe("If the level cookie is set incorrectly", function() {
- beforeEach(function() {
- testHelpers.setCookieStoredLevel('gibberish');
- });
-
- it("warn is the default log level", function(log) {
- expect(log).toBeAtLevel("warn");
- });
-
- it("warn is persisted as the current level, overriding the invalid cookie", function(log) {
- expect("warn").toBeTheStoredLevel();
- });
-
- it("log can be changed to info level", function(log) {
- log.setLevel("info");
- expect(log).toBeAtLevel("info");
- });
-
- it("log.setLevel() overrides the saved level with the new level", function(log) {
- expect('debug').not.toBeTheStoredLevel();
-
- log.setLevel("debug");
-
- expect('debug').toBeTheStoredLevel();
- });
- });
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/default-level-test.js b/includes/external/matrix/node_modules/loglevel/test/default-level-test.js
deleted file mode 100644
index 329c9dd..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/default-level-test.js
+++ /dev/null
@@ -1,77 +0,0 @@
-"use strict";
-
-define(['test/test-helpers'], function(testHelpers) {
- var describeIf = testHelpers.describeIf;
- var it = testHelpers.itWithFreshLog;
-
- var originalConsole = window.console;
-
- describe("Setting default log level tests:", function() {
-
- beforeEach(function() {
- window.console = {"log" : jasmine.createSpy("console.log")};
- this.addMatchers({
- "toBeAtLevel" : testHelpers.toBeAtLevel,
- "toBeTheStoredLevel" : testHelpers.toBeTheLevelStoredByLocalStorage
- });
-
- testHelpers.clearStoredLevels();
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- describe("If no level is saved", function() {
- it("new level is always set", function(log) {
- log.setDefaultLevel("trace");
- expect(log).toBeAtLevel("trace");
- });
-
- it("level is not persisted", function(log) {
- log.setDefaultLevel("debug");
- expect("debug").not.toBeTheStoredLevel();
- });
- });
-
- describe("If a level is saved", function () {
- beforeEach(function () {
- testHelpers.setStoredLevel("trace");
- });
-
- it("saved level is not modified", function (log) {
- log.setDefaultLevel("debug");
- expect(log).toBeAtLevel("trace");
- });
- });
-
- describe("If the level is stored incorrectly", function() {
- beforeEach(function() {
- testHelpers.setLocalStorageStoredLevel("gibberish");
- });
-
- it("new level is set", function(log) {
- log.setDefaultLevel("debug");
- expect(log).toBeAtLevel("debug");
- expect("debug").not.toBeTheStoredLevel();
- });
- });
-
- describe("log.resetLevel() resets the log", function() {
- it("to warn if no explicit default is set", function(log) {
- log.setLevel("debug");
- log.resetLevel();
-
- expect(log).toBeAtLevel("warn");
- });
-
- it("to info if default is set to info", function(log) {
- log.setDefaultLevel("info");
- log.setLevel("debug");
- log.resetLevel();
-
- expect(log).toBeAtLevel("info");
- });
- });
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/get-current-level-test.js b/includes/external/matrix/node_modules/loglevel/test/get-current-level-test.js
deleted file mode 100644
index 01902ae..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/get-current-level-test.js
+++ /dev/null
@@ -1,48 +0,0 @@
-"use strict";
-
-define(['test/test-helpers'], function(testHelpers) {
- var describeIf = testHelpers.describeIf;
- var it = testHelpers.itWithFreshLog;
-
- var originalConsole = window.console;
-
- describe("Setting default log level tests:", function() {
-
- beforeEach(function() {
- window.console = {"log" : jasmine.createSpy("console.log")};
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- describe("If no level is saved", function() {
- it("current level is the default level", function(log) {
- log.setDefaultLevel("trace");
- expect(log.getLevel()).toBe(log.levels.TRACE);
- });
- });
-
- describe("If a level is saved", function () {
- beforeEach(function () {
- testHelpers.setStoredLevel("trace");
- });
-
- it("current level is the level which has been saved", function (log) {
- log.setDefaultLevel("debug");
- expect(log.getLevel()).toBe(log.levels.TRACE);
- });
- });
-
- describe("If the level is stored incorrectly", function() {
- beforeEach(function() {
- testHelpers.setLocalStorageStoredLevel("gibberish");
- });
-
- it("current level is the default level", function(log) {
- log.setDefaultLevel("debug");
- expect(log.getLevel()).toBe(log.levels.DEBUG);
- });
- });
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/global-integration-with-new-context.js b/includes/external/matrix/node_modules/loglevel/test/global-integration-with-new-context.js
deleted file mode 100644
index b7324e5..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/global-integration-with-new-context.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* global MyCustomLogger, log */
-"use strict";
-
-describe("loglevel from a global <script> tag with a custom context", function () {
- it("is available globally", function () {
- expect(MyCustomLogger).not.toBeUndefined();
- });
-
- it("doesn't have log defined globally", function () {
- expect(window.log).not.toBeDefined();
- });
-
- it("allows setting the logging level", function () {
- MyCustomLogger.setLevel(MyCustomLogger.levels.TRACE);
- MyCustomLogger.setLevel(MyCustomLogger.levels.DEBUG);
- MyCustomLogger.setLevel(MyCustomLogger.levels.INFO);
- MyCustomLogger.setLevel(MyCustomLogger.levels.WARN);
- MyCustomLogger.setLevel(MyCustomLogger.levels.ERROR);
- });
-
- it("successfully logs", function () {
- window.console = { "log": jasmine.createSpy("log") };
-
- MyCustomLogger.setLevel(MyCustomLogger.levels.INFO);
- MyCustomLogger.info("test message");
-
- expect(console.log).toHaveBeenCalledWith("test message");
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/global-integration.js b/includes/external/matrix/node_modules/loglevel/test/global-integration.js
deleted file mode 100644
index 149474c..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/global-integration.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* global log */
-"use strict";
-
-describe("loglevel from a global <script> tag", function () {
- it("is available globally", function () {
- expect(log).not.toBeUndefined();
- });
-
- it("allows setting the logging level", function () {
- log.setLevel(log.levels.TRACE);
- log.setLevel(log.levels.DEBUG);
- log.setLevel(log.levels.INFO);
- log.setLevel(log.levels.WARN);
- log.setLevel(log.levels.ERROR);
- });
-
- it("successfully logs", function () {
- window.console = { "log": jasmine.createSpy("log") };
-
- log.setLevel(log.levels.INFO);
- log.info("test message");
-
- expect(console.log).toHaveBeenCalledWith("test message");
- });
-}); \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/loglevel/test/integration-smoke-test.js b/includes/external/matrix/node_modules/loglevel/test/integration-smoke-test.js
deleted file mode 100644
index 7c7850e..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/integration-smoke-test.js
+++ /dev/null
@@ -1,71 +0,0 @@
-"use strict";
-
-define(['../lib/loglevel', 'test/test-helpers'], function(log, testHelpers) {
- var describeIf = testHelpers.describeIf;
- var itIf = testHelpers.itIf;
-
- describe("Integration smoke tests:", function() {
- describe("log methods", function() {
- it("can all be disabled", function() {
- log.setLevel(log.levels.SILENT);
- log.trace("trace");
- log.debug("debug");
- log.log("log");
- log.info("info");
- log.warn("warn");
- log.error("error");
- });
- });
-
- describeIf(typeof console !== "undefined", "log methods", function() {
- it("can all be called", function() {
- if (typeof console !== "undefined") {
- log.setLevel(log.levels.TRACE);
- }
-
- log.trace("trace");
- log.debug("debug");
- log.log("log");
- log.info("info");
- log.warn("warn");
- log.error("error");
- });
- });
-
- describeIf(typeof console !== "undefined", "log levels", function() {
- beforeEach(function() {
- this.addMatchers({
- "toBeTheStoredLevel" : testHelpers.toBeTheStoredLevel
- });
- });
-
- it("are all settable", function() {
- log.setLevel(log.levels.TRACE);
- log.setLevel(log.levels.DEBUG);
- log.setLevel(log.levels.INFO);
- log.setLevel(log.levels.WARN);
- log.setLevel(log.levels.ERROR);
- });
-
- itIf(testHelpers.isAnyLevelStoragePossible(), "are persisted", function() {
- log.setLevel(log.levels.TRACE);
- expect('trace').toBeTheStoredLevel();
-
- log.setLevel(log.levels.DEBUG);
- expect('debug').toBeTheStoredLevel();
-
- log.setLevel(log.levels.INFO);
- expect('info').toBeTheStoredLevel();
-
- log.setLevel(log.levels.WARN);
- expect('warn').toBeTheStoredLevel();
-
- log.setLevel(log.levels.ERROR);
- expect('error').toBeTheStoredLevel();
-
- log.setLevel(log.levels.SILENT);
- expect('silent').toBeTheStoredLevel();
- });
- });
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/level-setting-test.js b/includes/external/matrix/node_modules/loglevel/test/level-setting-test.js
deleted file mode 100644
index f5d6d13..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/level-setting-test.js
+++ /dev/null
@@ -1,281 +0,0 @@
-"use strict";
-
-var logMethods = [
- "trace",
- "debug",
- "info",
- "warn",
- "error"
-];
-
-function getConsoleMethod(logMethodName) {
- if (logMethodName === 'debug') {
- return console.log;
- } else {
- return console[logMethodName];
- }
-}
-
-define(['../lib/loglevel'], function(log) {
- var originalConsole = window.console;
-
- describe("Basic log levels changing tests:", function() {
- beforeEach(function() {
- window.console = {};
-
- for (var ii = 0; ii < logMethods.length; ii++) {
- window.console[logMethods[ii]] = jasmine.createSpy(logMethods[ii]);
- }
-
- window.console.log = jasmine.createSpy('log');
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- describe("log.enableAll()", function() {
- it("enables all log methods", function() {
- log.enableAll(false);
-
- for (var ii = 0; ii < logMethods.length; ii++) {
- var method = logMethods[ii];
- log[method]("a log message");
-
- expect(getConsoleMethod(method)).toHaveBeenCalled();
- }
- });
- });
-
- describe("log.disableAll()", function() {
- it("disables all log methods", function() {
- log.disableAll(false);
-
- for (var ii = 0; ii < logMethods.length; ii++) {
- var method = logMethods[ii];
- log[method]("a log message");
-
- expect(getConsoleMethod(method)).not.toHaveBeenCalled();
- }
- });
- });
-
- describe("log.setLevel() throws errors if given", function() {
- it("no level argument", function() {
- expect(function() {
- log.setLevel();
- }).toThrow("log.setLevel() called with invalid level: undefined");
- });
-
- it("a null level argument", function() {
- expect(function() {
- log.setLevel(null);
- }).toThrow("log.setLevel() called with invalid level: null");
- });
-
- it("an undefined level argument", function() {
- expect(function() {
- log.setLevel(undefined);
- }).toThrow("log.setLevel() called with invalid level: undefined");
- });
-
- it("an invalid log level index", function() {
- expect(function() {
- log.setLevel(-1);
- }).toThrow("log.setLevel() called with invalid level: -1");
- });
-
- it("an invalid log level name", function() {
- expect(function() {
- log.setLevel("InvalidLevelName");
- }).toThrow("log.setLevel() called with invalid level: InvalidLevelName");
- });
- });
-
- describe("setting log level by name", function() {
- function itCanSetLogLevelTo(level) {
- it("can set log level to " + level, function() {
- log.setLevel(level, false);
-
- log[level]("log message");
- expect(getConsoleMethod(level)).toHaveBeenCalled();
- });
- }
-
- itCanSetLogLevelTo("trace");
- itCanSetLogLevelTo("debug");
- itCanSetLogLevelTo("info");
- itCanSetLogLevelTo("warn");
- itCanSetLogLevelTo("error");
- });
-
- describe("log level settings", function() {
- describe("log.trace", function() {
- it("is enabled at trace level", function() {
- log.setLevel(log.levels.TRACE);
-
- log.trace("a log message");
- expect(console.trace).toHaveBeenCalled();
- });
-
- it("is disabled at debug level", function() {
- log.setLevel(log.levels.DEBUG);
-
- log.trace("a log message");
- expect(console.trace).not.toHaveBeenCalled();
- });
-
- it("is disabled at silent level", function() {
- log.setLevel(log.levels.SILENT);
-
- log.trace("a log message");
- expect(console.trace).not.toHaveBeenCalled();
- });
- });
-
- describe("log.debug", function() {
- it("is enabled at trace level", function() {
- log.setLevel(log.levels.TRACE);
-
- log.debug("a log message");
- expect(console.log).toHaveBeenCalled();
- });
-
- it("is enabled at debug level", function() {
- log.setLevel(log.levels.DEBUG);
-
- log.debug("a log message");
- expect(console.log).toHaveBeenCalled();
- });
-
- it("is disabled at info level", function() {
- log.setLevel(log.levels.INFO);
-
- log.debug("a log message");
- expect(console.log).not.toHaveBeenCalled();
- });
-
- it("is disabled at silent level", function() {
- log.setLevel(log.levels.SILENT);
-
- log.debug("a log message");
- expect(console.log).not.toHaveBeenCalled();
- });
- });
-
- describe("log.log", function() {
- it("is enabled at trace level", function() {
- log.setLevel(log.levels.TRACE);
-
- log.log("a log message");
- expect(console.log).toHaveBeenCalled();
- });
-
- it("is enabled at debug level", function() {
- log.setLevel(log.levels.DEBUG);
-
- log.log("a log message");
- expect(console.log).toHaveBeenCalled();
- });
-
- it("is disabled at info level", function() {
- log.setLevel(log.levels.INFO);
-
- log.log("a log message");
- expect(console.log).not.toHaveBeenCalled();
- });
-
- it("is disabled at silent level", function() {
- log.setLevel(log.levels.SILENT);
-
- log.log("a log message");
- expect(console.log).not.toHaveBeenCalled();
- });
- });
-
- describe("log.info", function() {
- it("is enabled at debug level", function() {
- log.setLevel(log.levels.DEBUG);
-
- log.info("a log message");
- expect(console.info).toHaveBeenCalled();
- });
-
- it("is enabled at info level", function() {
- log.setLevel(log.levels.INFO);
-
- log.info("a log message");
- expect(console.info).toHaveBeenCalled();
- });
-
- it("is disabled at warn level", function() {
- log.setLevel(log.levels.WARN);
-
- log.info("a log message");
- expect(console.info).not.toHaveBeenCalled();
- });
-
- it("is disabled at silent level", function() {
- log.setLevel(log.levels.SILENT);
-
- log.info("a log message");
- expect(console.info).not.toHaveBeenCalled();
- });
- });
-
- describe("log.warn", function() {
- it("is enabled at info level", function() {
- log.setLevel(log.levels.INFO);
-
- log.warn("a log message");
- expect(console.warn).toHaveBeenCalled();
- });
-
- it("is enabled at warn level", function() {
- log.setLevel(log.levels.WARN);
-
- log.warn("a log message");
- expect(console.warn).toHaveBeenCalled();
- });
-
- it("is disabled at error level", function() {
- log.setLevel(log.levels.ERROR);
-
- log.warn("a log message");
- expect(console.warn).not.toHaveBeenCalled();
- });
-
- it("is disabled at silent level", function() {
- log.setLevel(log.levels.SILENT);
-
- log.warn("a log message");
- expect(console.warn).not.toHaveBeenCalled();
- });
- });
-
- describe("log.error", function() {
- it("is enabled at warn level", function() {
- log.setLevel(log.levels.WARN);
-
- log.error("a log message");
- expect(console.error).toHaveBeenCalled();
- });
-
- it("is enabled at error level", function() {
- log.setLevel(log.levels.ERROR);
-
- log.error("a log message");
- expect(console.error).toHaveBeenCalled();
- });
-
- it("is disabled at silent level", function() {
- log.setLevel(log.levels.SILENT);
-
- log.error("a log message");
- expect(console.error).not.toHaveBeenCalled();
- });
- });
- });
- });
-});
-
diff --git a/includes/external/matrix/node_modules/loglevel/test/local-storage-test.js b/includes/external/matrix/node_modules/loglevel/test/local-storage-test.js
deleted file mode 100644
index 7e68dd4..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/local-storage-test.js
+++ /dev/null
@@ -1,208 +0,0 @@
-"use strict";
-
-define(['test/test-helpers'], function(testHelpers) {
- var describeIf = testHelpers.describeIf;
- var it = testHelpers.itWithFreshLog;
-
- var originalConsole = window.console;
-
- describeIf(testHelpers.isLocalStorageAvailable(), "Local storage persistence tests:", function() {
-
- beforeEach(function() {
- window.console = {"log" : jasmine.createSpy("console.log")};
- this.addMatchers({
- "toBeAtLevel" : testHelpers.toBeAtLevel,
- "toBeTheStoredLevel" : testHelpers.toBeTheLevelStoredByLocalStorage,
- "toBeTheLevelStoredByLocalStorage": testHelpers.toBeTheLevelStoredByLocalStorage,
- "toBeTheLevelStoredByCookie": testHelpers.toBeTheLevelStoredByCookie
- });
-
- testHelpers.clearStoredLevels();
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- describe("If no level is saved", function() {
- it("log level is set to warn by default", function(log) {
- expect(log).toBeAtLevel("warn");
- });
-
- it("warn is not persisted as the current level", function(log) {
- expect("warn").not.toBeTheStoredLevel();
- });
-
- it("log can be set to info level", function(log) {
- log.setLevel("info");
- expect(log).toBeAtLevel("info");
- });
-
- it("log.setLevel() sets a cookie with the given level", function(log) {
- log.setLevel("debug");
- expect("debug").toBeTheStoredLevel();
- });
-
- it("log.setLevel() does not set a cookie if `persist` argument is false", function(log) {
- log.setLevel("debug", false);
- expect("debug").not.toBeTheStoredLevel();
- });
- });
-
- describe("If trace level is saved", function () {
- beforeEach(function () {
- testHelpers.setStoredLevel("trace");
- });
-
- it("trace is the default log level", function (log) {
- expect(log).toBeAtLevel("trace");
- });
- });
-
- describe("If debug level is saved", function () {
- beforeEach(function () {
- testHelpers.setStoredLevel("debug");
- });
-
- it("debug is the default log level", function (log) {
- expect(log).toBeAtLevel("debug");
- });
- });
-
- describe("If info level is saved", function() {
- beforeEach(function() {
- testHelpers.setStoredLevel("info");
- });
-
- it("info is the default log level", function(log) {
- expect(log).toBeAtLevel("info");
- });
-
- it("log can be changed to warn level", function(log) {
- log.setLevel("warn");
- expect(log).toBeAtLevel("warn");
- });
-
- it("log.setLevel() overwrites the saved level", function(log) {
- log.setLevel("error");
-
- expect("error").toBeTheStoredLevel();
- expect("info").not.toBeTheStoredLevel();
- });
-
- it("log.setLevel() does not overwrite the saved level if `persist` argument is false", function(log) {
- log.setLevel("error", false);
-
- expect("info").toBeTheStoredLevel();
- expect("error").not.toBeTheStoredLevel();
- });
-
- it("log.resetLevel() clears the saved level", function(log) {
- log.resetLevel();
-
- expect(undefined).toBeTheStoredLevel();
- expect("info").not.toBeTheStoredLevel();
- });
- });
-
- describe("If warn level is saved", function () {
- beforeEach(function () {
- testHelpers.setStoredLevel("warn");
- });
-
- it("warn is the default log level", function (log) {
- expect(log).toBeAtLevel("warn");
- });
- });
-
- describe("If error level is saved", function () {
- beforeEach(function () {
- testHelpers.setStoredLevel("error");
- });
-
- it("error is the default log level", function (log) {
- expect(log).toBeAtLevel("error");
- });
- });
-
-
- describe("If the level is saved with other data", function() {
- beforeEach(function() {
- window.localStorage['qwe'] = "asd";
- window.localStorage['loglevel'] = "ERROR";
- window.localStorage['msg'] = "hello world";
- });
-
- it("error is the default log level", function(log) {
- expect(log).toBeAtLevel("error");
- });
-
- it("log can be changed to silent level", function(log) {
- log.setLevel("silent");
- expect(log).toBeAtLevel("silent");
- });
-
- it("log.setLevel() overrides the saved level only", function(log) {
- log.setLevel("debug");
-
- expect('debug').toBeTheStoredLevel();
- expect(window.localStorage['msg']).toBe("hello world");
- });
- });
-
- describe("If the level is stored incorrectly", function() {
- beforeEach(function() {
- testHelpers.setLocalStorageStoredLevel('gibberish');
- });
-
- it("warn is the default log level", function(log) {
- expect(log).toBeAtLevel("warn");
- });
-
- it("warn is not persisted as the current level", function(log) {
- expect("warn").not.toBeTheStoredLevel();
- });
-
- it("log can be changed to info level", function(log) {
- log.setLevel("info");
- expect(log).toBeAtLevel("info");
- });
-
- it("log.setLevel() overrides the saved level with the new level", function(log) {
- expect('debug').not.toBeTheStoredLevel();
-
- log.setLevel("debug");
-
- expect('debug').toBeTheStoredLevel();
- });
- });
-
- describeIf(testHelpers.isCookieStorageAvailable() && testHelpers.isLocalStorageAvailable(),
- "if localStorage and cookies are both available", function () {
-
- it("the level stored in cookies is ignored if a local storage level is set", function () {
- testHelpers.setCookieStoredLevel("info");
- testHelpers.setLocalStorageStoredLevel("debug");
-
- testHelpers.withFreshLog(function (log) {
- expect(log).toBeAtLevel("debug");
- });
- });
-
- it("the level stored in cookies is used if no local storage level is set", function () {
- testHelpers.setCookieStoredLevel("info");
- window.localStorage.clear();
-
- testHelpers.withFreshLog(function (log) {
- expect(log).toBeAtLevel("info");
- });
- });
-
- it("the local storage level is set and the cookie level is not", function (log) {
- log.setLevel("error");
- expect("error").toBeTheLevelStoredByLocalStorage();
- expect("error").not.toBeTheLevelStoredByCookie();
- });
- });
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/manual-test.html b/includes/external/matrix/node_modules/loglevel/test/manual-test.html
deleted file mode 100644
index 9b24a65..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/manual-test.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
- <title>Standalone manual test bed for loglevel</title>
-</head>
-<body>
-<script src="../lib/loglevel.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/includes/external/matrix/node_modules/loglevel/test/method-factory-test.js b/includes/external/matrix/node_modules/loglevel/test/method-factory-test.js
deleted file mode 100644
index aa80fc6..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/method-factory-test.js
+++ /dev/null
@@ -1,42 +0,0 @@
-"use strict";
-
-define(['test/test-helpers'], function(testHelpers) {
- var it = testHelpers.itWithFreshLog;
-
- describe("Setting the methodFactory tests:", function() {
-
- it("methodFactory should be called once for each loggable level", function(log) {
- log.methodFactory = jasmine.createSpy("methodFactory");
-
- log.setLevel("trace");
- expect(log.methodFactory.calls.length).toEqual(5);
- expect(log.methodFactory.argsForCall[0]).toEqual(["trace", 0, undefined]);
- expect(log.methodFactory.argsForCall[1]).toEqual(["debug", 0, undefined]);
- expect(log.methodFactory.argsForCall[2]).toEqual(["info", 0, undefined]);
- expect(log.methodFactory.argsForCall[3]).toEqual(["warn", 0, undefined]);
- expect(log.methodFactory.argsForCall[4]).toEqual(["error", 0, undefined]);
-
- log.setLevel("error");
- expect(log.methodFactory.calls.length).toEqual(6);
- expect(log.methodFactory.argsForCall[5]).toEqual(["error", 4, undefined]);
- });
-
- it("functions returned by methodFactory should be used as logging functions", function(log) {
- var logFunction = function() {};
- log.methodFactory = function() { return logFunction; };
- log.setLevel("error");
-
- expect(log.warn).not.toEqual(logFunction);
- expect(log.error).toEqual(logFunction);
- });
-
- it("the third argument should be logger's name", function(log) {
- var logger = log.getLogger("newLogger");
- logger.methodFactory = jasmine.createSpy("methodFactory");
-
- logger.setLevel("error");
- expect(logger.methodFactory.argsForCall[0]).toEqual(["error", 4, "newLogger"]);
- });
-
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/multiple-logger-test.js b/includes/external/matrix/node_modules/loglevel/test/multiple-logger-test.js
deleted file mode 100644
index ba132e6..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/multiple-logger-test.js
+++ /dev/null
@@ -1,139 +0,0 @@
-"use strict";
-
-define(['test/test-helpers'], function(testHelpers) {
- var describeIf = testHelpers.describeIf;
- var it = testHelpers.itWithFreshLog;
-
- var originalConsole = window.console;
-
- describe("Multiple logger instances tests:", function() {
-
- describe("log.getLogger()", function() {
- it("returns a new logger that is not the default one", function(log) {
- var newLogger = log.getLogger("newLogger");
- expect(newLogger).not.toEqual(log);
- expect(newLogger.trace).toBeDefined();
- expect(newLogger.debug).toBeDefined();
- expect(newLogger.info).toBeDefined();
- expect(newLogger.warn).toBeDefined();
- expect(newLogger.error).toBeDefined();
- expect(newLogger.setLevel).toBeDefined();
- expect(newLogger.setDefaultLevel).toBeDefined();
- expect(newLogger.enableAll).toBeDefined();
- expect(newLogger.disableAll).toBeDefined();
- expect(newLogger.methodFactory).toBeDefined();
- });
-
- it("returns loggers without `getLogger()` and `noConflict()`", function(log) {
- var newLogger = log.getLogger("newLogger");
- expect(newLogger.getLogger).toBeUndefined();
- expect(newLogger.noConflict).toBeUndefined();
- });
-
- it("returns the same instance when called repeatedly with the same name", function(log) {
- var logger1 = log.getLogger("newLogger");
- var logger2 = log.getLogger("newLogger");
-
- expect(logger1).toEqual(logger2);
- });
-
- it("should throw if called with no name", function(log) {
- expect(function() {
- log.getLogger();
- }).toThrow();
- });
-
- it("should throw if called with empty string for name", function(log) {
- expect(function() {
- log.getLogger("");
- }).toThrow();
- });
-
- it("should throw if called with a non-string name", function(log) {
- expect(function() { log.getLogger(true); }).toThrow();
- expect(function() { log.getLogger({}); }).toThrow();
- expect(function() { log.getLogger([]); }).toThrow();
- expect(function() { log.getLogger(10); }).toThrow();
- expect(function() { log.getLogger(function(){}); }).toThrow();
- expect(function() { log.getLogger(null); }).toThrow();
- expect(function() { log.getLogger(undefined); }).toThrow();
- if (window.Symbol) {
- expect(function() { log.getLogger(Symbol()); }).toThrow();
- }
- });
- });
-
- describe("inheritance", function() {
- beforeEach(function() {
- window.console = {"log" : jasmine.createSpy("console.log")};
- this.addMatchers({
- "toBeAtLevel" : testHelpers.toBeAtLevel
- });
- testHelpers.clearStoredLevels();
- });
-
- afterEach(function() {
- window.console = originalConsole;
- });
-
- it("loggers are created with the same level as the default logger", function(log) {
- log.setLevel("ERROR");
- var newLogger = log.getLogger("newLogger");
- expect(newLogger).toBeAtLevel("error");
- });
-
- it("if a logger's level is persisted, it uses that level rather than the default logger's level", function(log) {
- testHelpers.setStoredLevel("error", "newLogger");
- log.setLevel("TRACE");
- var newLogger = log.getLogger("newLogger");
- expect(newLogger).toBeAtLevel("error");
- });
-
- it("other loggers do not change when the default logger's level is changed", function(log) {
- log.setLevel("TRACE");
- var newLogger = log.getLogger("newLogger");
- log.setLevel("ERROR");
- expect(newLogger).toBeAtLevel("TRACE");
- expect(log.getLogger("newLogger")).toBeAtLevel("TRACE");
- });
-
- it("loggers are created with the same methodFactory as the default logger", function(log) {
- log.methodFactory = function(methodName, level) {
- return function() {};
- };
-
- var newLogger = log.getLogger("newLogger");
- expect(newLogger.methodFactory).toEqual(log.methodFactory);
- });
-
- it("loggers have independent method factories", function(log) {
- var log1 = log.getLogger('logger1');
- var log2 = log.getLogger('logger2');
-
- var log1Spy = jasmine.createSpy('log1spy');
- log1.methodFactory = function(methodName, level) {
- return log1Spy;
- };
- log1.setLevel(log1.getLevel());
-
- var log2Spy = jasmine.createSpy('log2spy');
- log2.methodFactory = function(methodName, level) {
- return log2Spy;
- };
- log2.setLevel(log2.getLevel());
-
- log1.error('test1');
- log2.error('test2');
-
- expect(log1Spy).toHaveBeenCalledWith("test1");
- expect(log2Spy).toHaveBeenCalledWith("test2");
- });
-
- it("new loggers correctly inherit a logging level of `0`", function(log) {
- log.setLevel(0);
- var newLogger = log.getLogger("newLogger");
- expect(newLogger).toBeAtLevel("trace");
- });
- });
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/node-integration.js b/includes/external/matrix/node_modules/loglevel/test/node-integration.js
deleted file mode 100644
index e38fa5c..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/node-integration.js
+++ /dev/null
@@ -1,44 +0,0 @@
-"use strict";
-
-describe("loglevel included via node", function () {
- it("is included successfully", function () {
- expect(require('../lib/loglevel')).not.toBeUndefined();
- });
-
- it("allows setting the logging level", function () {
- var log = require('../lib/loglevel');
-
- log.setLevel(log.levels.TRACE);
- log.setLevel(log.levels.DEBUG);
- log.setLevel(log.levels.INFO);
- log.setLevel(log.levels.WARN);
- log.setLevel(log.levels.ERROR);
- });
-
- it("successfully logs", function () {
- var log = require('../lib/loglevel');
- console.info = jasmine.createSpy("info");
-
- log.setLevel(log.levels.INFO);
- log.info("test message");
-
- expect(console.info).toHaveBeenCalledWith("test message");
- });
-
- it("supports using symbols as names", function() {
- var log = require('../lib/loglevel');
-
- var s1 = Symbol("a-symbol");
- var s2 = Symbol("a-symbol");
-
- var logger1 = log.getLogger(s1);
- var defaultLevel = logger1.getLevel();
- logger1.setLevel(log.levels.TRACE);
-
- var logger2 = log.getLogger(s2);
-
- // Should be unequal: same name, but different symbol instances
- expect(logger1).not.toEqual(logger2);
- expect(logger2.getLevel()).toEqual(defaultLevel);
- });
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/test-context-using-apply.js b/includes/external/matrix/node_modules/loglevel/test/test-context-using-apply.js
deleted file mode 100644
index 4e57669..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/test-context-using-apply.js
+++ /dev/null
@@ -1,6 +0,0 @@
-"use strict";
-/* jshint node:true */
-var MyCustomLogger = (function() {
- // @include ../lib/loglevel.js
- return this.log;
-}).apply({});
diff --git a/includes/external/matrix/node_modules/loglevel/test/test-helpers.js b/includes/external/matrix/node_modules/loglevel/test/test-helpers.js
deleted file mode 100644
index feb74e4..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/test-helpers.js
+++ /dev/null
@@ -1,170 +0,0 @@
-"use strict";
-
-if (typeof window === "undefined") {
- window = {};
-}
-
-var logMethods = [
- "trace",
- "debug",
- "info",
- "warn",
- "error"
-];
-
-define(function () {
- function getStorageKey(loggerName) {
- var key = "loglevel";
- if (loggerName) {
- key += ":" + loggerName;
- }
- return key;
- }
-
- var self = {};
-
- // Jasmine matcher to check the log level of a log object
- self.toBeAtLevel = function toBeAtLevel(level) {
- var log = this.actual;
- var expectedWorkingCalls = log.levels.SILENT - log.levels[level.toUpperCase()];
- var realLogMethod = window.console.log;
- var priorCalls = realLogMethod.calls.length;
-
- for (var ii = 0; ii < logMethods.length; ii++) {
- var methodName = logMethods[ii];
- log[methodName](methodName);
- }
-
- expect(realLogMethod.calls.length - priorCalls).toEqual(expectedWorkingCalls);
- return true;
- };
-
- self.isCookieStorageAvailable = function isCookieStorageAvailable() {
- if (window && window.document && window.document.cookie) {
- // We need to check not just that the cookie objects are available, but that they work, because
- // if we run from file:// URLs they appear present but are non-functional
- window.document.cookie = "test=hi;";
-
- var result = window.document.cookie.indexOf('test=hi') !== -1;
- window.document.cookie = "test=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";
-
- return result;
- } else {
- return false;
- }
- };
-
- self.isLocalStorageAvailable = function isLocalStorageAvailable() {
- try {
- return !!window.localStorage;
- } catch (e){
- return false;
- }
- };
-
- self.isAnyLevelStoragePossible = function isAnyLevelStoragePossible() {
- return self.isCookieStorageAvailable() || self.isLocalStorageAvailable();
- };
-
- self.toBeTheLevelStoredByCookie = function toBeTheLevelStoredByCookie(name) {
- var level = this.actual === undefined ? undefined : this.actual.toUpperCase();
- var storageKey = encodeURIComponent(getStorageKey(name));
-
- if(level === undefined) {
- return window.document.cookie.indexOf(storageKey + "=") === -1;
- } else if (window.document.cookie.indexOf(storageKey + "=" + level) !== -1) {
- return true;
- } else {
- return false;
- }
- };
-
- self.toBeTheLevelStoredByLocalStorage = function toBeTheLevelStoredByLocalStorage(name) {
- var level = this.actual === undefined ? undefined : this.actual.toUpperCase();
-
- if (window.localStorage[getStorageKey(name)] === level) {
- return true;
- }
-
- return false;
- };
-
- // Jasmine matcher to check whether a given string was saved by loglevel
- self.toBeTheStoredLevel = function toBeTheStoredLevel(name) {
- return self.toBeTheLevelStoredByLocalStorage.call(this, name) ||
- self.toBeTheLevelStoredByCookie.call(this, name);
- };
-
- self.setCookieStoredLevel = function setCookieStoredLevel(level, name) {
- window.document.cookie =
- encodeURIComponent(getStorageKey(name)) + "=" +
- level.toUpperCase() + ";";
- };
-
- self.setLocalStorageStoredLevel = function setLocalStorageStoredLevel(level, name) {
- window.localStorage[getStorageKey(name)] = level.toUpperCase();
- };
-
- self.setStoredLevel = function setStoredLevel(level, name) {
- if (self.isCookieStorageAvailable()) {
- self.setCookieStoredLevel(level, name);
- }
- if (self.isLocalStorageAvailable()) {
- self.setLocalStorageStoredLevel(level, name);
- }
- };
-
- self.clearStoredLevels = function clearStoredLevels() {
- if (self.isLocalStorageAvailable()) {
- window.localStorage.clear();
- }
- if (self.isCookieStorageAvailable()) {
- var storedKeys = window.document.cookie.match(/(?:^|;\s)(loglevel(\:\w+)?)(?=\=)/g);
- if (storedKeys) {
- for (var i = 0; i < storedKeys.length; i++) {
- window.document.cookie = storedKeys[i] + "=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";
- }
- }
- }
- };
-
- self.describeIf = function describeIf(condition, name, test) {
- if (condition) {
- jasmine.getEnv().describe(name, test);
- }
- };
-
- self.itIf = function itIf(condition, name, test) {
- if (condition) {
- jasmine.getEnv().it(name, test);
- }
- };
-
- // Forcibly reloads loglevel, and asynchronously hands the resulting log back to the given callback
- // via Jasmine async magic
- self.withFreshLog = function withFreshLog(toRun) {
- require.undef("lib/loglevel");
-
- var freshLog;
-
- waitsFor(function() {
- require(['lib/loglevel'], function(log) {
- freshLog = log;
- });
- return typeof freshLog !== "undefined";
- });
-
- runs(function() {
- toRun(freshLog);
- });
- };
-
- // Wraps Jasmine's it(name, test) call to reload the loglevel dependency for the given test
- self.itWithFreshLog = function itWithFreshLog(name, test) {
- jasmine.getEnv().it(name, function() {
- self.withFreshLog(test);
- });
- };
-
- return self;
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/test-qunit.html b/includes/external/matrix/node_modules/loglevel/test/test-qunit.html
deleted file mode 100644
index d2b8c5d..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/test-qunit.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>QUnit Integration Test</title>
- <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
-</head>
-<body>
- <script src="../lib/loglevel.js" loglevel-name="logging"></script>
- <script>
- var logging = log.noConflict();
- </script>
- <!-- Pretend the users code is included here -->
- <div id="qunit"></div>
- <div id="qunit-fixture"></div>
- <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
- <script src="test-qunit.js"></script>
-</body>
-</html>
diff --git a/includes/external/matrix/node_modules/loglevel/test/test-qunit.js b/includes/external/matrix/node_modules/loglevel/test/test-qunit.js
deleted file mode 100644
index e0ca664..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/test-qunit.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-
-/*global document*/
-var fixture = document.getElementById("qunit-fixture");
-
-/*global QUnit*/
-QUnit.module('loglevel', {
- setup: function() {
- },
- teardown: function() {
- }
-});
-
-/*global test*/
-test('basic test', function() {
- /*global ok*/
- /*global logging*/
- /*global log*/
-
- // Check that noConflict restored the original log
- ok(typeof log === "function", "log is a function");
- ok(log === QUnit.log, "log is Qunit.log");
-
- // Check that noConflict setup logging
- ok(typeof logging !== "undefined", "logging is defined");
- ok(typeof logging === "object", "logging is an object");
- ok(typeof logging.trace === "function", "trace is a function");
- ok(typeof logging.debug === "function", "debug is a function");
- ok(typeof logging.info === "function", "info is a function");
- ok(typeof logging.warn === "function", "warn is a function");
- ok(typeof logging.error === "function", "error is a function");
- ok(typeof logging.setLevel === "function", "setLevel is a function");
- ok(typeof logging.setDefaultLevel === "function", "setDefaultLevel is a function");
- ok(typeof logging.enableAll === "function", "enableAll is a function");
- ok(typeof logging.disableAll === "function", "disableAll is a function");
- ok(typeof logging.getLogger === "function", "getLogger is a function");
-
- // Use the API to make sure it doesn't blatantly fail with exceptions
- logging.trace("a trace message");
- logging.debug("a debug message");
- logging.info("an info message");
- logging.warn("a warn message");
- logging.error("an error message");
-
- var newLogger = logging.getLogger("newLogger");
- newLogger.trace("a trace message");
- newLogger.debug("a debug message");
- newLogger.info("an info message");
- newLogger.warn("a warn message");
- newLogger.error("an error message");
-});
diff --git a/includes/external/matrix/node_modules/loglevel/test/type-test.ts b/includes/external/matrix/node_modules/loglevel/test/type-test.ts
deleted file mode 100644
index c8b1991..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/type-test.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import * as log from '..';
-
-log.setLevel('warn');
-log.warn('Test warning');
-
-// CoreJS defines a global `log` variable. We need to make sure that
-// that doesn't conflict with the loglevel typings:
-import * as _coreJS from 'core-js';
diff --git a/includes/external/matrix/node_modules/loglevel/test/vendor/json2.js b/includes/external/matrix/node_modules/loglevel/test/vendor/json2.js
deleted file mode 100644
index f7eb646..0000000
--- a/includes/external/matrix/node_modules/loglevel/test/vendor/json2.js
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- json2.js
- 2012-10-08
-
- Public Domain.
-
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
- See http://www.JSON.org/js.html
-
-
- This code should be minified before deployment.
- See http://javascript.crockford.com/jsmin.html
-
- USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
- NOT CONTROL.
-
-
- This file creates a global JSON object containing two methods: stringify
- and parse.
-
- JSON.stringify(value, replacer, space)
- value any JavaScript value, usually an object or array.
-
- replacer an optional parameter that determines how object
- values are stringified for objects. It can be a
- function or an array of strings.
-
- space an optional parameter that specifies the indentation
- of nested structures. If it is omitted, the text will
- be packed without extra whitespace. If it is a number,
- it will specify the number of spaces to indent at each
- level. If it is a string (such as '\t' or '&nbsp;'),
- it contains the characters used to indent at each level.
-
- This method produces a JSON text from a JavaScript value.
-
- When an object value is found, if the object contains a toJSON
- method, its toJSON method will be called and the result will be
- stringified. A toJSON method does not serialize: it returns the
- value represented by the name/value pair that should be serialized,
- or undefined if nothing should be serialized. The toJSON method
- will be passed the key associated with the value, and this will be
- bound to the value
-
- For example, this would serialize Dates as ISO strings.
-
- Date.prototype.toJSON = function (key) {
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
-
- You can provide an optional replacer method. It will be passed the
- key and value of each member, with this bound to the containing
- object. The value that is returned from your method will be
- serialized. If your method returns undefined, then the member will
- be excluded from the serialization.
-
- If the replacer parameter is an array of strings, then it will be
- used to select the members to be serialized. It filters the results
- such that only members with keys listed in the replacer array are
- stringified.
-
- Values that do not have JSON representations, such as undefined or
- functions, will not be serialized. Such values in objects will be
- dropped; in arrays they will be replaced with null. You can use
- a replacer function to replace those with JSON values.
- JSON.stringify(undefined) returns undefined.
-
- The optional space parameter produces a stringification of the
- value that is filled with line breaks and indentation to make it
- easier to read.
-
- If the space parameter is a non-empty string, then that string will
- be used for indentation. If the space parameter is a number, then
- the indentation will be that many spaces.
-
- Example:
-
- text = JSON.stringify(['e', {pluribus: 'unum'}]);
- // text is '["e",{"pluribus":"unum"}]'
-
-
- text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
- // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
- text = JSON.stringify([new Date()], function (key, value) {
- return this[key] instanceof Date ?
- 'Date(' + this[key] + ')' : value;
- });
- // text is '["Date(---current time---)"]'
-
-
- JSON.parse(text, reviver)
- This method parses a JSON text to produce an object or array.
- It can throw a SyntaxError exception.
-
- The optional reviver parameter is a function that can filter and
- transform the results. It receives each of the keys and values,
- and its return value is used instead of the original value.
- If it returns what it received, then the structure is not modified.
- If it returns undefined then the member is deleted.
-
- Example:
-
- // Parse the text. Values that look like ISO date strings will
- // be converted to Date objects.
-
- myData = JSON.parse(text, function (key, value) {
- var a;
- if (typeof value === 'string') {
- a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
- return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
- +a[5], +a[6]));
- }
- }
- return value;
- });
-
- myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
- var d;
- if (typeof value === 'string' &&
- value.slice(0, 5) === 'Date(' &&
- value.slice(-1) === ')') {
- d = new Date(value.slice(5, -1));
- if (d) {
- return d;
- }
- }
- return value;
- });
-
-
- This is a reference implementation. You are free to copy, modify, or
- redistribute.
-*/
-
-/*jslint evil: true, regexp: true */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
- call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
- getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
- lastIndex, length, parse, prototype, push, replace, slice, stringify,
- test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (typeof JSON !== 'object') {
- JSON = {};
-}
-
-(function () {
- 'use strict';
-
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- if (typeof Date.prototype.toJSON !== 'function') {
-
- Date.prototype.toJSON = function (key) {
-
- return isFinite(this.valueOf())
- ? this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z'
- : null;
- };
-
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
-
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
-
-
- function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
- escapable.lastIndex = 0;
- return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string'
- ? c
- : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' : '"' + string + '"';
- }
-
-
- function str(key, holder) {
-
-// Produce a string from holder[key].
-
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
-
-// What happens next depends on the value's type.
-
- switch (typeof value) {
- case 'string':
- return quote(value);
-
- case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
- return isFinite(value) ? String(value) : 'null';
-
- case 'boolean':
- case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
- return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
- case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
- if (!value) {
- return 'null';
- }
-
-// Make an array to hold the partial results of stringifying this object value.
-
- gap += indent;
- partial = [];
-
-// Is the value an array?
-
- if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
- v = partial.length === 0
- ? '[]'
- : gap
- ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
- : '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- if (typeof rep[i] === 'string') {
- k = rep[i];
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
- v = partial.length === 0
- ? '{}'
- : gap
- ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
- : '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
- var i;
- gap = '';
- indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
-
-// If the space parameter is a string, it will be used as the indent string.
-
- } else if (typeof space === 'string') {
- indent = space;
- }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
- return str('', {'': value});
- };
- }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
- var j;
-
- function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.prototype.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
- if (/^[\],:{}\s]*$/
- .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
- .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
- .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
- j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
- return typeof reviver === 'function'
- ? walk({'': j}, '')
- : j;
- }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
- throw new SyntaxError('JSON.parse');
- };
- }
-}());