+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/node_modules/karma-sourcemap-loader/.npmignore b/node_modules/karma-sourcemap-loader/.npmignore
new file mode 100644
index 0000000000..a72b52ebe8
--- /dev/null
+++ b/node_modules/karma-sourcemap-loader/.npmignore
@@ -0,0 +1,15 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+node_modules
diff --git a/node_modules/karma-sourcemap-loader/LICENSE b/node_modules/karma-sourcemap-loader/LICENSE
new file mode 100644
index 0000000000..5354797ccd
--- /dev/null
+++ b/node_modules/karma-sourcemap-loader/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Sergey Todyshev
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/karma-sourcemap-loader/README.md b/node_modules/karma-sourcemap-loader/README.md
new file mode 100644
index 0000000000..5449d88e1c
--- /dev/null
+++ b/node_modules/karma-sourcemap-loader/README.md
@@ -0,0 +1,55 @@
+# karma-sourcemap-loader
+
+> Preprocessor that locates and loads existing source maps.
+
+## Why
+
+When you use karma not in isolation but as part of a build process (e.g. using grunt
+or gulp) it is often the case that the compilation/transpilation is done on a previous
+step of the process and not handled by karma preprocessors. In these cases source maps
+don't get loaded by karma and you lose the advantages of having them.
+
+## How it works
+
+This plug-in supports both inline and external source maps.
+
+Inline source maps are located by searching "sourceMappingURL=" inside the javascript
+file, both plain text and base64-encoded maps are supported.
+
+External source maps are located by appending ".map" to the javascript file name.
+So if for example you have Hello.js, the preprocessor will try to load source map from
+Hello.js.map.
+
+## Installation
+
+Just write `karma-sourcemap-loader` as a devDependency in your `package.json`.
+```json
+{
+ "devDependencies": {
+ "karma-sourcemap-loader": "~0.2"
+ }
+}
+```
+
+Or just issue the following command:
+```bash
+npm install karma-sourcemap-loader --save-dev
+```
+
+## Configuration
+
+The code below shows a sample configuration of the preprocessor.
+```js
+// karma.conf.js
+module.exports = function(config) {
+ config.set({
+ preprocessors: {
+ '**/*.js': ['sourcemap']
+ }
+ });
+};
+```
+
+## Credits
+
+Thanks to @goldibex for adding inline source maps support.
diff --git a/node_modules/karma-sourcemap-loader/index.js b/node_modules/karma-sourcemap-loader/index.js
new file mode 100644
index 0000000000..62e92ec7e7
--- /dev/null
+++ b/node_modules/karma-sourcemap-loader/index.js
@@ -0,0 +1,68 @@
+var fs = require('fs');
+var path = require('path');
+
+var createSourceMapLocatorPreprocessor = function(args, logger, helper) {
+ var log = logger.create('preprocessor.sourcemap');
+
+ log.debug('loaded');
+
+ return function(content, file, done) {
+ function sourceMapData(data){
+ file.sourceMap = JSON.parse(data);
+ done(content);
+ }
+
+ function inlineMap(inlineData){
+ var data;
+ var b64Match = inlineData.match(/^data:.+\/(.+);base64,(.*)$/);
+ if (b64Match !== null && b64Match.length == 3) {
+ // base64-encoded JSON string
+ log.debug('base64-encoded source map for', file.originalPath);
+ var buffer = new Buffer(b64Match[2], 'base64');
+ sourceMapData(buffer.toString());
+ } else {
+ // straight-up URL-encoded JSON string
+ log.debug('raw inline source map for', file.originalPath);
+ sourceMapData(decodeURIComponent(inlineData.slice('data:application/json'.length)));
+ }
+ }
+
+ function fileMap(mapPath){
+ fs.exists(mapPath, function(exists) {
+ if (!exists) {
+ log.debug('sourcemap file does not exist');
+ done(content);
+ return;
+ }
+ log.debug('test');
+ fs.readFile(mapPath, function(err, data) {
+ if (err){ throw err; }
+
+ log.debug('external source map exists for', file.originalPath);
+ sourceMapData(data);
+ });
+ });
+ }
+
+ var match = content.match(/#\s*sourceMappingURL=(.+)$/m);
+ log.debug(match);
+ if (match !== null && match.length == 2) {
+ var mapUrl = match[1];
+ if( /^data:application\/json/.test(mapUrl) ){
+ inlineMap(mapUrl);
+ } else {
+ fileMap(path.resolve(path.dirname(file.path), mapUrl));
+ }
+
+ } else {
+ fileMap(file.path + ".map");
+ }
+ };
+};
+
+createSourceMapLocatorPreprocessor.$inject = ['args', 'logger', 'helper'];
+
+// PUBLISH DI MODULE
+module.exports = {
+ 'preprocessor:sourcemap': ['factory', createSourceMapLocatorPreprocessor]
+};
diff --git a/node_modules/karma-sourcemap-loader/package.json b/node_modules/karma-sourcemap-loader/package.json
new file mode 100644
index 0000000000..3f5312e060
--- /dev/null
+++ b/node_modules/karma-sourcemap-loader/package.json
@@ -0,0 +1,21 @@
+{
+ "author": {
+ "email": "gabriele.genta@gmail.com",
+ "name": "Gabriele Genta"
+ },
+ "description": "Karma plugin that locates and loads existing javascript source map files.",
+ "keywords": [
+ "karma-plugin",
+ "karma-preprocessor",
+ "source-maps",
+ "javascript"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "karma-sourcemap-loader",
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:demerzel3/karma-sourcemap-loader.git"
+ },
+ "version": "0.3.0"
+}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index b8258c7b50..171d9ec93b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2954,6 +2954,12 @@
}
}
},
+ "karma-sourcemap-loader": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.0.tgz",
+ "integrity": "sha1-oS27WIfZDeeg0ezB2yEKvcsrVnQ=",
+ "dev": true
+ },
"karma-typescript": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/karma-typescript/-/karma-typescript-4.1.1.tgz",
diff --git a/scripts/deps/manage_node_deps.py b/scripts/deps/manage_node_deps.py
index 7fd1d495de..77d510e58f 100644
--- a/scripts/deps/manage_node_deps.py
+++ b/scripts/deps/manage_node_deps.py
@@ -49,6 +49,7 @@ DEPS = {
"karma-coverage-istanbul-instrumenter": "1.0.1",
"karma-coverage-istanbul-reporter": "2.1.0",
"karma-mocha": "1.3.0",
+ "karma-sourcemap-loader": "0.3.0",
"karma-typescript": "4.1.1",
"license-checker": "25.0.1",
"mocha": "6.2.0",