From 70bc4f5e5753b7077dd6c6b882996f7f84f7afaf Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Thu, 10 May 2018 19:03:10 +0200 Subject: [PATCH 01/16] Update dependencies and add package-lock.json --- package-lock.json | 491 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 18 +- x-package.json5 | 20 +- 3 files changed, 509 insertions(+), 20 deletions(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..978f30e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,491 @@ +{ + "name": "source-map-resolve", + "version": "0.5.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "Base64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/Base64/-/Base64-1.0.1.tgz", + "integrity": "sha1-3vRcxQyWG8yb8jIdD1K8v+wfG7E=", + "dev": true + }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "7.1.2" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "es-abstract": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", + "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "for-each": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", + "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", + "dev": true, + "requires": { + "is-function": "1.0.1" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.3.0", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-function": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", + "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.1" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "jshint": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", + "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", + "dev": true, + "requires": { + "cli": "1.0.1", + "console-browserify": "1.1.0", + "exit": "0.1.2", + "htmlparser2": "3.8.3", + "lodash": "3.7.0", + "minimatch": "3.0.4", + "shelljs": "0.3.0", + "strip-json-comments": "1.0.4" + } + }, + "lodash": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", + "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "object-inspect": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz", + "integrity": "sha512-UmOFbHbwvv+XHj7BerrhVq+knjceBdkvU5AriwLMvhv2qi+e7DJzxfBeFpILEjVzCp+xA+W/pIf06RGPWlZNfw==", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "resumer": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true + }, + "simple-asyncify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-asyncify/-/simple-asyncify-1.0.0.tgz", + "integrity": "sha1-M+1SWXvkIPcr/krOHYWwqdNu7v0=", + "dev": true + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "string.prototype.trim": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", + "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.11.0", + "function-bind": "1.1.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + }, + "tape": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.0.tgz", + "integrity": "sha512-j0jO9BiScfqtPBb9QmPLL0qvxXMz98xjkMb7x8lKipFlJZwNJkqkWPou+NU4V6T9RnVh1kuSthLE8gLrN8bBfw==", + "dev": true, + "requires": { + "deep-equal": "1.0.1", + "defined": "1.0.0", + "for-each": "0.3.2", + "function-bind": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "inherits": "2.0.3", + "minimist": "1.2.0", + "object-inspect": "1.5.0", + "resolve": "1.5.0", + "resumer": "0.0.0", + "string.prototype.trim": "1.1.2", + "through": "2.3.8" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 83fff6e..4616d61 100644 --- a/package.json +++ b/package.json @@ -22,23 +22,23 @@ "browser": "source-map-resolve.js", "scripts": { "lint": "jshint lib/ test/", - "unit": "node test/source-map-resolve.js && node test/windows.js && node test/read.js", + "unit": "node test/source-map-resolve.js && node test/windows.js", "test": "npm run lint && npm run unit", "build": "node generate-source-map-resolve.js" }, "dependencies": { + "atob": "^2.1.1", "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", - "atob": "^2.0.0", - "urix": "^0.1.0", - "resolve-url": "^0.2.1" + "urix": "^0.1.0" }, "devDependencies": { - "tape": "^4.4.0", - "jshint": "~2.9.1", - "setimmediate": "^1.0.4", - "Base64": "^0.3.0", - "simple-asyncify": "^1.0.0" + "Base64": "1.0.1", + "jshint": "2.9.5", + "setimmediate": "1.0.5", + "simple-asyncify": "1.0.0", + "tape": "4.9.0" }, "testling": { "files": "test/source-map-resolve.js", diff --git a/x-package.json5 b/x-package.json5 index 957399f..e79af15 100644 --- a/x-package.json5 +++ b/x-package.json5 @@ -29,20 +29,18 @@ build: "node generate-source-map-resolve.js" }, dependencies: { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", - "atob": "^2.0.0", - "urix": "^0.1.0", - // resolve-url is a dependency in package.json even though it is not - // needed in Node.js, to allow using npm as a package manager for - // browser projects too. - "resolve-url": "^0.2.1" + "urix": "^0.1.0" }, devDependencies: { - "tape": "^4.4.0", - "jshint": "~2.9.1", - "setimmediate": "^1.0.4", - "Base64": "^0.3.0", - "simple-asyncify": "^1.0.0" + "Base64": "1.0.1", + "jshint": "2.9.5", + "setimmediate": "1.0.5", + "simple-asyncify": "1.0.0", + "tape": "4.9.0" }, testling: { files: "test/source-map-resolve.js", From dc722733c58becc86298935728e3419d3963d370 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Thu, 10 May 2018 19:04:14 +0200 Subject: [PATCH 02/16] Remove testling --- package.json | 15 +-------------- readme.md | 5 ----- x-package.json5 | 13 ------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/package.json b/package.json index 4616d61..ac7a61a 100644 --- a/package.json +++ b/package.json @@ -39,18 +39,5 @@ "setimmediate": "1.0.5", "simple-asyncify": "1.0.0", "tape": "4.9.0" - }, - "testling": { - "files": "test/source-map-resolve.js", - "browsers": [ - "ie/8..latest", - "chrome/latest", - "firefox/latest", - "opera/12", - "opera/latest", - "safari/5", - "iphone/6", - "android-browser/4" - ] } -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index a6bbd84..c70bcca 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,6 @@ Overview [![Build Status](https://travis-ci.org/lydell/source-map-resolve.svg?branch=master)](https://travis-ci.org/lydell/source-map-resolve) ======== -[![browser support](https://ci.testling.com/lydell/source-map-resolve.png)](https://ci.testling.com/lydell/source-map-resolve) - Resolve the source map and/or sources for a generated file. ```js @@ -210,9 +208,6 @@ First off, run `npm install` to install testing modules and browser polyfills. `npm test` lints the code and runs the test suite in Node.js. -To run the tests in a browser, run `testling` (`npm install -g testling`) or -`testling -u`. - x-package.json5 --------------- diff --git a/x-package.json5 b/x-package.json5 index e79af15..6ee89c1 100644 --- a/x-package.json5 +++ b/x-package.json5 @@ -41,19 +41,6 @@ "setimmediate": "1.0.5", "simple-asyncify": "1.0.0", "tape": "4.9.0" - }, - testling: { - files: "test/source-map-resolve.js", - browsers: [ - "ie/8..latest", - "chrome/latest", - "firefox/latest", - "opera/12", - "opera/latest", - "safari/5", - "iphone/6", - "android-browser/4" - ] } }, component: { From 858cd9e2ecce25427761b8be616cabf704c69316 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Thu, 10 May 2018 19:11:03 +0200 Subject: [PATCH 03/16] source-map-resolve v0.5.2 --- bower.json | 2 +- changelog.md | 6 ++++++ component.json | 2 +- package.json | 2 +- x-package.json5 | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index 552663b..e95acf3 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.1", + "version": "0.5.2", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.", diff --git a/changelog.md b/changelog.md index d730d36..b35771b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +### Version 0.5.2 (2018-05-10) ### + +- Improved: Updated the version range of `atob` to disallow depending on `2.0.3` + which as a [security + vulnerability](https://snyk.io/test/npm/atob/2.0.3?severity=high&severity=medium&severity=low). + ### Version 0.5.1 (2017-10-21) ### - Fixed: URLs are now decoded before being passed to `read` in Node.js. This diff --git a/component.json b/component.json index c081ca0..7af17d4 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.1", + "version": "0.5.2", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.", diff --git a/package.json b/package.json index ac7a61a..006b463 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.1", + "version": "0.5.2", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.", diff --git a/x-package.json5 b/x-package.json5 index 6ee89c1..5bc9e29 100644 --- a/x-package.json5 +++ b/x-package.json5 @@ -1,6 +1,6 @@ { name: "source-map-resolve", - version: "0.5.1", + version: "0.5.2", author: "Simon Lydell", license: "MIT", description: "Resolve the source map and/or sources for a generated file.", From ff057d4c26b6cb72a9684f6370faa28d7bcb8bdb Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 28 Dec 2019 20:10:42 +0100 Subject: [PATCH 04/16] Fix utf8 support for dataUri base64 (#15) Co-authored-by: ZHAO Jinxiang --- .jshintrc | 3 +- LICENSE | 3 +- lib/source-map-resolve-node.js | 57 +++++++++++++++++++++--- source-map-resolve.js | 54 ++++++++++++++++++++--- test/source-map-resolve.js | 79 ++++++++++++++++++++++++++++++---- 5 files changed, 172 insertions(+), 24 deletions(-) diff --git a/.jshintrc b/.jshintrc index 4a29289..53fb51a 100644 --- a/.jshintrc +++ b/.jshintrc @@ -41,6 +41,7 @@ "define": false, "window": false, "atob": true, - "JSON": false + "JSON": false, + "TextDecoder": true } } diff --git a/LICENSE b/LICENSE index 748f42e..3e33dff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ The MIT License (MIT) -Copyright (c) 2014, 2015, 2016, 2017 Simon Lydell +Copyright (c) 2014, 2015, 2016, 2017, 2019 Simon Lydell +Copyright (c) 2019 ZHAO Jinxiang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/source-map-resolve-node.js b/lib/source-map-resolve-node.js index f80953d..21754b4 100644 --- a/lib/source-map-resolve-node.js +++ b/lib/source-map-resolve-node.js @@ -1,4 +1,5 @@ -// Copyright 2014, 2015, 2016, 2017 Simon Lydell +// Copyright 2014, 2015, 2016, 2017, 2019 Simon Lydell +// Copyright 2019 ZHAO Jinxiang // X11 (“MIT”) Licensed. (See LICENSE.) var sourceMappingURL = require("source-map-url") @@ -71,8 +72,45 @@ function resolveSourceMapSync(code, codeUrl, read) { } var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ + +/** + * The media type for JSON text is application/json. + * + * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } + * + * `text/json` is non-standard media type + */ var jsonMimeTypeRegex = /^(?:application|text)\/json$/ +/** + * JSON text exchanged between systems that are not part of a closed ecosystem + * MUST be encoded using UTF-8. + * + * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} + */ +var jsonCharacterEncoding = "utf-8" + +function base64ToBuf(b64) { + var binStr = atob(b64) + var len = binStr.length + var arr = new Uint8Array(len) + for (var i = 0; i < len; i++) { + arr[i] = binStr.charCodeAt(i) + } + return arr +} + +function decodeBase64String(b64) { + if (typeof TextDecoder === "undefined" || typeof Uint8Array === "undefined") { + return atob(b64) + } + var buf = base64ToBuf(b64); + // Note: `decoder.decode` method will throw a `DOMException` with the + // `"EncodingError"` value when an coding error is found. + var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) + return decoder.decode(buf); +} + function resolveSourceMapHelper(code, codeUrl) { codeUrl = urix(codeUrl) @@ -83,7 +121,7 @@ function resolveSourceMapHelper(code, codeUrl) { var dataUri = url.match(dataUriRegex) if (dataUri) { - var mimeType = dataUri[1] + var mimeType = dataUri[1] || "text/plain" var lastParameter = dataUri[2] || "" var encoded = dataUri[3] || "" var data = { @@ -93,14 +131,19 @@ function resolveSourceMapHelper(code, codeUrl) { map: encoded } if (!jsonMimeTypeRegex.test(mimeType)) { - var error = new Error("Unuseful data uri mime type: " + (mimeType || "text/plain")) + var error = new Error("Unuseful data uri mime type: " + mimeType) + error.sourceMapData = data + throw error + } + try { + data.map = parseMapToJSON( + lastParameter === ";base64" ? decodeBase64String(encoded) : decodeURIComponent(encoded), + data + ) + } catch (error) { error.sourceMapData = data throw error } - data.map = parseMapToJSON( - lastParameter === ";base64" ? atob(encoded) : decodeURIComponent(encoded), - data - ) return data } diff --git a/source-map-resolve.js b/source-map-resolve.js index 387fc19..abafa00 100644 --- a/source-map-resolve.js +++ b/source-map-resolve.js @@ -79,8 +79,45 @@ void (function(root, factory) { } var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ + + /** + * The media type for JSON text is application/json. + * + * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } + * + * `text/json` is non-standard media type + */ var jsonMimeTypeRegex = /^(?:application|text)\/json$/ + /** + * JSON text exchanged between systems that are not part of a closed ecosystem + * MUST be encoded using UTF-8. + * + * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} + */ + var jsonCharacterEncoding = "utf-8" + + function base64ToBuf(b64) { + var binStr = atob(b64) + var len = binStr.length + var arr = new Uint8Array(len) + for (var i = 0; i < len; i++) { + arr[i] = binStr.charCodeAt(i) + } + return arr + } + + function decodeBase64String(b64) { + if (typeof TextDecoder === "undefined" || typeof Uint8Array === "undefined") { + return atob(b64) + } + var buf = base64ToBuf(b64); + // Note: `decoder.decode` method will throw a `DOMException` with the + // `"EncodingError"` value when an coding error is found. + var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) + return decoder.decode(buf); + } + function resolveSourceMapHelper(code, codeUrl) { var url = sourceMappingURL.getFrom(code) if (!url) { @@ -89,7 +126,7 @@ void (function(root, factory) { var dataUri = url.match(dataUriRegex) if (dataUri) { - var mimeType = dataUri[1] + var mimeType = dataUri[1] || "text/plain" var lastParameter = dataUri[2] || "" var encoded = dataUri[3] || "" var data = { @@ -99,14 +136,19 @@ void (function(root, factory) { map: encoded } if (!jsonMimeTypeRegex.test(mimeType)) { - var error = new Error("Unuseful data uri mime type: " + (mimeType || "text/plain")) + var error = new Error("Unuseful data uri mime type: " + mimeType) + error.sourceMapData = data + throw error + } + try { + data.map = parseMapToJSON( + lastParameter === ";base64" ? decodeBase64String(encoded) : decodeURIComponent(encoded), + data + ) + } catch (error) { error.sourceMapData = data throw error } - data.map = parseMapToJSON( - lastParameter === ";base64" ? atob(encoded) : decodeURIComponent(encoded), - data - ) return data } diff --git a/test/source-map-resolve.js b/test/source-map-resolve.js index f61c006..c64e891 100644 --- a/test/source-map-resolve.js +++ b/test/source-map-resolve.js @@ -1,4 +1,5 @@ -// Copyright 2014, 2015, 2016, 2017 Simon Lydell +// Copyright 2014, 2015, 2016, 2017, 2019 Simon Lydell +// Copyright 2019 ZHAO Jinxiang // X11 (“MIT”) Licensed. (See LICENSE.) var test = require("tape") @@ -61,6 +62,12 @@ var map = { sources: [], names: [] }, + utf8 : { + mappings: "AAAA", + sources: ["foo.js"], + sourcesContent: ["中文😊"], + names: [] + }, empty: {} } map.simpleString = JSON.stringify(map.simple) @@ -75,7 +82,8 @@ var code = { "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), base64: u("data:application/json;base64," + - "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W119"), + "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyLkuK3mlofwn5iKIl0sIm5hbWVzIjpbXX0="), // jshint ignore:line + base64InvalidUtf8: u("data:application/json;base64,abc"), dataUriText: u("data:text/json," + "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), @@ -85,6 +93,7 @@ var code = { dataUriNoMime: u("data:,foo"), dataUriInvalidMime: u("data:text/html,foo"), dataUriInvalidJSON: u("data:application/json,foo"), + dataUriInvalidCode: u("data:application/json,%"), dataUriXSSIsafe: u("data:application/json," + ")%5D%7D%27" + "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), @@ -99,7 +108,7 @@ function testResolveSourceMap(method, sync) { var codeUrl = "http://example.com/a/b/c/foo.js" - t.plan(1 + 12*3 + 6*4) + t.plan(1 + 12*3 + 8*4) t.equal(typeof method, "function", "is a function") @@ -171,14 +180,27 @@ function testResolveSourceMap(method, sync) { t.error(error) t.deepEqual(result, { sourceMappingURL: "data:application/json;base64," + - "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W119", + "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyLkuK3mlofwn5iKIl0sIm5hbWVzIjpbXX0=", // jshint ignore:line url: null, sourcesRelativeTo: codeUrl, - map: map.simple + map: map.utf8 }, "base64") isAsync() }) + method(code.base64InvalidUtf8, codeUrl, wrap(Throws), function(error, result) { + t.deepEqual(error.sourceMapData, { + sourceMappingURL: "data:application/json;base64,abc", + url: null, + sourcesRelativeTo: codeUrl, + map: "abc" + }, "base64InvalidUtf8 .sourceMapData") + t.ok(error instanceof TypeError && error.message !== "data:application/json;base64,abc", + "base64InvalidUtf8") + t.notOk(result) + isAsync() + }) + method(code.dataUriText, codeUrl, wrap(Throws), function(error, result) { t.error(error) t.deepEqual(result, { @@ -242,6 +264,19 @@ function testResolveSourceMap(method, sync) { isAsync() }) + method(code.dataUriInvalidCode, codeUrl, wrap(Throws), function(error, result) { + t.deepEqual(error.sourceMapData, { + sourceMappingURL: "data:application/json,%", + url: null, + sourcesRelativeTo: codeUrl, + map: "%" + }, "dataUriInvalidCode .sourceMapData") + t.ok(error instanceof URIError && error.message !== "data:application/json,%", + "dataUriInvalidCode") + t.notOk(result) + isAsync() + }) + method(code.dataUriXSSIsafe, codeUrl, wrap(Throws), function(error, result) { t.error(error) t.deepEqual(result, { @@ -599,7 +634,7 @@ function testResolve(method, sync) { var codeUrl = "http://example.com/a/b/c/foo.js" - t.plan(1 + 15*3 + 21*4 + 4) + t.plan(1 + 15*3 + 23*4 + 4) t.equal(typeof method, "function", "is a function") @@ -683,16 +718,29 @@ function testResolve(method, sync) { t.error(error) t.deepEqual(result, { sourceMappingURL: "data:application/json;base64," + - "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W119", + "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyLkuK3mlofwn5iKIl0sIm5hbWVzIjpbXX0=", // jshint ignore:line url: null, sourcesRelativeTo: codeUrl, - map: map.simple, + map: map.utf8, sourcesResolved: ["http://example.com/a/b/c/foo.js"], - sourcesContent: ["http://example.com/a/b/c/foo.js"] + sourcesContent: ["中文😊"] }, "base64") isAsync() }) + method(code.base64InvalidUtf8, codeUrl, wrap(Throws), function(error, result) { + t.deepEqual(error.sourceMapData, { + sourceMappingURL: "data:application/json;base64,abc", + url: null, + sourcesRelativeTo: codeUrl, + map: "abc" + }, "base64InvalidUtf8 .sourceMapData") + t.ok(error instanceof TypeError && error.message !== "data:application/json;base64,abc", + "base64InvalidUtf8") + t.notOk(result) + isAsync() + }) + method(code.dataUriText, codeUrl, wrapMap(Throws, identity), function(error, result) { t.error(error) t.deepEqual(result, { @@ -760,6 +808,19 @@ function testResolve(method, sync) { isAsync() }) + method(code.dataUriInvalidCode, codeUrl, wrap(Throws), function(error, result) { + t.deepEqual(error.sourceMapData, { + sourceMappingURL: "data:application/json,%", + url: null, + sourcesRelativeTo: codeUrl, + map: "%" + }, "dataUriInvalidCode .sourceMapData") + t.ok(error instanceof URIError && error.message !== "data:application/json,%", + "dataUriInvalidCode") + t.notOk(result) + isAsync() + }) + method(code.dataUriXSSIsafe, codeUrl, wrapMap(Throws, identity), function(error, result) { t.error(error) t.deepEqual(result, { From 1a58d533373d313a771d1cad4c877206ac729527 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 28 Dec 2019 20:13:43 +0100 Subject: [PATCH 05/16] Update npm packages --- package-lock.json | 381 +++++++++++++++++++++++++++------------------- package.json | 10 +- 2 files changed, 228 insertions(+), 163 deletions(-) diff --git a/package-lock.json b/package-lock.json index 978f30e..ffd0630 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,19 @@ { "name": "source-map-resolve", - "version": "0.5.1", + "version": "0.5.2", "lockfileVersion": 1, "requires": true, "dependencies": { "Base64": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/Base64/-/Base64-1.0.1.tgz", - "integrity": "sha1-3vRcxQyWG8yb8jIdD1K8v+wfG7E=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/Base64/-/Base64-1.1.0.tgz", + "integrity": "sha512-qeacf8dvGpf+XAT27ESHMh7z84uRzj/ua2pQdJg483m3bEXv/kVFtDnMgvf70BQGqzbZhR9t6BmASzKvqfJf3Q==", "dev": true }, "atob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" }, "balanced-match": { "version": "1.0.0", @@ -27,7 +27,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -38,7 +38,7 @@ "dev": true, "requires": { "exit": "0.1.2", - "glob": "7.1.2" + "glob": "^7.1.1" } }, "concat-map": { @@ -53,7 +53,7 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "0.1.4" + "date-now": "^0.1.4" } }, "core-util-is": { @@ -74,19 +74,26 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } }, "define-properties": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", - "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.11" + "object-keys": "^1.0.12" } }, "defined": { @@ -96,33 +103,33 @@ "dev": true }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "dev": true, "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" + "domelementtype": "^2.0.1", + "entities": "^2.0.0" }, "dependencies": { "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==", "dev": true }, "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==", "dev": true } } }, "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", "dev": true }, "domhandler": { @@ -131,7 +138,7 @@ "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", "dev": true, "requires": { - "domelementtype": "1.3.0" + "domelementtype": "1" } }, "domutils": { @@ -140,8 +147,8 @@ "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", "dev": true, "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" + "dom-serializer": "0", + "domelementtype": "1" } }, "entities": { @@ -151,27 +158,33 @@ "dev": true }, "es-abstract": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", - "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.0.tgz", + "integrity": "sha512-yYkE07YF+6SIBmg1MsJ9dlub5L48Ek7X0qz+c/CPCHS9EBXfESorzng4cJQjJW5/pB6vDF41u7F8vUhLVDqIug==", "dev": true, "requires": { - "es-to-primitive": "1.1.1", - "function-bind": "1.1.1", - "has": "1.0.1", - "is-callable": "1.1.3", - "is-regex": "1.0.4" + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" } }, "es-to-primitive": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", - "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "requires": { - "is-callable": "1.1.3", - "is-date-object": "1.0.1", - "is-symbol": "1.0.1" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, "exit": { @@ -181,20 +194,14 @@ "dev": true }, "for-each": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz", - "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "requires": { - "is-function": "1.0.1" + "is-callable": "^1.1.3" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -208,39 +215,45 @@ "dev": true }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "has": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, "htmlparser2": { "version": "3.8.3", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", "dev": true, "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" } }, "inflight": { @@ -249,48 +262,51 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, - "is-callable": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", - "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", "dev": true }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", "dev": true }, - "is-function": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz", - "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=", + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", "dev": true, "requires": { - "has": "1.0.1" + "has": "^1.0.3" } }, "is-symbol": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", - "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } }, "isarray": { "version": "0.0.1", @@ -299,25 +315,25 @@ "dev": true }, "jshint": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", - "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.3.tgz", + "integrity": "sha512-d8AoXcNNYzmm7cdmulQ3dQApbrPYArtVBO6n4xOICe4QsXGNHCAKDcFORzqP52LhK61KX0VhY39yYzCsNq+bxQ==", "dev": true, "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.11", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" } }, "lodash": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", - "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "minimatch": { @@ -326,7 +342,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -336,24 +352,42 @@ "dev": true }, "object-inspect": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz", - "integrity": "sha512-UmOFbHbwvv+XHj7BerrhVq+knjceBdkvU5AriwLMvhv2qi+e7DJzxfBeFpILEjVzCp+xA+W/pIf06RGPWlZNfw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.2.tgz", + "integrity": "sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ==", "dev": true }, "object-keys": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", - "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "path-is-absolute": { @@ -363,9 +397,9 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "readable-stream": { @@ -374,19 +408,29 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" + } + }, + "regexp.prototype.flags": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz", + "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" } }, "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", + "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.6" } }, "resolve-url": { @@ -400,7 +444,7 @@ "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", "dev": true, "requires": { - "through": "2.3.8" + "through": "~2.3.4" } }, "setimmediate": { @@ -427,14 +471,34 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" }, "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz", + "integrity": "sha512-MjGFEeqixw47dAMFMtgUro/I0+wNqZB5GKXGt1fFr24u3TzDXCPu7J9Buppzoe3r/LqkSDLDDJzE15RGWDGAVw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", "dev": true, "requires": { - "define-properties": "1.1.2", - "es-abstract": "1.11.0", - "function-bind": "1.1.1" + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" } }, "string_decoder": { @@ -450,24 +514,25 @@ "dev": true }, "tape": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.0.tgz", - "integrity": "sha512-j0jO9BiScfqtPBb9QmPLL0qvxXMz98xjkMb7x8lKipFlJZwNJkqkWPou+NU4V6T9RnVh1kuSthLE8gLrN8bBfw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.12.1.tgz", + "integrity": "sha512-xoK2ariLmdGxqyXhhxfIZlr0czNB8hNJeVQmHN4D7ZyBn30GUoa4q2oM4cX8jNhnj1mtILXn1ugbfxc0tTDKtA==", "dev": true, "requires": { - "deep-equal": "1.0.1", - "defined": "1.0.0", - "for-each": "0.3.2", - "function-bind": "1.1.1", - "glob": "7.1.2", - "has": "1.0.1", - "inherits": "2.0.3", - "minimist": "1.2.0", - "object-inspect": "1.5.0", - "resolve": "1.5.0", - "resumer": "0.0.0", - "string.prototype.trim": "1.1.2", - "through": "2.3.8" + "deep-equal": "~1.1.1", + "defined": "~1.0.0", + "for-each": "~0.3.3", + "function-bind": "~1.1.1", + "glob": "~7.1.6", + "has": "~1.0.3", + "inherits": "~2.0.4", + "is-regex": "~1.0.5", + "minimist": "~1.2.0", + "object-inspect": "~1.7.0", + "resolve": "~1.14.1", + "resumer": "~0.0.0", + "string.prototype.trim": "~1.2.1", + "through": "~2.3.8" } }, "through": { diff --git a/package.json b/package.json index 006b463..11fd963 100644 --- a/package.json +++ b/package.json @@ -27,17 +27,17 @@ "build": "node generate-source-map-resolve.js" }, "dependencies": { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", "urix": "^0.1.0" }, "devDependencies": { - "Base64": "1.0.1", - "jshint": "2.9.5", + "Base64": "1.1.0", + "jshint": "2.10.3", "setimmediate": "1.0.5", "simple-asyncify": "1.0.0", - "tape": "4.9.0" + "tape": "4.12.1" } -} \ No newline at end of file +} From a44979ed55956e0e201cad29bf0c069379d37bd4 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 28 Dec 2019 20:20:05 +0100 Subject: [PATCH 06/16] Update license --- LICENSE | 2 +- generate-source-map-resolve.js | 3 --- lib/decode-uri-component.js | 3 --- lib/resolve-url.js | 3 --- lib/source-map-resolve-node.js | 4 ---- readme.md | 2 +- source-map-resolve.js | 3 --- source-map-resolve.js.template | 3 --- test/common.js | 3 --- test/read.js | 3 --- test/source-map-resolve.js | 4 ---- test/windows.js | 3 --- 12 files changed, 2 insertions(+), 34 deletions(-) diff --git a/LICENSE b/LICENSE index 3e33dff..2ae9757 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014, 2015, 2016, 2017, 2019 Simon Lydell +Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019 Simon Lydell Copyright (c) 2019 ZHAO Jinxiang Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/generate-source-map-resolve.js b/generate-source-map-resolve.js index a37e393..0fe01bf 100644 --- a/generate-source-map-resolve.js +++ b/generate-source-map-resolve.js @@ -1,6 +1,3 @@ -// Copyright 2014, 2017 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - var fs = require("fs") var template = fs.readFileSync("source-map-resolve.js.template").toString() diff --git a/lib/decode-uri-component.js b/lib/decode-uri-component.js index c7064ff..0739c20 100644 --- a/lib/decode-uri-component.js +++ b/lib/decode-uri-component.js @@ -1,6 +1,3 @@ -// Copyright 2017 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - var decodeUriComponent = require("decode-uri-component") function customDecodeUriComponent(string) { diff --git a/lib/resolve-url.js b/lib/resolve-url.js index 2ca8fa9..e3a86c4 100644 --- a/lib/resolve-url.js +++ b/lib/resolve-url.js @@ -1,6 +1,3 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - var url = require("url") function resolveUrl(/* ...urls */) { diff --git a/lib/source-map-resolve-node.js b/lib/source-map-resolve-node.js index 21754b4..c53e5d7 100644 --- a/lib/source-map-resolve-node.js +++ b/lib/source-map-resolve-node.js @@ -1,7 +1,3 @@ -// Copyright 2014, 2015, 2016, 2017, 2019 Simon Lydell -// Copyright 2019 ZHAO Jinxiang -// X11 (“MIT”) Licensed. (See LICENSE.) - var sourceMappingURL = require("source-map-url") var resolveUrl = require("./resolve-url") var decodeUriComponent = require("./decode-uri-component") diff --git a/readme.md b/readme.md index c70bcca..5796ba1 100644 --- a/readme.md +++ b/readme.md @@ -228,4 +228,4 @@ source-map-resolve.js! To generate it, run `npm run build`. License ======= -[The X11 (“MIT”) License](LICENSE). +[MIT](LICENSE). diff --git a/source-map-resolve.js b/source-map-resolve.js index abafa00..9d1297c 100644 --- a/source-map-resolve.js +++ b/source-map-resolve.js @@ -1,6 +1,3 @@ -// Copyright 2014, 2015, 2016, 2017 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - // Note: source-map-resolve.js is generated from source-map-resolve-node.js and // source-map-resolve-template.js. Only edit the two latter files, _not_ // source-map-resolve.js! diff --git a/source-map-resolve.js.template b/source-map-resolve.js.template index 813198a..413ab61 100644 --- a/source-map-resolve.js.template +++ b/source-map-resolve.js.template @@ -1,6 +1,3 @@ -// Copyright 2014, 2015, 2016, 2017 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - // Note: source-map-resolve.js is generated from source-map-resolve-node.js and // source-map-resolve-template.js. Only edit the two latter files, _not_ // source-map-resolve.js! diff --git a/test/common.js b/test/common.js index 8616c17..b7fb30d 100644 --- a/test/common.js +++ b/test/common.js @@ -1,6 +1,3 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - function u(url) { return "code\n/*# sourceMappingURL=" + url + " */" } diff --git a/test/read.js b/test/read.js index 6bf2dad..7c3cf07 100644 --- a/test/read.js +++ b/test/read.js @@ -1,6 +1,3 @@ -// Copyright 2017 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - var test = require("tape") var asyncify = require("simple-asyncify") var common = require("./common") diff --git a/test/source-map-resolve.js b/test/source-map-resolve.js index c64e891..aa9dede 100644 --- a/test/source-map-resolve.js +++ b/test/source-map-resolve.js @@ -1,7 +1,3 @@ -// Copyright 2014, 2015, 2016, 2017, 2019 Simon Lydell -// Copyright 2019 ZHAO Jinxiang -// X11 (“MIT”) Licensed. (See LICENSE.) - var test = require("tape") var asyncify = require("simple-asyncify") var common = require("./common") diff --git a/test/windows.js b/test/windows.js index 611ec7d..6b4e173 100644 --- a/test/windows.js +++ b/test/windows.js @@ -1,6 +1,3 @@ -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - var path = require("path") var test = require("tape") var asyncify = require("simple-asyncify") From adbaef154743860853b5bc92837c1562cc6bf74d Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 28 Dec 2019 20:29:24 +0100 Subject: [PATCH 07/16] Remove trailing spaces --- lib/source-map-resolve-node.js | 9 +++++---- source-map-resolve.js | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/source-map-resolve-node.js b/lib/source-map-resolve-node.js index c53e5d7..31ec3b2 100644 --- a/lib/source-map-resolve-node.js +++ b/lib/source-map-resolve-node.js @@ -1,4 +1,5 @@ var sourceMappingURL = require("source-map-url") + var resolveUrl = require("./resolve-url") var decodeUriComponent = require("./decode-uri-component") var urix = require("urix") @@ -71,9 +72,9 @@ var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ /** * The media type for JSON text is application/json. - * + * * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } - * + * * `text/json` is non-standard media type */ var jsonMimeTypeRegex = /^(?:application|text)\/json$/ @@ -81,7 +82,7 @@ var jsonMimeTypeRegex = /^(?:application|text)\/json$/ /** * JSON text exchanged between systems that are not part of a closed ecosystem * MUST be encoded using UTF-8. - * + * * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} */ var jsonCharacterEncoding = "utf-8" @@ -104,7 +105,7 @@ function decodeBase64String(b64) { // Note: `decoder.decode` method will throw a `DOMException` with the // `"EncodingError"` value when an coding error is found. var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) - return decoder.decode(buf); + return decoder.decode(buf); } function resolveSourceMapHelper(code, codeUrl) { diff --git a/source-map-resolve.js b/source-map-resolve.js index 9d1297c..282b126 100644 --- a/source-map-resolve.js +++ b/source-map-resolve.js @@ -79,9 +79,9 @@ void (function(root, factory) { /** * The media type for JSON text is application/json. - * + * * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } - * + * * `text/json` is non-standard media type */ var jsonMimeTypeRegex = /^(?:application|text)\/json$/ @@ -89,7 +89,7 @@ void (function(root, factory) { /** * JSON text exchanged between systems that are not part of a closed ecosystem * MUST be encoded using UTF-8. - * + * * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} */ var jsonCharacterEncoding = "utf-8" @@ -112,7 +112,7 @@ void (function(root, factory) { // Note: `decoder.decode` method will throw a `DOMException` with the // `"EncodingError"` value when an coding error is found. var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) - return decoder.decode(buf); + return decoder.decode(buf); } function resolveSourceMapHelper(code, codeUrl) { From 8cb7ab5bfbdad54fb19d20a842dff9300d748bc4 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 28 Dec 2019 20:34:39 +0100 Subject: [PATCH 08/16] Reduce size of npm package --- package.json | 4 ++++ x-package.json5 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/package.json b/package.json index 11fd963..60f655e 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,10 @@ "repository": "lydell/source-map-resolve", "main": "lib/source-map-resolve-node.js", "browser": "source-map-resolve.js", + "files": [ + "lib", + "source-map-resolve.js" + ], "scripts": { "lint": "jshint lib/ test/", "unit": "node test/source-map-resolve.js && node test/windows.js", diff --git a/x-package.json5 b/x-package.json5 index 5bc9e29..96d4ba9 100644 --- a/x-package.json5 +++ b/x-package.json5 @@ -22,6 +22,10 @@ repository: "lydell/source-map-resolve", main: "lib/source-map-resolve-node.js", browser: "source-map-resolve.js", + files: [ + "lib", + "source-map-resolve.js" + ], scripts: { lint: "jshint lib/ test/", unit: "node test/source-map-resolve.js && node test/windows.js", From b8244f108af0aaf34c32a61e97b66e38db682afc Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 28 Dec 2019 20:35:52 +0100 Subject: [PATCH 09/16] source-map-resolve v0.5.3 --- bower.json | 2 +- changelog.md | 8 ++++++++ component.json | 2 +- package-lock.json | 2 +- package.json | 4 ++-- x-package.json5 | 10 +++++----- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index e95acf3..8c18765 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.2", + "version": "0.5.3", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.", diff --git a/changelog.md b/changelog.md index b35771b..7b3f94b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +### Version 0.5.3 (2019-12-28) ### + +- Fixed: base64 encoded source maps now correctly decodes as utf-8. Previously, + non-ASCII characters could end up garbled. Thanks to ZHAO Jinxiang + (@xiaoxiangmoe)! (Note: This fix does not work in old evironments not + supporting both `TextDecoder` and `Uint8Array`.) +- Improved: Reduced size of the npm package. + ### Version 0.5.2 (2018-05-10) ### - Improved: Updated the version range of `atob` to disallow depending on `2.0.3` diff --git a/component.json b/component.json index 7af17d4..005f22b 100644 --- a/component.json +++ b/component.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.2", + "version": "0.5.3", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.", diff --git a/package-lock.json b/package-lock.json index ffd0630..d6a30aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.2", + "version": "0.5.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 60f655e..78b6398 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.2", + "version": "0.5.3", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.", @@ -44,4 +44,4 @@ "simple-asyncify": "1.0.0", "tape": "4.12.1" } -} +} \ No newline at end of file diff --git a/x-package.json5 b/x-package.json5 index 96d4ba9..ff22ecb 100644 --- a/x-package.json5 +++ b/x-package.json5 @@ -1,6 +1,6 @@ { name: "source-map-resolve", - version: "0.5.2", + version: "0.5.3", author: "Simon Lydell", license: "MIT", description: "Resolve the source map and/or sources for a generated file.", @@ -33,18 +33,18 @@ build: "node generate-source-map-resolve.js" }, dependencies: { - "atob": "^2.1.1", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", "urix": "^0.1.0" }, devDependencies: { - "Base64": "1.0.1", - "jshint": "2.9.5", + "Base64": "1.1.0", + "jshint": "2.10.3", "setimmediate": "1.0.5", "simple-asyncify": "1.0.0", - "tape": "4.9.0" + "tape": "4.12.1" } }, component: { From 34c23e3715dcdaa9ea06d71eed77fc6d69d006f4 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 21:35:44 +0100 Subject: [PATCH 10/16] Update npm packages --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d6a30aa..51fdb9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -346,9 +346,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "object-inspect": { diff --git a/package.json b/package.json index 78b6398..f87d0a5 100644 --- a/package.json +++ b/package.json @@ -44,4 +44,4 @@ "simple-asyncify": "1.0.0", "tape": "4.12.1" } -} \ No newline at end of file +} From df811258cf7021ab6e6a485a2a49be0e33d2e87a Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 22:36:31 +0100 Subject: [PATCH 11/16] Get rid of the browser version and inline some dependencies --- bower.json | 30 --- component.json | 29 --- generate-source-map-resolve.js | 25 --- lib/decode-uri-component.js | 8 - lib/resolve-url.js | 9 - lib/source-map-resolve-node.js | 61 ++++-- package-lock.json | 15 -- package.json | 12 +- readme.md | 40 +--- source-map-resolve.js | 348 --------------------------------- source-map-resolve.js.template | 19 -- test/common.js | 19 +- test/read.js | 6 +- test/source-map-resolve.js | 35 ++-- test/windows.js | 16 +- x-package.json5 | 72 ------- 16 files changed, 100 insertions(+), 644 deletions(-) delete mode 100644 bower.json delete mode 100644 component.json delete mode 100644 generate-source-map-resolve.js delete mode 100644 lib/decode-uri-component.js delete mode 100644 lib/resolve-url.js delete mode 100644 source-map-resolve.js delete mode 100644 source-map-resolve.js.template delete mode 100644 x-package.json5 diff --git a/bower.json b/bower.json deleted file mode 100644 index 8c18765..0000000 --- a/bower.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "source-map-resolve", - "version": "0.5.3", - "author": "Simon Lydell", - "license": "MIT", - "description": "Resolve the source map and/or sources for a generated file.", - "keywords": [ - "source map", - "sourcemap", - "source", - "map", - "sourceMappingURL", - "resolve", - "resolver", - "locate", - "locator", - "find", - "finder" - ], - "authors": [ - "Simon Lydell" - ], - "ignore": [ - ".*" - ], - "dependencies": { - "source-map-url": "^0.4.0", - "resolve-url": "^0.2.1" - } -} \ No newline at end of file diff --git a/component.json b/component.json deleted file mode 100644 index 005f22b..0000000 --- a/component.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "source-map-resolve", - "version": "0.5.3", - "author": "Simon Lydell", - "license": "MIT", - "description": "Resolve the source map and/or sources for a generated file.", - "keywords": [ - "source map", - "sourcemap", - "source", - "map", - "sourceMappingURL", - "resolve", - "resolver", - "locate", - "locator", - "find", - "finder" - ], - "repo": "lydell/source-map-resolve", - "main": "source-map-resolve.js", - "scripts": [ - "source-map-resolve.js" - ], - "dependencies": { - "lydell/source-map-url": "~0.4.0", - "lydell/resolve-url": "~0.2.1" - } -} \ No newline at end of file diff --git a/generate-source-map-resolve.js b/generate-source-map-resolve.js deleted file mode 100644 index 0fe01bf..0000000 --- a/generate-source-map-resolve.js +++ /dev/null @@ -1,25 +0,0 @@ -var fs = require("fs") - -var template = fs.readFileSync("source-map-resolve.js.template").toString() -var nodeCode = fs.readFileSync("lib/source-map-resolve-node.js").toString() - -nodeCode = nodeCode - - // Remove leading comments and `require`s. - .replace(/^\s*(?:\/\/.+\s+|var\s+\w+\s*=\s*require\([^)]+\).*\s+)*/, "") - - // Remove `urix`. - .replace(/(\w+)\s*=\s*urix\(\1\)\s*/g, "") - - // Remove `decode-uri-component`. - .replace(/(var readUrl = )decodeUriComponent\(([\w.]+)\)/g, "$1$2") - - // Change `module.exports = {...}` to `return {...}`. - .replace(/module\.exports = (\{[^}]+\})\s*$/, "return $1") - - // Indent. - .replace(/^(?!$)/gm, " ") - -var code = template.replace(/[ \t]*\{\{source-map-resolve-node.js\}\}/, nodeCode) - -fs.writeFileSync("source-map-resolve.js", code) diff --git a/lib/decode-uri-component.js b/lib/decode-uri-component.js deleted file mode 100644 index 0739c20..0000000 --- a/lib/decode-uri-component.js +++ /dev/null @@ -1,8 +0,0 @@ -var decodeUriComponent = require("decode-uri-component") - -function customDecodeUriComponent(string) { - // `decodeUriComponent` turns `+` into ` `, but that's not wanted. - return decodeUriComponent(string.replace(/\+/g, "%2B")) -} - -module.exports = customDecodeUriComponent diff --git a/lib/resolve-url.js b/lib/resolve-url.js deleted file mode 100644 index e3a86c4..0000000 --- a/lib/resolve-url.js +++ /dev/null @@ -1,9 +0,0 @@ -var url = require("url") - -function resolveUrl(/* ...urls */) { - return Array.prototype.reduce.call(arguments, function(resolved, nextUrl) { - return url.resolve(resolved, nextUrl) - }) -} - -module.exports = resolveUrl diff --git a/lib/source-map-resolve-node.js b/lib/source-map-resolve-node.js index 31ec3b2..66bb638 100644 --- a/lib/source-map-resolve-node.js +++ b/lib/source-map-resolve-node.js @@ -1,11 +1,24 @@ -var sourceMappingURL = require("source-map-url") +var atob = require("atob") +var urlLib = require("url") +var pathLib = require("path") +var decodeUriComponentLib = require("decode-uri-component") -var resolveUrl = require("./resolve-url") -var decodeUriComponent = require("./decode-uri-component") -var urix = require("urix") -var atob = require("atob") +function resolveUrl(/* ...urls */) { + return Array.prototype.reduce.call(arguments, function(resolved, nextUrl) { + return urlLib.resolve(resolved, nextUrl) + }) +} + +function convertWindowsPath(aPath) { + return pathLib.sep === "\\" ? aPath.replace(/\\/g, "/").replace(/^[a-z]:\/?/i, "/") : aPath +} + +function customDecodeUriComponent(string) { + // `decodeUriComponentLib` turns `+` into ` `, but that's not wanted. + return decodeUriComponentLib(string.replace(/\+/g, "%2B")) +} function callbackAsync(callback, error, result) { setImmediate(function() { callback(error, result) }) @@ -21,7 +34,7 @@ function parseMapToJSON(string, data) { } function readSync(read, url, data) { - var readUrl = decodeUriComponent(url) + var readUrl = customDecodeUriComponent(url) try { return String(read(readUrl)) } catch (error) { @@ -32,6 +45,28 @@ function readSync(read, url, data) { +var innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/ + +var sourceMappingURLRegex = RegExp( + "(?:" + + "/\\*" + + "(?:\\s*\r?\n(?://)?)?" + + "(?:" + innerRegex.source + ")" + + "\\s*" + + "\\*/" + + "|" + + "//(?:" + innerRegex.source + ")" + + ")" + + "\\s*" +) + +function getSourceMappingUrl(code) { + var match = code.match(sourceMappingURLRegex) + return match ? match[1] || match[2] || "" : null +} + + + function resolveSourceMap(code, codeUrl, read, callback) { var mapData try { @@ -42,7 +77,7 @@ function resolveSourceMap(code, codeUrl, read, callback) { if (!mapData || mapData.map) { return callbackAsync(callback, null, mapData) } - var readUrl = decodeUriComponent(mapData.url) + var readUrl = customDecodeUriComponent(mapData.url) read(readUrl, function(error, result) { if (error) { error.sourceMapData = mapData @@ -109,9 +144,9 @@ function decodeBase64String(b64) { } function resolveSourceMapHelper(code, codeUrl) { - codeUrl = urix(codeUrl) + codeUrl = convertWindowsPath(codeUrl) - var url = sourceMappingURL.getFrom(code) + var url = getSourceMappingUrl(code) if (!url) { return null } @@ -184,7 +219,7 @@ function resolveSources(map, mapUrl, read, options, callback) { result.sourcesContent[index] = sourceContent callbackAsync(done, null) } else { - var readUrl = decodeUriComponent(fullUrl) + var readUrl = customDecodeUriComponent(fullUrl) read(readUrl, function(error, source) { result.sourcesContent[index] = error ? error : String(source) done() @@ -209,7 +244,7 @@ function resolveSourcesSync(map, mapUrl, read, options) { if (typeof sourceContent === "string") { result.sourcesContent[index] = sourceContent } else { - var readUrl = decodeUriComponent(fullUrl) + var readUrl = customDecodeUriComponent(fullUrl) try { result.sourcesContent[index] = String(read(readUrl)) } catch (error) { @@ -226,7 +261,7 @@ var endingSlash = /\/?$/ function resolveSourcesHelper(map, mapUrl, options, fn) { options = options || {} - mapUrl = urix(mapUrl) + mapUrl = convertWindowsPath(mapUrl) var fullUrl var sourceContent var sourceRoot @@ -267,7 +302,7 @@ function resolve(code, codeUrl, read, options, callback) { sourcesRelativeTo: mapUrl, map: null } - var readUrl = decodeUriComponent(mapUrl) + var readUrl = customDecodeUriComponent(mapUrl) read(readUrl, function(error, result) { if (error) { error.sourceMapData = data diff --git a/package-lock.json b/package-lock.json index 51fdb9f..1e13f8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -433,11 +433,6 @@ "path-parse": "^1.0.6" } }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, "resumer": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", @@ -465,11 +460,6 @@ "integrity": "sha1-M+1SWXvkIPcr/krOHYWwqdNu7v0=", "dev": true }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, "string.prototype.trim": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.1.tgz", @@ -541,11 +531,6 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index f87d0a5..beac3e5 100644 --- a/package.json +++ b/package.json @@ -19,23 +19,17 @@ ], "repository": "lydell/source-map-resolve", "main": "lib/source-map-resolve-node.js", - "browser": "source-map-resolve.js", "files": [ - "lib", - "source-map-resolve.js" + "lib" ], "scripts": { "lint": "jshint lib/ test/", "unit": "node test/source-map-resolve.js && node test/windows.js", - "test": "npm run lint && npm run unit", - "build": "node generate-source-map-resolve.js" + "test": "npm run lint && npm run unit" }, "dependencies": { "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" + "decode-uri-component": "^0.2.0" }, "devDependencies": { "Base64": "1.1.0", diff --git a/readme.md b/readme.md index 5796ba1..4ce571e 100644 --- a/readme.md +++ b/readme.md @@ -60,18 +60,7 @@ sourceMapResolve.resolve(code, "/js/foo.js", fs.readFile, function(error, result Installation ============ -- `npm install source-map-resolve` -- `bower install source-map-resolve` -- `component install lydell/source-map-resolve` - -Works with CommonJS, AMD and browser globals, through UMD. - -Note: This module requires `setImmediate` and `atob`. -Use polyfills if needed, such as: - -- -- - +`npm install source-map-resolve` Usage ===== @@ -198,33 +187,6 @@ _you_ give the generated code to the module), it’s up to you to look for such header when you retrieve the file (should the need arise). -Development -=========== - -Tests ------ - -First off, run `npm install` to install testing modules and browser polyfills. - -`npm test` lints the code and runs the test suite in Node.js. - -x-package.json5 ---------------- - -package.json, component.json and bower.json are all generated from -x-package.json5 by using [`xpkg`]. Only edit x-package.json5, and remember to -run `xpkg` before commiting! - -[`xpkg`]: https://github.com/kof/node-xpkg - -Generating the browser version ------------------------------- - -source-map-resolve.js is generated from source-map-resolve-node.js and -source-map-resolve-template.js. Only edit the two latter files, _not_ -source-map-resolve.js! To generate it, run `npm run build`. - - License ======= diff --git a/source-map-resolve.js b/source-map-resolve.js deleted file mode 100644 index 282b126..0000000 --- a/source-map-resolve.js +++ /dev/null @@ -1,348 +0,0 @@ -// Note: source-map-resolve.js is generated from source-map-resolve-node.js and -// source-map-resolve-template.js. Only edit the two latter files, _not_ -// source-map-resolve.js! - -void (function(root, factory) { - if (typeof define === "function" && define.amd) { - define(["source-map-url", "resolve-url"], factory) - } else if (typeof exports === "object") { - var sourceMappingURL = require("source-map-url") - var resolveUrl = require("resolve-url") - module.exports = factory(sourceMappingURL, resolveUrl) - } else { - root.sourceMapResolve = factory(root.sourceMappingURL, root.resolveUrl) - } -}(this, function(sourceMappingURL, resolveUrl) { - - function callbackAsync(callback, error, result) { - setImmediate(function() { callback(error, result) }) - } - - function parseMapToJSON(string, data) { - try { - return JSON.parse(string.replace(/^\)\]\}'/, "")) - } catch (error) { - error.sourceMapData = data - throw error - } - } - - function readSync(read, url, data) { - var readUrl = url - try { - return String(read(readUrl)) - } catch (error) { - error.sourceMapData = data - throw error - } - } - - - - function resolveSourceMap(code, codeUrl, read, callback) { - var mapData - try { - mapData = resolveSourceMapHelper(code, codeUrl) - } catch (error) { - return callbackAsync(callback, error) - } - if (!mapData || mapData.map) { - return callbackAsync(callback, null, mapData) - } - var readUrl = mapData.url - read(readUrl, function(error, result) { - if (error) { - error.sourceMapData = mapData - return callback(error) - } - mapData.map = String(result) - try { - mapData.map = parseMapToJSON(mapData.map, mapData) - } catch (error) { - return callback(error) - } - callback(null, mapData) - }) - } - - function resolveSourceMapSync(code, codeUrl, read) { - var mapData = resolveSourceMapHelper(code, codeUrl) - if (!mapData || mapData.map) { - return mapData - } - mapData.map = readSync(read, mapData.url, mapData) - mapData.map = parseMapToJSON(mapData.map, mapData) - return mapData - } - - var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ - - /** - * The media type for JSON text is application/json. - * - * {@link https://tools.ietf.org/html/rfc8259#section-11 | IANA Considerations } - * - * `text/json` is non-standard media type - */ - var jsonMimeTypeRegex = /^(?:application|text)\/json$/ - - /** - * JSON text exchanged between systems that are not part of a closed ecosystem - * MUST be encoded using UTF-8. - * - * {@link https://tools.ietf.org/html/rfc8259#section-8.1 | Character Encoding} - */ - var jsonCharacterEncoding = "utf-8" - - function base64ToBuf(b64) { - var binStr = atob(b64) - var len = binStr.length - var arr = new Uint8Array(len) - for (var i = 0; i < len; i++) { - arr[i] = binStr.charCodeAt(i) - } - return arr - } - - function decodeBase64String(b64) { - if (typeof TextDecoder === "undefined" || typeof Uint8Array === "undefined") { - return atob(b64) - } - var buf = base64ToBuf(b64); - // Note: `decoder.decode` method will throw a `DOMException` with the - // `"EncodingError"` value when an coding error is found. - var decoder = new TextDecoder(jsonCharacterEncoding, {fatal: true}) - return decoder.decode(buf); - } - - function resolveSourceMapHelper(code, codeUrl) { - var url = sourceMappingURL.getFrom(code) - if (!url) { - return null - } - - var dataUri = url.match(dataUriRegex) - if (dataUri) { - var mimeType = dataUri[1] || "text/plain" - var lastParameter = dataUri[2] || "" - var encoded = dataUri[3] || "" - var data = { - sourceMappingURL: url, - url: null, - sourcesRelativeTo: codeUrl, - map: encoded - } - if (!jsonMimeTypeRegex.test(mimeType)) { - var error = new Error("Unuseful data uri mime type: " + mimeType) - error.sourceMapData = data - throw error - } - try { - data.map = parseMapToJSON( - lastParameter === ";base64" ? decodeBase64String(encoded) : decodeURIComponent(encoded), - data - ) - } catch (error) { - error.sourceMapData = data - throw error - } - return data - } - - var mapUrl = resolveUrl(codeUrl, url) - return { - sourceMappingURL: url, - url: mapUrl, - sourcesRelativeTo: mapUrl, - map: null - } - } - - - - function resolveSources(map, mapUrl, read, options, callback) { - if (typeof options === "function") { - callback = options - options = {} - } - var pending = map.sources ? map.sources.length : 0 - var result = { - sourcesResolved: [], - sourcesContent: [] - } - - if (pending === 0) { - callbackAsync(callback, null, result) - return - } - - var done = function() { - pending-- - if (pending === 0) { - callback(null, result) - } - } - - resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { - result.sourcesResolved[index] = fullUrl - if (typeof sourceContent === "string") { - result.sourcesContent[index] = sourceContent - callbackAsync(done, null) - } else { - var readUrl = fullUrl - read(readUrl, function(error, source) { - result.sourcesContent[index] = error ? error : String(source) - done() - }) - } - }) - } - - function resolveSourcesSync(map, mapUrl, read, options) { - var result = { - sourcesResolved: [], - sourcesContent: [] - } - - if (!map.sources || map.sources.length === 0) { - return result - } - - resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { - result.sourcesResolved[index] = fullUrl - if (read !== null) { - if (typeof sourceContent === "string") { - result.sourcesContent[index] = sourceContent - } else { - var readUrl = fullUrl - try { - result.sourcesContent[index] = String(read(readUrl)) - } catch (error) { - result.sourcesContent[index] = error - } - } - } - }) - - return result - } - - var endingSlash = /\/?$/ - - function resolveSourcesHelper(map, mapUrl, options, fn) { - options = options || {} - var fullUrl - var sourceContent - var sourceRoot - for (var index = 0, len = map.sources.length; index < len; index++) { - sourceRoot = null - if (typeof options.sourceRoot === "string") { - sourceRoot = options.sourceRoot - } else if (typeof map.sourceRoot === "string" && options.sourceRoot !== false) { - sourceRoot = map.sourceRoot - } - // If the sourceRoot is the empty string, it is equivalent to not setting - // the property at all. - if (sourceRoot === null || sourceRoot === '') { - fullUrl = resolveUrl(mapUrl, map.sources[index]) - } else { - // Make sure that the sourceRoot ends with a slash, so that `/scripts/subdir` becomes - // `/scripts/subdir/`, not `/scripts/`. Pointing to a file as source root - // does not make sense. - fullUrl = resolveUrl(mapUrl, sourceRoot.replace(endingSlash, "/"), map.sources[index]) - } - sourceContent = (map.sourcesContent || [])[index] - fn(fullUrl, sourceContent, index) - } - } - - - - function resolve(code, codeUrl, read, options, callback) { - if (typeof options === "function") { - callback = options - options = {} - } - if (code === null) { - var mapUrl = codeUrl - var data = { - sourceMappingURL: null, - url: mapUrl, - sourcesRelativeTo: mapUrl, - map: null - } - var readUrl = mapUrl - read(readUrl, function(error, result) { - if (error) { - error.sourceMapData = data - return callback(error) - } - data.map = String(result) - try { - data.map = parseMapToJSON(data.map, data) - } catch (error) { - return callback(error) - } - _resolveSources(data) - }) - } else { - resolveSourceMap(code, codeUrl, read, function(error, mapData) { - if (error) { - return callback(error) - } - if (!mapData) { - return callback(null, null) - } - _resolveSources(mapData) - }) - } - - function _resolveSources(mapData) { - resolveSources(mapData.map, mapData.sourcesRelativeTo, read, options, function(error, result) { - if (error) { - return callback(error) - } - mapData.sourcesResolved = result.sourcesResolved - mapData.sourcesContent = result.sourcesContent - callback(null, mapData) - }) - } - } - - function resolveSync(code, codeUrl, read, options) { - var mapData - if (code === null) { - var mapUrl = codeUrl - mapData = { - sourceMappingURL: null, - url: mapUrl, - sourcesRelativeTo: mapUrl, - map: null - } - mapData.map = readSync(read, mapUrl, mapData) - mapData.map = parseMapToJSON(mapData.map, mapData) - } else { - mapData = resolveSourceMapSync(code, codeUrl, read) - if (!mapData) { - return null - } - } - var result = resolveSourcesSync(mapData.map, mapData.sourcesRelativeTo, read, options) - mapData.sourcesResolved = result.sourcesResolved - mapData.sourcesContent = result.sourcesContent - return mapData - } - - - - return { - resolveSourceMap: resolveSourceMap, - resolveSourceMapSync: resolveSourceMapSync, - resolveSources: resolveSources, - resolveSourcesSync: resolveSourcesSync, - resolve: resolve, - resolveSync: resolveSync, - parseMapToJSON: parseMapToJSON - } - -})); diff --git a/source-map-resolve.js.template b/source-map-resolve.js.template deleted file mode 100644 index 413ab61..0000000 --- a/source-map-resolve.js.template +++ /dev/null @@ -1,19 +0,0 @@ -// Note: source-map-resolve.js is generated from source-map-resolve-node.js and -// source-map-resolve-template.js. Only edit the two latter files, _not_ -// source-map-resolve.js! - -void (function(root, factory) { - if (typeof define === "function" && define.amd) { - define(["source-map-url", "resolve-url"], factory) - } else if (typeof exports === "object") { - var sourceMappingURL = require("source-map-url") - var resolveUrl = require("resolve-url") - module.exports = factory(sourceMappingURL, resolveUrl) - } else { - root.sourceMapResolve = factory(root.sourceMappingURL, root.resolveUrl) - } -}(this, function(sourceMappingURL, resolveUrl) { - - {{source-map-resolve-node.js}} - -})); diff --git a/test/common.js b/test/common.js index b7fb30d..3416179 100644 --- a/test/common.js +++ b/test/common.js @@ -1,7 +1,19 @@ -function u(url) { +function u1(url) { return "code\n/*# sourceMappingURL=" + url + " */" } +function u2(url) { + return "code\n//# sourceMappingURL=" + url +} + +function u3(url) { + return "code\n/*\n# sourceMappingURL=" + url + "\n*/" +} + +function u4(url) { + return "code\n/*\n//# sourceMappingURL=" + url + "\n*/" +} + function read(x) { return function() { return x @@ -17,7 +29,10 @@ function identity(x) { } module.exports = { - u: u, + u1: u1, + u2: u2, + u3: u3, + u4: u4, read: read, Throws: Throws, identity: identity diff --git a/test/read.js b/test/read.js index 7c3cf07..e303630 100644 --- a/test/read.js +++ b/test/read.js @@ -1,7 +1,7 @@ var test = require("tape") var asyncify = require("simple-asyncify") var common = require("./common") -var u = common.u +var u1 = common.u1 var sourceMapResolve = require("../") @@ -35,7 +35,7 @@ function testResolveSourceMap(method, sync) { "built files/operators map.json": "{}" }) - method(u(mapUrl), codeUrl, read, function(error) { + method(u1(mapUrl), codeUrl, read, function(error) { t.error(error) }) @@ -90,7 +90,7 @@ function testResolve(method, sync) { "source files/operators:+-<>%.coffee": "source code" }) - method(u(mapUrl), codeUrl, read, function(error) { + method(u1(mapUrl), codeUrl, read, function(error) { t.error(error) }) diff --git a/test/source-map-resolve.js b/test/source-map-resolve.js index aa9dede..a66b83d 100644 --- a/test/source-map-resolve.js +++ b/test/source-map-resolve.js @@ -1,7 +1,10 @@ var test = require("tape") var asyncify = require("simple-asyncify") var common = require("./common") -var u = common.u +var u1 = common.u1 +var u2 = common.u2 +var u3 = common.u3 +var u4 = common.u4 var read = common.read var Throws = common.Throws var identity = common.identity @@ -70,30 +73,30 @@ map.simpleString = JSON.stringify(map.simple) map.XSSIsafe = ")]}'" + map.simpleString var code = { - fileRelative: u("foo.js.map"), - domainRelative: u("/foo.js.map"), - schemeRelative: u("//foo.org/foo.js.map"), - absolute: u("https://foo.org/foo.js.map"), - dataUri: u("data:application/json," + + fileRelative: u1("foo.js.map"), + domainRelative: u2("/foo.js.map"), + schemeRelative: u3("//foo.org/foo.js.map"), + absolute: u4("https://foo.org/foo.js.map"), + dataUri: u1("data:application/json," + "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), - base64: u("data:application/json;base64," + + base64: u2("data:application/json;base64," + "eyJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbImZvby5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyLkuK3mlofwn5iKIl0sIm5hbWVzIjpbXX0="), // jshint ignore:line - base64InvalidUtf8: u("data:application/json;base64,abc"), - dataUriText: u("data:text/json," + + base64InvalidUtf8: u3("data:application/json;base64,abc"), + dataUriText: u4("data:text/json," + "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), - dataUriParameter: u("data:application/json;charset=UTF-8;foo=bar," + + dataUriParameter: u1("data:application/json;charset=UTF-8;foo=bar," + "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), - dataUriNoMime: u("data:,foo"), - dataUriInvalidMime: u("data:text/html,foo"), - dataUriInvalidJSON: u("data:application/json,foo"), - dataUriInvalidCode: u("data:application/json,%"), - dataUriXSSIsafe: u("data:application/json," + ")%5D%7D%27" + + dataUriNoMime: u2("data:,foo"), + dataUriInvalidMime: u3("data:text/html,foo"), + dataUriInvalidJSON: u4("data:application/json,foo"), + dataUriInvalidCode: u1("data:application/json,%"), + dataUriXSSIsafe: u2("data:application/json," + ")%5D%7D%27" + "%7B%22mappings%22%3A%22AAAA%22%2C%22sources%22%3A%5B%22" + "foo.js%22%5D%2C%22names%22%3A%5B%5D%7D"), - dataUriEmpty: u("data:"), + dataUriEmpty: u3("data:"), noMap: "" } diff --git a/test/windows.js b/test/windows.js index 6b4e173..5c3219e 100644 --- a/test/windows.js +++ b/test/windows.js @@ -2,7 +2,9 @@ var path = require("path") var test = require("tape") var asyncify = require("simple-asyncify") var common = require("./common") -var u = common.u +var u1 = common.u1 +var u2 = common.u2 +var u3 = common.u3 var read = common.read var identity = common.identity @@ -26,7 +28,7 @@ function testResolveSourceMap(method, sync) { var map = {} var readMap = wrap(read(JSON.stringify(map))) - method(u("foo.js.map"), codeUrl, readMap, function(error, result) { + method(u1("foo.js.map"), codeUrl, readMap, function(error, result) { t.error(error) t.deepEqual(result, { sourceMappingURL: "foo.js.map", @@ -36,7 +38,7 @@ function testResolveSourceMap(method, sync) { }) }) - method(u("/foo.js.map"), codeUrl, readMap, function(error, result) { + method(u2("/foo.js.map"), codeUrl, readMap, function(error, result) { t.error(error) t.deepEqual(result, { sourceMappingURL: "/foo.js.map", @@ -46,7 +48,7 @@ function testResolveSourceMap(method, sync) { }) }) - method(u("../foo.js.map"), codeUrl, readMap, function(error, result) { + method(u3("../foo.js.map"), codeUrl, readMap, function(error, result) { t.error(error) t.deepEqual(result, { sourceMappingURL: "../foo.js.map", @@ -119,7 +121,7 @@ function testResolve(method, sync) { } var readMap = wrapMap(read(JSON.stringify(map)), identity) - method(u("foo.js.map"), codeUrl, readMap, function(error, result) { + method(u1("foo.js.map"), codeUrl, readMap, function(error, result) { t.error(error) t.deepEqual(result, { sourceMappingURL: "foo.js.map", @@ -131,7 +133,7 @@ function testResolve(method, sync) { }) }) - method(u("/foo.js.map"), codeUrl, readMap, function(error, result) { + method(u2("/foo.js.map"), codeUrl, readMap, function(error, result) { t.error(error) t.deepEqual(result, { sourceMappingURL: "/foo.js.map", @@ -143,7 +145,7 @@ function testResolve(method, sync) { }) }) - method(u("../foo.js.map"), codeUrl, readMap, function(error, result) { + method(u3("../foo.js.map"), codeUrl, readMap, function(error, result) { t.error(error) t.deepEqual(result, { sourceMappingURL: "../foo.js.map", diff --git a/x-package.json5 b/x-package.json5 deleted file mode 100644 index ff22ecb..0000000 --- a/x-package.json5 +++ /dev/null @@ -1,72 +0,0 @@ -{ - name: "source-map-resolve", - version: "0.5.3", - author: "Simon Lydell", - license: "MIT", - description: "Resolve the source map and/or sources for a generated file.", - keywords: [ - "source map", - "sourcemap", - "source", - "map", - "sourceMappingURL", - "resolve", - "resolver", - "locate", - "locator", - "find", - "finder" - ], - overlay: { - npm: { - repository: "lydell/source-map-resolve", - main: "lib/source-map-resolve-node.js", - browser: "source-map-resolve.js", - files: [ - "lib", - "source-map-resolve.js" - ], - scripts: { - lint: "jshint lib/ test/", - unit: "node test/source-map-resolve.js && node test/windows.js", - test: "npm run lint && npm run unit", - build: "node generate-source-map-resolve.js" - }, - dependencies: { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - }, - devDependencies: { - "Base64": "1.1.0", - "jshint": "2.10.3", - "setimmediate": "1.0.5", - "simple-asyncify": "1.0.0", - "tape": "4.12.1" - } - }, - component: { - repo: "lydell/source-map-resolve", - main: "source-map-resolve.js", - scripts: [ - "source-map-resolve.js" - ], - dependencies: { - "lydell/source-map-url": "~0.4.0", - "lydell/resolve-url": "~0.2.1" - } - }, - bower: { - authors: ["Simon Lydell"], - ignore: [ - ".*" - ], - dependencies: { - "source-map-url": "^0.4.0", - "resolve-url": "^0.2.1" - } - } - } -} From 71e9b9d470f51cf5b78778820afb0af2167a8a4d Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 22:41:24 +0100 Subject: [PATCH 12/16] Move to index.js --- lib/source-map-resolve-node.js => index.js | 0 package.json | 5 ++--- test/{source-map-resolve.js => index.js} | 0 3 files changed, 2 insertions(+), 3 deletions(-) rename lib/source-map-resolve-node.js => index.js (100%) rename test/{source-map-resolve.js => index.js} (100%) diff --git a/lib/source-map-resolve-node.js b/index.js similarity index 100% rename from lib/source-map-resolve-node.js rename to index.js diff --git a/package.json b/package.json index beac3e5..6063604 100644 --- a/package.json +++ b/package.json @@ -18,13 +18,12 @@ "finder" ], "repository": "lydell/source-map-resolve", - "main": "lib/source-map-resolve-node.js", "files": [ "lib" ], "scripts": { - "lint": "jshint lib/ test/", - "unit": "node test/source-map-resolve.js && node test/windows.js", + "lint": "jshint index.js test/", + "unit": "node test/index.js && node test/windows.js", "test": "npm run lint && npm run unit" }, "dependencies": { diff --git a/test/source-map-resolve.js b/test/index.js similarity index 100% rename from test/source-map-resolve.js rename to test/index.js From 2cf4e93e1e3953471cdc021fba053472c33f28fa Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 22:42:26 +0100 Subject: [PATCH 13/16] Actually run test/read.js --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6063604..b79a8a7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ ], "scripts": { "lint": "jshint index.js test/", - "unit": "node test/index.js && node test/windows.js", + "unit": "node test/index.js && node test/read.js && node test/windows.js", "test": "npm run lint && npm run unit" }, "dependencies": { From 19ce716f6c35af7024041cbe551d6f942326e2c6 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 22:44:37 +0100 Subject: [PATCH 14/16] Update copyright years --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2ae9757..789326f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019 Simon Lydell +Copyright (c) 2014, 2015, 2016, 2017, 2018, 2019, 2020 Simon Lydell Copyright (c) 2019 ZHAO Jinxiang Permission is hereby granted, free of charge, to any person obtaining a copy From a7444bb8897e57829312d2c3f31ae157c8c23ccc Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 23:22:12 +0100 Subject: [PATCH 15/16] Fix files in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b79a8a7..32e67fa 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ ], "repository": "lydell/source-map-resolve", "files": [ - "lib" + "index.js" ], "scripts": { "lint": "jshint index.js test/", From eeed61bac2e498ea5239c8162101b021f568b959 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 21 Mar 2020 23:22:48 +0100 Subject: [PATCH 16/16] source-map-resolve v0.6.0 --- changelog.md | 6 ++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 7b3f94b..80fe2e3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ +### Version 0.6.0 (2020-03-21) ### + +- Removed: The browser version. Only Node.js is now supported. +- Improved: Three old, weird, tiny dependencies were inlined, which should + decrease install size. + ### Version 0.5.3 (2019-12-28) ### - Fixed: base64 encoded source maps now correctly decodes as utf-8. Previously, diff --git a/package-lock.json b/package-lock.json index 1e13f8b..38683da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.3", + "version": "0.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 32e67fa..60200f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "source-map-resolve", - "version": "0.5.3", + "version": "0.6.0", "author": "Simon Lydell", "license": "MIT", "description": "Resolve the source map and/or sources for a generated file.",