diff --git a/build.prod.js b/build.prod.js index 334caa7..a130299 100644 --- a/build.prod.js +++ b/build.prod.js @@ -8,6 +8,7 @@ const scss = require('node-sass') const postcss = require('postcss') const autoprefixer = require('autoprefixer') const chalk = require('chalk') +const uglify = require('uglify-js') const sourceDir = path.resolve(__dirname, 'src') const buildDir = path.resolve(__dirname, 'dist') @@ -17,7 +18,7 @@ const prefixer = postcss().use( }) ) const jsOpt = { - presets: ['es2015', 'minify'], + presets: ['es2015'], plugins: [ 'transform-es2015-modules-amd', 'transform-decorators-legacy', @@ -39,7 +40,8 @@ const compileJs = (entry, output) => { if (/anot/.test(entry)) { tmpOpt = Object.assign({}, jsOpt, { plugins: [] }) } - const { code } = babel.transformFileSync(entry, tmpOpt) + let { code } = babel.transformFileSync(entry, tmpOpt) + code = uglify.minify(code).code log( '编译JS: %s, 耗时 %s ms', chalk.green(entry), @@ -82,7 +84,7 @@ const jsFiles = fs.ls('./src/js/', true) const cssFiles = fs.ls('./src/css/', true) if (fs.isdir(buildDir)) { - fs.rm(buildDir, true) + // fs.rm(buildDir, true) log(chalk.cyan('清除旧目录 dist/')) } diff --git a/package-lock.json b/package-lock.json index e90d0ea..2fdc6a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -112,16 +112,16 @@ "dev": true }, "autoprefixer": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.2.5.tgz", - "integrity": "sha512-XqHfo8Ht0VU+T5P+eWEVoXza456KJ4l62BPewu3vpNf3LP9s2+zYXkXBznzYby4XeECXgG3N4i+hGvOhXErZmA==", + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.2.6.tgz", + "integrity": "sha512-Iq8TRIB+/9eQ8rbGhcP7ct5cYb/3qjNYAR2SnzLCEcwF6rvVOax8+9+fccgXk4bEhQGjOZd5TLhsksmAdsbGqQ==", "dev": true, "requires": { "browserslist": "2.11.3", - "caniuse-lite": "1.0.30000792", + "caniuse-lite": "1.0.30000815", "normalize-range": "0.1.2", "num2fraction": "1.2.2", - "postcss": "6.0.16", + "postcss": "6.0.19", "postcss-value-parser": "3.3.0" } }, @@ -230,18 +230,6 @@ "lodash": "4.17.4" } }, - "babel-helper-evaluate-path": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.2.0.tgz", - "integrity": "sha512-0EK9TUKMxHL549hWDPkQoS7R0Ozg1CDLheVBHYds2B2qoAvmr9ejY3zOXFsrICK73TN7bPhU14PBeKc8jcBTwg==", - "dev": true - }, - "babel-helper-flip-expressions": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.2.0.tgz", - "integrity": "sha512-rAsPA1pWBc7e2E6HepkP2e1sXugT+Oq/VCqhyuHJ8aJ2d/ifwnJfd4Qxjm21qlW43AN8tqaeByagKK6wECFMSw==", - "dev": true - }, "babel-helper-function-name": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", @@ -275,24 +263,6 @@ "babel-types": "6.26.0" } }, - "babel-helper-is-nodes-equiv": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", - "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", - "dev": true - }, - "babel-helper-is-void-0": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.2.0.tgz", - "integrity": "sha512-Axj1AYuD0E3Dl7nT3KxROP7VekEofz3XtEljzURf3fABalLpr8PamtgLFt+zuxtaCxRf9iuZmbAMMYWri5Bazw==", - "dev": true - }, - "babel-helper-mark-eval-scopes": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.2.0.tgz", - "integrity": "sha512-KJuwrOUcHbvbh6he4xRXZFLaivK9DF9o3CrvpWnK1Wp0B+1ANYABXBMgwrnNFIDK/AvicxQ9CNr8wsgivlp4Aw==", - "dev": true - }, "babel-helper-optimise-call-expression": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", @@ -314,12 +284,6 @@ "lodash": "4.17.4" } }, - "babel-helper-remove-or-void": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.2.0.tgz", - "integrity": "sha512-1Z41upf/XR+PwY7Nd+F15Jo5BiQi5205ZXUuKed3yoyQgDkMyoM7vAdjEJS/T+M6jy32sXjskMUgms4zeiVtRA==", - "dev": true - }, "babel-helper-replace-supers": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", @@ -334,12 +298,6 @@ "babel-types": "6.26.0" } }, - "babel-helper-to-multiple-sequence-expressions": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.2.0.tgz", - "integrity": "sha512-ij9lpfdP3+Zc/7kNwa+NXbTrUlsYEWPwt/ugmQO0qflzLrveTIkbfOqQztvitk81aG5NblYDQXDlRohzu3oa8Q==", - "dev": true - }, "babel-helpers": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", @@ -368,101 +326,6 @@ "babel-runtime": "6.26.0" } }, - "babel-plugin-minify-builtins": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.2.0.tgz", - "integrity": "sha512-4i+8ntaS8gwVUcOz5y+zE+55OVOl2nTbmHV51D4wAIiKcRI8U5K//ip1GHfhsgk/NJrrHK7h97Oy5jpqt0Iixg==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "0.2.0" - } - }, - "babel-plugin-minify-constant-folding": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.2.0.tgz", - "integrity": "sha512-B3ffQBEUQ8ydlIkYv2MkZtTCbV7FAkWAV7NkyhcXlGpD10PaCxNGQ/B9oguXGowR1m16Q5nGhvNn8Pkn1MO6Hw==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "0.2.0" - } - }, - "babel-plugin-minify-dead-code-elimination": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.2.0.tgz", - "integrity": "sha512-zE7y3pRyzA4zK5nBou0kTcwUTSQ/AiFrynt1cIEYN7vcO2gS9ZFZoI0aO9JYLUdct5fsC1vfB35408yrzTyVfg==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "0.2.0", - "babel-helper-mark-eval-scopes": "0.2.0", - "babel-helper-remove-or-void": "0.2.0", - "lodash.some": "4.6.0" - } - }, - "babel-plugin-minify-flip-comparisons": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.2.0.tgz", - "integrity": "sha512-QOqXSEmD/LhT3LpM1WCyzAGcQZYYKJF7oOHvS6QbpomHenydrV53DMdPX2mK01icBExKZcJAHF209wvDBa+CSg==", - "dev": true, - "requires": { - "babel-helper-is-void-0": "0.2.0" - } - }, - "babel-plugin-minify-guarded-expressions": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.2.0.tgz", - "integrity": "sha512-5+NSPdRQ9mnrHaA+zFj+D5OzmSiv90EX5zGH6cWQgR/OUqmCHSDqgTRPFvOctgpo8MJyO7Rt7ajs2UfLnlAwYg==", - "dev": true, - "requires": { - "babel-helper-flip-expressions": "0.2.0" - } - }, - "babel-plugin-minify-infinity": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.2.0.tgz", - "integrity": "sha512-U694vrla1lN6vDHWGrR832t3a/A2eh+kyl019LxEE2+sS4VTydyOPRsAOIYAdJegWRA4cMX1lm9azAN0cLIr8g==", - "dev": true - }, - "babel-plugin-minify-mangle-names": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.2.0.tgz", - "integrity": "sha512-Gixuak1/CO7VCdjn15/8Bxe/QsAtDG4zPbnsNoe1mIJGCIH/kcmSjFhMlGJtXDQZd6EKzeMfA5WmX9+jvGRefw==", - "dev": true, - "requires": { - "babel-helper-mark-eval-scopes": "0.2.0" - } - }, - "babel-plugin-minify-numeric-literals": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.2.0.tgz", - "integrity": "sha512-VcLpb+r1YS7+RIOXdRsFVLLqoh22177USpHf+JM/g1nZbzdqENmfd5v534MLAbRErhbz6SyK+NQViVzVtBxu8g==", - "dev": true - }, - "babel-plugin-minify-replace": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.2.0.tgz", - "integrity": "sha512-SEW6zoSVxh3OH6E1LCgyhhTWMnCv+JIRu5h5IlJDA11tU4ZeSF7uPQcO4vN/o52+FssRB26dmzJ/8D+z0QPg5Q==", - "dev": true - }, - "babel-plugin-minify-simplify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.2.0.tgz", - "integrity": "sha512-Mj3Mwy2zVosMfXDWXZrQH5/uMAyfJdmDQ1NVqit+ArbHC3LlXVzptuyC1JxTyai/wgFvjLaichm/7vSUshkWqw==", - "dev": true, - "requires": { - "babel-helper-flip-expressions": "0.2.0", - "babel-helper-is-nodes-equiv": "0.0.1", - "babel-helper-to-multiple-sequence-expressions": "0.2.0" - } - }, - "babel-plugin-minify-type-constructors": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.2.0.tgz", - "integrity": "sha512-NiOvvA9Pq6bki6nP4BayXwT5GZadw7DJFDDzHmkpnOQpENWe8RtHtKZM44MG1R6EQ5XxgbLdsdhswIzTkFlO5g==", - "dev": true, - "requires": { - "babel-helper-is-void-0": "0.2.0" - } - }, "babel-plugin-syntax-class-properties": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", @@ -738,30 +601,6 @@ "regexpu-core": "2.0.0" } }, - "babel-plugin-transform-inline-consecutive-adds": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.2.0.tgz", - "integrity": "sha512-GlhOuLOQ28ua9prg0hT33HslCrEmz9xWXy9ZNZSACppCyRxxRW+haYtRgm7uYXCcd0q8ggCWD2pfWEJp5iiZfQ==", - "dev": true - }, - "babel-plugin-transform-member-expression-literals": { - "version": "6.8.5", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.8.5.tgz", - "integrity": "sha512-Ux3ligf+ukzWaCbBYOstDuFBhRgMiJHlpJBKV4P47qtzVkd0lg1ddPj9fqIJqAM0n+CvxipyrZrnNnw3CdtQCg==", - "dev": true - }, - "babel-plugin-transform-merge-sibling-variables": { - "version": "6.8.6", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.8.6.tgz", - "integrity": "sha512-o5Jioq553HtEAUN5uty7ELJMenXIxHI3PIs1yLqYWYQwP6mg6IPVAJ+U7i4zr9XGF/kb2RGsdehglGTV+vngqA==", - "dev": true - }, - "babel-plugin-transform-minify-booleans": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.8.3.tgz", - "integrity": "sha512-bPbUhkeN2Nc0KH0/A19GwQGj8w+CvdJzyu8t59VoEDgsNMQ9Bopzi5DrVkrSsVjbYUaZpzq/DYLrH+wD5K2Tig==", - "dev": true - }, "babel-plugin-transform-object-rest-spread": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", @@ -772,15 +611,6 @@ "babel-runtime": "6.26.0" } }, - "babel-plugin-transform-property-literals": { - "version": "6.8.5", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.8.5.tgz", - "integrity": "sha512-MmiQsQ5AcIaRZMJD0zY5C4H3xuHm06/nWgtOsz7AXV44VEIXIlPiJ39IFYJ4Qx67/fEm8zJAedzR8t+B7d10Bg==", - "dev": true, - "requires": { - "esutils": "2.0.2" - } - }, "babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", @@ -790,39 +620,6 @@ "regenerator-transform": "0.10.1" } }, - "babel-plugin-transform-regexp-constructors": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.2.0.tgz", - "integrity": "sha512-7IsQ6aQx6LAaOqy97/PthTf+5Nx9grZww3r6E62IdWe76Yr8KsuwVjxzqSPQvESJqTE3EMADQ9S0RtwWDGNG9Q==", - "dev": true - }, - "babel-plugin-transform-remove-console": { - "version": "6.8.5", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.8.5.tgz", - "integrity": "sha512-uuCKvtweCyIvvC8fi92EcWRtO2Kt5KMNMRK6BhpDXdeb3sxvGM7453RSmgeu4DlKns3OlvY9Ep5Q9m5a7RQAgg==", - "dev": true - }, - "babel-plugin-transform-remove-debugger": { - "version": "6.8.5", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.8.5.tgz", - "integrity": "sha512-InDQDdHPOLJKM+G6oXrEesf+P29QFBmcTXID+TAvZziVz+38xe2VO/Bn3FcRcRtnOOycbgsJkUNp9jIK+ist6g==", - "dev": true - }, - "babel-plugin-transform-remove-undefined": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.2.0.tgz", - "integrity": "sha512-O8v57tPMHkp89kA4ZfQEYds/pzgvz/QYerBJjIuL5/Jc7RnvMVRA5gJY9zFKP7WayW8WOSBV4vh8Y8FJRio+ow==", - "dev": true, - "requires": { - "babel-helper-evaluate-path": "0.2.0" - } - }, - "babel-plugin-transform-simplify-comparison-operators": { - "version": "6.8.5", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.8.5.tgz", - "integrity": "sha512-B3HlBZb+Uq86nRj5yNPO6pJ3noEdqHvzYkEYoUWtrsWTv48ZIRatYlumoOiif/v8llF13YjYjx9zhyznDx+N9g==", - "dev": true - }, "babel-plugin-transform-strict-mode": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", @@ -833,12 +630,6 @@ "babel-types": "6.26.0" } }, - "babel-plugin-transform-undefined-to-void": { - "version": "6.8.3", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.8.3.tgz", - "integrity": "sha512-goYwp8dMrzHD6x9GjZ2M85Mk2vxf1h85CnUgAjfftUnlJvzF4uj5MrbReHBTbjQ96C8CuRzvhYZ3tv8H3Sc1ZA==", - "dev": true - }, "babel-preset-es2015": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", @@ -871,37 +662,6 @@ "babel-plugin-transform-regenerator": "6.26.0" } }, - "babel-preset-minify": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.2.0.tgz", - "integrity": "sha512-mR8Q44RmMzm18bM2Lqd9uiPopzk5GDCtVuquNbLFmX6lOKnqWoenaNBxnWW0UhBFC75lEHTIgNGCbnsRI0pJVw==", - "dev": true, - "requires": { - "babel-plugin-minify-builtins": "0.2.0", - "babel-plugin-minify-constant-folding": "0.2.0", - "babel-plugin-minify-dead-code-elimination": "0.2.0", - "babel-plugin-minify-flip-comparisons": "0.2.0", - "babel-plugin-minify-guarded-expressions": "0.2.0", - "babel-plugin-minify-infinity": "0.2.0", - "babel-plugin-minify-mangle-names": "0.2.0", - "babel-plugin-minify-numeric-literals": "0.2.0", - "babel-plugin-minify-replace": "0.2.0", - "babel-plugin-minify-simplify": "0.2.0", - "babel-plugin-minify-type-constructors": "0.2.0", - "babel-plugin-transform-inline-consecutive-adds": "0.2.0", - "babel-plugin-transform-member-expression-literals": "6.8.5", - "babel-plugin-transform-merge-sibling-variables": "6.8.6", - "babel-plugin-transform-minify-booleans": "6.8.3", - "babel-plugin-transform-property-literals": "6.8.5", - "babel-plugin-transform-regexp-constructors": "0.2.0", - "babel-plugin-transform-remove-console": "6.8.5", - "babel-plugin-transform-remove-debugger": "6.8.5", - "babel-plugin-transform-remove-undefined": "0.2.0", - "babel-plugin-transform-simplify-comparison-operators": "6.8.5", - "babel-plugin-transform-undefined-to-void": "6.8.3", - "lodash.isplainobject": "4.0.6" - } - }, "babel-register": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", @@ -1042,8 +802,8 @@ "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", "dev": true, "requires": { - "caniuse-lite": "1.0.30000792", - "electron-to-chromium": "1.3.31" + "caniuse-lite": "1.0.30000815", + "electron-to-chromium": "1.3.38" } }, "builtin-modules": { @@ -1069,9 +829,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000792", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000792.tgz", - "integrity": "sha1-0M6pgfgRjzlhRxr7tDyaHlu/AzI=", + "version": "1.0.30000815", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000815.tgz", + "integrity": "sha512-PGSOPK6gFe5fWd+eD0u2bG0aOsN1qC4B1E66tl3jOsIoKkTIcBYAc2+O6AeNzKW8RsFykWgnhkTlfOyuTzgI9A==", "dev": true }, "caseless": { @@ -1081,32 +841,32 @@ "dev": true }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.3.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -1161,18 +921,18 @@ "dev": true }, "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { "delayed-stream": "1.0.0" } }, "commander": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", - "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.0.tgz", + "integrity": "sha512-7B1ilBwtYSbetCgTY1NJFg+gVpestg0fdA1MhC1Vs4ssyfSXnCAjFr+QcQM9/RedXC0EaUx1sG8Smgw2VfgKEg==", "dev": true }, "concat-map": { @@ -1211,7 +971,7 @@ "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "which": "1.3.0" } }, @@ -1297,9 +1057,9 @@ } }, "electron-to-chromium": { - "version": "1.3.31", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz", - "integrity": "sha512-XE4CLbswkZgZFn34cKFy1xaX+F5LHxeDLjY1+rsK9asDzknhbrd9g/n/01/acbU25KTsUSiLKwvlLyA+6XLUOA==", + "version": "1.3.38", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.38.tgz", + "integrity": "sha1-SSNLAMBZL2KSH5QmvM7+4j3ghrs=", "dev": true }, "error-ex": { @@ -1419,8 +1179,8 @@ "dev": true, "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" + "combined-stream": "1.0.6", + "mime-types": "2.1.18" } }, "fs.realpath": { @@ -2477,8 +2237,8 @@ "dev": true, "requires": { "chalk": "1.1.3", - "commander": "2.12.2", - "is-my-json-valid": "2.17.1", + "commander": "2.15.0", + "is-my-json-valid": "2.17.2", "pinkie-promise": "2.0.1" }, "dependencies": { @@ -2507,9 +2267,9 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "has-unicode": { @@ -2547,9 +2307,9 @@ } }, "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", "dev": true }, "http-signature": { @@ -2560,7 +2320,7 @@ "requires": { "assert-plus": "0.2.0", "jsprim": "1.4.1", - "sshpk": "1.13.1" + "sshpk": "1.14.1" } }, "in-publish": { @@ -2699,14 +2459,21 @@ "is-extglob": "1.0.0" } }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, "is-my-json-valid": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz", - "integrity": "sha512-Q2khNw+oBlWuaYvEEHtKSw/pCxD2L5Rc1C+UQme9X6JdRDh7m5D7HkozA0qa3DUkQ6VzCnEm8mVIQPyIRkI5sQ==", + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", "dev": true, "requires": { "generate-function": "2.0.0", "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", "jsonpointer": "4.0.1", "xtend": "4.0.1" } @@ -2778,9 +2545,9 @@ "dev": true }, "js-base64": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.0.tgz", - "integrity": "sha512-Wehd+7Pf9tFvGb+ydPm9TjYjV8X1YHOVyG8QyELZxEMqOhemVwGRmoG8iQ/soqI3n8v4xn59zaLxiCJiaaRzKA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", + "integrity": "sha512-H7ErYLM34CvDMto3GbD6xD0JLUGYXR3QTcH6B/tr4Hi/QpSThnCsIp+Sy5FRTw3B0d6py4HcNkW7nO/wdtGWEw==", "dev": true }, "js-tokens": { @@ -2895,22 +2662,10 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, "lodash.mergewith": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz", - "integrity": "sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU=", - "dev": true - }, - "lodash.some": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", - "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", + "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", "dev": true }, "loose-envify": { @@ -2933,9 +2688,9 @@ } }, "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", + "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -2996,18 +2751,18 @@ } }, "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", "dev": true }, "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "dev": true, "requires": { - "mime-db": "1.30.0" + "mime-db": "1.33.0" } }, "minimatch": { @@ -3044,7 +2799,8 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", - "dev": true + "dev": true, + "optional": true }, "node-gyp": { "version": "3.6.2", @@ -3059,7 +2815,7 @@ "mkdirp": "0.5.1", "nopt": "3.0.6", "npmlog": "4.1.2", - "osenv": "0.1.4", + "osenv": "0.1.5", "request": "2.79.0", "rimraf": "2.6.2", "semver": "5.3.0", @@ -3076,9 +2832,9 @@ } }, "node-sass": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.7.2.tgz", - "integrity": "sha512-CaV+wLqZ7//Jdom5aUFCpGNoECd7BbNhjuwdsX/LkXBrHl8eb1Wjw4HvWqcFvhr5KuNgAk8i/myf/MQ1YYeroA==", + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.8.2.tgz", + "integrity": "sha512-YQ9eAgtcSIqMGZO5BCIJRd/XCIz6cQuc8pChE3ZW0ANn2Yz0f2G0M6yqVg/1hXopScbJsmcyVt4ar7fJCmeldw==", "dev": true, "requires": { "async-foreach": "0.1.3", @@ -3090,10 +2846,10 @@ "in-publish": "2.0.0", "lodash.assign": "4.2.0", "lodash.clonedeep": "4.5.0", - "lodash.mergewith": "4.6.0", + "lodash.mergewith": "4.6.1", "meow": "3.7.0", "mkdirp": "0.5.1", - "nan": "2.8.0", + "nan": "2.9.2", "node-gyp": "3.6.2", "npmlog": "4.1.2", "request": "2.79.0", @@ -3114,6 +2870,12 @@ "strip-ansi": "3.0.1", "supports-color": "2.0.0" } + }, + "nan": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", + "integrity": "sha512-ltW65co7f3PQWBDbqVvaU1WtFJUsNW7sWWm4HINhbMQIyVyzIeyZ8toX5TC5eeooE6piZoaEh4cZkueSKG3KYw==", + "dev": true } } }, @@ -3132,10 +2894,10 @@ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.5.0", + "hosted-git-info": "2.6.0", "is-builtin-module": "1.0.0", - "semver": "5.4.1", - "validate-npm-package-license": "3.0.1" + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" } }, "normalize-path": { @@ -3230,9 +2992,9 @@ "dev": true }, "osenv": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "requires": { "os-homedir": "1.0.2", @@ -3308,14 +3070,14 @@ } }, "postcss": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.16.tgz", - "integrity": "sha512-m758RWPmSjFH/2MyyG3UOW1fgYbR9rtdzz5UNJnlm7OLtu4B2h9C6gi+bE4qFKghsBRFfZT8NzoQBs6JhLotoA==", + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", + "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.2", "source-map": "0.6.1", - "supports-color": "5.1.0" + "supports-color": "5.3.0" }, "dependencies": { "source-map": { @@ -3325,12 +3087,12 @@ "dev": true }, "supports-color": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.1.0.tgz", - "integrity": "sha512-Ry0AwkoKjDpVKK4sV4h6o3UJmNRbjYm2uXhwfj3J56lMVdvnUNqzQVRztOOMGQ++w1K/TjNDFvpJk0F/LoeBCQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -3578,7 +3340,7 @@ "aws-sign2": "0.6.0", "aws4": "1.6.0", "caseless": "0.11.0", - "combined-stream": "1.0.5", + "combined-stream": "1.0.6", "extend": "3.0.1", "forever-agent": "0.6.1", "form-data": "2.1.4", @@ -3588,13 +3350,13 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", + "mime-types": "2.1.18", "oauth-sign": "0.8.2", "qs": "6.3.2", "stringstream": "0.0.5", - "tough-cookie": "2.3.3", + "tough-cookie": "2.3.4", "tunnel-agent": "0.4.3", - "uuid": "3.1.0" + "uuid": "3.2.1" } }, "require-directory": { @@ -3642,7 +3404,7 @@ "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", "dev": true, "requires": { - "js-base64": "2.4.0", + "js-base64": "2.4.3", "source-map": "0.4.4" }, "dependencies": { @@ -3658,9 +3420,9 @@ } }, "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "set-blocking": { @@ -3712,30 +3474,41 @@ } }, "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-license-ids": "1.2.2" + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "dev": true, "requires": { "asn1": "0.2.3", @@ -3842,9 +3615,9 @@ "dev": true }, "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { "punycode": "1.4.1" @@ -3899,6 +3672,24 @@ "dev": true, "optional": true }, + "uglify-js": { + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.15.tgz", + "integrity": "sha512-bqtBCAINYXX/OkdnqMGpbXr+OPWc00hsozRpk+dAtfnbdk2jjKiLmyOkQ7zamg648lVMnzATL8JrSN6LmaVpYA==", + "dev": true, + "requires": { + "commander": "2.15.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -3906,19 +3697,19 @@ "dev": true }, "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", "dev": true }, "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" } }, "verror": { diff --git a/package.json b/package.json index 66403d5..23fe8e7 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,18 @@ "author": "yutent", "license": "MIT", "devDependencies": { - "autoprefixer": "^7.2.5", + "autoprefixer": "^7.2.6", "babel-core": "^6.26.0", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-es2015": "^6.24.1", - "babel-preset-minify": "^0.2.0", - "chalk": "^2.3.0", + "chalk": "^2.3.2", "chokidar": "^1.7.0", "iofs": "^1.0.3", - "node-sass": "^4.7.2", - "postcss": "^6.0.16" - } + "node-sass": "^4.8.2", + "postcss": "^6.0.19", + "uglify-js": "^3.3.15" + }, + "dependencies": {} } diff --git a/src/js/anot.shim.js b/src/js/anot.shim.js index 611f4c7..f1abb0f 100644 --- a/src/js/anot.shim.js +++ b/src/js/anot.shim.js @@ -1543,7 +1543,6 @@ $vmodel.mounted = mounted if (old && old.$up) { - log(old.$up) old.$up.$children.push($vmodel) } @@ -2952,7 +2951,7 @@ "'use strict';\ntry{\nvar " + assigns.join(',\n') + expr + - '\n}catch(e){log(e)}' + '\n}catch(e){console.log(e)}' ) ) /* jshint ignore:end */ diff --git a/src/js/md5/Readme.md b/src/js/md5/Readme.md index 65226be..7e27c8e 100644 --- a/src/js/md5/Readme.md +++ b/src/js/md5/Readme.md @@ -1,27 +1,25 @@ # md5 加密组件 -可对普通字符串和文件计算其对应的md5值。 - - -组件符合AMD规范, 可使用require引入 +可对普通字符串和文件计算其对应的 md5 值。 +组件符合 AMD 规范, 可使用 require 引入 ### demo: ```javascript -require(['./md5/main'], function(SparkMD5){ - var Spark = new SparkMD5() - var md5 = function(cont){ - return Spark.sign.call(Spark, cont) - } - +require(['./md5/main'], function(spark){ + + var md5 = function(buf){ + spark.appendBinary(buf) + return spark.end() + } + var file = /*...*/ //文件表单获取 var fs = new FileReader() // Chrome, IE9+, FF, Safari fs.readAsBinaryString(file) fs.onload = function(){ // 计算该文件的md5签名 - var sign = md5(this.result) + var sign = md5(this.result) } }) ``` - diff --git a/src/js/md5/index.js b/src/js/md5/index.js new file mode 100644 index 0000000..28663a5 --- /dev/null +++ b/src/js/md5/index.js @@ -0,0 +1,751 @@ +/* + * Fastest md5 implementation around (JKM md5). + * Credits: Joseph Myers + * + * @see http://www.myersdaily.org/joseph/javascript/md5-text.html + * @see http://jsperf.com/md5-shootout/7 + */ + +/* this function is much faster, + so if possible we use it. Some IEs + are the only ones I know of that + need the idiotic second function, + generated by an if clause. */ +var add32 = function(a, b) { + return (a + b) & 0xffffffff + }, + hex_chr = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f' + ] + +function cmn(q, a, b, x, s, t) { + a = add32(add32(a, q), add32(x, t)) + return add32((a << s) | (a >>> (32 - s)), b) +} + +function md5cycle(x, k) { + var a = x[0], + b = x[1], + c = x[2], + d = x[3] + + a += (((b & c) | (~b & d)) + k[0] - 680876936) | 0 + a = (((a << 7) | (a >>> 25)) + b) | 0 + d += (((a & b) | (~a & c)) + k[1] - 389564586) | 0 + d = (((d << 12) | (d >>> 20)) + a) | 0 + c += (((d & a) | (~d & b)) + k[2] + 606105819) | 0 + c = (((c << 17) | (c >>> 15)) + d) | 0 + b += (((c & d) | (~c & a)) + k[3] - 1044525330) | 0 + b = (((b << 22) | (b >>> 10)) + c) | 0 + a += (((b & c) | (~b & d)) + k[4] - 176418897) | 0 + a = (((a << 7) | (a >>> 25)) + b) | 0 + d += (((a & b) | (~a & c)) + k[5] + 1200080426) | 0 + d = (((d << 12) | (d >>> 20)) + a) | 0 + c += (((d & a) | (~d & b)) + k[6] - 1473231341) | 0 + c = (((c << 17) | (c >>> 15)) + d) | 0 + b += (((c & d) | (~c & a)) + k[7] - 45705983) | 0 + b = (((b << 22) | (b >>> 10)) + c) | 0 + a += (((b & c) | (~b & d)) + k[8] + 1770035416) | 0 + a = (((a << 7) | (a >>> 25)) + b) | 0 + d += (((a & b) | (~a & c)) + k[9] - 1958414417) | 0 + d = (((d << 12) | (d >>> 20)) + a) | 0 + c += (((d & a) | (~d & b)) + k[10] - 42063) | 0 + c = (((c << 17) | (c >>> 15)) + d) | 0 + b += (((c & d) | (~c & a)) + k[11] - 1990404162) | 0 + b = (((b << 22) | (b >>> 10)) + c) | 0 + a += (((b & c) | (~b & d)) + k[12] + 1804603682) | 0 + a = (((a << 7) | (a >>> 25)) + b) | 0 + d += (((a & b) | (~a & c)) + k[13] - 40341101) | 0 + d = (((d << 12) | (d >>> 20)) + a) | 0 + c += (((d & a) | (~d & b)) + k[14] - 1502002290) | 0 + c = (((c << 17) | (c >>> 15)) + d) | 0 + b += (((c & d) | (~c & a)) + k[15] + 1236535329) | 0 + b = (((b << 22) | (b >>> 10)) + c) | 0 + + a += (((b & d) | (c & ~d)) + k[1] - 165796510) | 0 + a = (((a << 5) | (a >>> 27)) + b) | 0 + d += (((a & c) | (b & ~c)) + k[6] - 1069501632) | 0 + d = (((d << 9) | (d >>> 23)) + a) | 0 + c += (((d & b) | (a & ~b)) + k[11] + 643717713) | 0 + c = (((c << 14) | (c >>> 18)) + d) | 0 + b += (((c & a) | (d & ~a)) + k[0] - 373897302) | 0 + b = (((b << 20) | (b >>> 12)) + c) | 0 + a += (((b & d) | (c & ~d)) + k[5] - 701558691) | 0 + a = (((a << 5) | (a >>> 27)) + b) | 0 + d += (((a & c) | (b & ~c)) + k[10] + 38016083) | 0 + d = (((d << 9) | (d >>> 23)) + a) | 0 + c += (((d & b) | (a & ~b)) + k[15] - 660478335) | 0 + c = (((c << 14) | (c >>> 18)) + d) | 0 + b += (((c & a) | (d & ~a)) + k[4] - 405537848) | 0 + b = (((b << 20) | (b >>> 12)) + c) | 0 + a += (((b & d) | (c & ~d)) + k[9] + 568446438) | 0 + a = (((a << 5) | (a >>> 27)) + b) | 0 + d += (((a & c) | (b & ~c)) + k[14] - 1019803690) | 0 + d = (((d << 9) | (d >>> 23)) + a) | 0 + c += (((d & b) | (a & ~b)) + k[3] - 187363961) | 0 + c = (((c << 14) | (c >>> 18)) + d) | 0 + b += (((c & a) | (d & ~a)) + k[8] + 1163531501) | 0 + b = (((b << 20) | (b >>> 12)) + c) | 0 + a += (((b & d) | (c & ~d)) + k[13] - 1444681467) | 0 + a = (((a << 5) | (a >>> 27)) + b) | 0 + d += (((a & c) | (b & ~c)) + k[2] - 51403784) | 0 + d = (((d << 9) | (d >>> 23)) + a) | 0 + c += (((d & b) | (a & ~b)) + k[7] + 1735328473) | 0 + c = (((c << 14) | (c >>> 18)) + d) | 0 + b += (((c & a) | (d & ~a)) + k[12] - 1926607734) | 0 + b = (((b << 20) | (b >>> 12)) + c) | 0 + + a += ((b ^ c ^ d) + k[5] - 378558) | 0 + a = (((a << 4) | (a >>> 28)) + b) | 0 + d += ((a ^ b ^ c) + k[8] - 2022574463) | 0 + d = (((d << 11) | (d >>> 21)) + a) | 0 + c += ((d ^ a ^ b) + k[11] + 1839030562) | 0 + c = (((c << 16) | (c >>> 16)) + d) | 0 + b += ((c ^ d ^ a) + k[14] - 35309556) | 0 + b = (((b << 23) | (b >>> 9)) + c) | 0 + a += ((b ^ c ^ d) + k[1] - 1530992060) | 0 + a = (((a << 4) | (a >>> 28)) + b) | 0 + d += ((a ^ b ^ c) + k[4] + 1272893353) | 0 + d = (((d << 11) | (d >>> 21)) + a) | 0 + c += ((d ^ a ^ b) + k[7] - 155497632) | 0 + c = (((c << 16) | (c >>> 16)) + d) | 0 + b += ((c ^ d ^ a) + k[10] - 1094730640) | 0 + b = (((b << 23) | (b >>> 9)) + c) | 0 + a += ((b ^ c ^ d) + k[13] + 681279174) | 0 + a = (((a << 4) | (a >>> 28)) + b) | 0 + d += ((a ^ b ^ c) + k[0] - 358537222) | 0 + d = (((d << 11) | (d >>> 21)) + a) | 0 + c += ((d ^ a ^ b) + k[3] - 722521979) | 0 + c = (((c << 16) | (c >>> 16)) + d) | 0 + b += ((c ^ d ^ a) + k[6] + 76029189) | 0 + b = (((b << 23) | (b >>> 9)) + c) | 0 + a += ((b ^ c ^ d) + k[9] - 640364487) | 0 + a = (((a << 4) | (a >>> 28)) + b) | 0 + d += ((a ^ b ^ c) + k[12] - 421815835) | 0 + d = (((d << 11) | (d >>> 21)) + a) | 0 + c += ((d ^ a ^ b) + k[15] + 530742520) | 0 + c = (((c << 16) | (c >>> 16)) + d) | 0 + b += ((c ^ d ^ a) + k[2] - 995338651) | 0 + b = (((b << 23) | (b >>> 9)) + c) | 0 + + a += ((c ^ (b | ~d)) + k[0] - 198630844) | 0 + a = (((a << 6) | (a >>> 26)) + b) | 0 + d += ((b ^ (a | ~c)) + k[7] + 1126891415) | 0 + d = (((d << 10) | (d >>> 22)) + a) | 0 + c += ((a ^ (d | ~b)) + k[14] - 1416354905) | 0 + c = (((c << 15) | (c >>> 17)) + d) | 0 + b += ((d ^ (c | ~a)) + k[5] - 57434055) | 0 + b = (((b << 21) | (b >>> 11)) + c) | 0 + a += ((c ^ (b | ~d)) + k[12] + 1700485571) | 0 + a = (((a << 6) | (a >>> 26)) + b) | 0 + d += ((b ^ (a | ~c)) + k[3] - 1894986606) | 0 + d = (((d << 10) | (d >>> 22)) + a) | 0 + c += ((a ^ (d | ~b)) + k[10] - 1051523) | 0 + c = (((c << 15) | (c >>> 17)) + d) | 0 + b += ((d ^ (c | ~a)) + k[1] - 2054922799) | 0 + b = (((b << 21) | (b >>> 11)) + c) | 0 + a += ((c ^ (b | ~d)) + k[8] + 1873313359) | 0 + a = (((a << 6) | (a >>> 26)) + b) | 0 + d += ((b ^ (a | ~c)) + k[15] - 30611744) | 0 + d = (((d << 10) | (d >>> 22)) + a) | 0 + c += ((a ^ (d | ~b)) + k[6] - 1560198380) | 0 + c = (((c << 15) | (c >>> 17)) + d) | 0 + b += ((d ^ (c | ~a)) + k[13] + 1309151649) | 0 + b = (((b << 21) | (b >>> 11)) + c) | 0 + a += ((c ^ (b | ~d)) + k[4] - 145523070) | 0 + a = (((a << 6) | (a >>> 26)) + b) | 0 + d += ((b ^ (a | ~c)) + k[11] - 1120210379) | 0 + d = (((d << 10) | (d >>> 22)) + a) | 0 + c += ((a ^ (d | ~b)) + k[2] + 718787259) | 0 + c = (((c << 15) | (c >>> 17)) + d) | 0 + b += ((d ^ (c | ~a)) + k[9] - 343485551) | 0 + b = (((b << 21) | (b >>> 11)) + c) | 0 + + x[0] = (a + x[0]) | 0 + x[1] = (b + x[1]) | 0 + x[2] = (c + x[2]) | 0 + x[3] = (d + x[3]) | 0 +} + +function md5blk(s) { + var md5blks = [], + i /* Andy King said do it this way. */ + + for (i = 0; i < 64; i += 4) { + md5blks[i >> 2] = + s.charCodeAt(i) + + (s.charCodeAt(i + 1) << 8) + + (s.charCodeAt(i + 2) << 16) + + (s.charCodeAt(i + 3) << 24) + } + return md5blks +} + +function md5blk_array(a) { + var md5blks = [], + i /* Andy King said do it this way. */ + + for (i = 0; i < 64; i += 4) { + md5blks[i >> 2] = + a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24) + } + return md5blks +} + +function md51(s) { + var n = s.length, + state = [1732584193, -271733879, -1732584194, 271733878], + i, + length, + tail, + tmp, + lo, + hi + + for (i = 64; i <= n; i += 64) { + md5cycle(state, md5blk(s.substring(i - 64, i))) + } + s = s.substring(i - 64) + length = s.length + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3) + } + tail[i >> 2] |= 0x80 << ((i % 4) << 3) + if (i > 55) { + md5cycle(state, tail) + for (i = 0; i < 16; i += 1) { + tail[i] = 0 + } + } + + // Beware that the final length might not fit in 32 bits so we take care of that + tmp = n * 8 + tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/) + lo = parseInt(tmp[2], 16) + hi = parseInt(tmp[1], 16) || 0 + + tail[14] = lo + tail[15] = hi + + md5cycle(state, tail) + return state +} + +function md51_array(a) { + var n = a.length, + state = [1732584193, -271733879, -1732584194, 271733878], + i, + length, + tail, + tmp, + lo, + hi + + for (i = 64; i <= n; i += 64) { + md5cycle(state, md5blk_array(a.subarray(i - 64, i))) + } + + // Not sure if it is a bug, however IE10 will always produce a sub array of length 1 + // containing the last element of the parent array if the sub array specified starts + // beyond the length of the parent array - weird. + // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue + a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0) + + length = a.length + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= a[i] << ((i % 4) << 3) + } + + tail[i >> 2] |= 0x80 << ((i % 4) << 3) + if (i > 55) { + md5cycle(state, tail) + for (i = 0; i < 16; i += 1) { + tail[i] = 0 + } + } + + // Beware that the final length might not fit in 32 bits so we take care of that + tmp = n * 8 + tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/) + lo = parseInt(tmp[2], 16) + hi = parseInt(tmp[1], 16) || 0 + + tail[14] = lo + tail[15] = hi + + md5cycle(state, tail) + + return state +} + +function rhex(n) { + var s = '', + j + for (j = 0; j < 4; j += 1) { + s += hex_chr[(n >> (j * 8 + 4)) & 0x0f] + hex_chr[(n >> (j * 8)) & 0x0f] + } + return s +} + +function hex(x) { + var i + for (i = 0; i < x.length; i += 1) { + x[i] = rhex(x[i]) + } + return x.join('') +} + +// In some cases the fast add32 function cannot be used.. +if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') { + add32 = function(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff), + msw = (x >> 16) + (y >> 16) + (lsw >> 16) + return (msw << 16) | (lsw & 0xffff) + } +} + +// --------------------------------------------------- + +/** + * ArrayBuffer slice polyfill. + * + * @see https://github.com/ttaubert/node-arraybuffer-slice + */ + +if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) { + ;(function() { + function clamp(val, length) { + val = val | 0 || 0 + + if (val < 0) { + return Math.max(val + length, 0) + } + + return Math.min(val, length) + } + + ArrayBuffer.prototype.slice = function(from, to) { + var length = this.byteLength, + begin = clamp(from, length), + end = length, + num, + target, + targetArray, + sourceArray + + if (to !== undefined) { + end = clamp(to, length) + } + + if (begin > end) { + return new ArrayBuffer(0) + } + + num = end - begin + target = new ArrayBuffer(num) + targetArray = new Uint8Array(target) + + sourceArray = new Uint8Array(this, begin, num) + targetArray.set(sourceArray) + + return target + } + })() +} + +// --------------------------------------------------- + +/** + * Helpers. + */ + +function toUtf8(str) { + if (/[\u0080-\uFFFF]/.test(str)) { + str = unescape(encodeURIComponent(str)) + } + + return str +} + +function utf8Str2ArrayBuffer(str, returnUInt8Array) { + var length = str.length, + buff = new ArrayBuffer(length), + arr = new Uint8Array(buff), + i + + for (i = 0; i < length; i += 1) { + arr[i] = str.charCodeAt(i) + } + + return returnUInt8Array ? arr : buff +} + +function arrayBuffer2Utf8Str(buff) { + return String.fromCharCode.apply(null, new Uint8Array(buff)) +} + +function concatenateArrayBuffers(first, second, returnUInt8Array) { + var result = new Uint8Array(first.byteLength + second.byteLength) + + result.set(new Uint8Array(first)) + result.set(new Uint8Array(second), first.byteLength) + + return returnUInt8Array ? result : result.buffer +} + +function hexToBinaryString(hex) { + var bytes = [], + length = hex.length, + x + + for (x = 0; x < length - 1; x += 2) { + bytes.push(parseInt(hex.substr(x, 2), 16)) + } + + return String.fromCharCode.apply(String, bytes) +} + +// --------------------------------------------------- + +/** + * SparkMD5 OOP implementation. + * + * Use this class to perform an incremental md5, otherwise use the + * static methods instead. + */ + +function SparkMD5() { + // call reset to init the instance + this.reset() +} + +/** + * Appends a string. + * A conversion will be applied if an utf8 string is detected. + * + * @param {String} str The string to be appended + * + * @return {SparkMD5} The instance itself + */ +SparkMD5.prototype.append = function(str) { + // Converts the string to utf8 bytes if necessary + // Then append as binary + this.appendBinary(toUtf8(str)) + + return this +} + +/** + * Appends a binary string. + * + * @param {String} contents The binary string to be appended + * + * @return {SparkMD5} The instance itself + */ +SparkMD5.prototype.appendBinary = function(contents) { + this._buff += contents + this._length += contents.length + + var length = this._buff.length, + i + + for (i = 64; i <= length; i += 64) { + md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i))) + } + + this._buff = this._buff.substring(i - 64) + + return this +} + +/** + * Finishes the incremental computation, reseting the internal state and + * returning the result. + * + * @param {Boolean} raw True to get the raw string, false to get the hex string + * + * @return {String} The result + */ +SparkMD5.prototype.end = function(raw) { + var buff = this._buff, + length = buff.length, + i, + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + ret + + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3) + } + + this._finish(tail, length) + ret = hex(this._hash) + + if (raw) { + ret = hexToBinaryString(ret) + } + + this.reset() + + return ret +} + +/** + * Resets the internal state of the computation. + * + * @return {SparkMD5} The instance itself + */ +SparkMD5.prototype.reset = function() { + this._buff = '' + this._length = 0 + this._hash = [1732584193, -271733879, -1732584194, 271733878] + + return this +} + +/** + * Gets the internal state of the computation. + * + * @return {Object} The state + */ +SparkMD5.prototype.getState = function() { + return { + buff: this._buff, + length: this._length, + hash: this._hash + } +} + +/** + * Gets the internal state of the computation. + * + * @param {Object} state The state + * + * @return {SparkMD5} The instance itself + */ +SparkMD5.prototype.setState = function(state) { + this._buff = state.buff + this._length = state.length + this._hash = state.hash + + return this +} + +/** + * Releases memory used by the incremental buffer and other additional + * resources. If you plan to use the instance again, use reset instead. + */ +SparkMD5.prototype.destroy = function() { + delete this._hash + delete this._buff + delete this._length +} + +/** + * Finish the final calculation based on the tail. + * + * @param {Array} tail The tail (will be modified) + * @param {Number} length The length of the remaining buffer + */ +SparkMD5.prototype._finish = function(tail, length) { + var i = length, + tmp, + lo, + hi + + tail[i >> 2] |= 0x80 << ((i % 4) << 3) + if (i > 55) { + md5cycle(this._hash, tail) + for (i = 0; i < 16; i += 1) { + tail[i] = 0 + } + } + + // Do the final computation based on the tail and length + // Beware that the final length may not fit in 32 bits so we take care of that + tmp = this._length * 8 + tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/) + lo = parseInt(tmp[2], 16) + hi = parseInt(tmp[1], 16) || 0 + + tail[14] = lo + tail[15] = hi + md5cycle(this._hash, tail) +} + +/** + * Performs the md5 hash on a string. + * A conversion will be applied if utf8 string is detected. + * + * @param {String} str The string + * @param {Boolean} [raw] True to get the raw string, false to get the hex string + * + * @return {String} The result + */ +SparkMD5.hash = function(str, raw) { + // Converts the string to utf8 bytes if necessary + // Then compute it using the binary function + return SparkMD5.hashBinary(toUtf8(str), raw) +} + +/** + * Performs the md5 hash on a binary string. + * + * @param {String} content The binary string + * @param {Boolean} [raw] True to get the raw string, false to get the hex string + * + * @return {String} The result + */ +SparkMD5.hashBinary = function(content, raw) { + var hash = md51(content), + ret = hex(hash) + + return raw ? hexToBinaryString(ret) : ret +} + +// --------------------------------------------------- + +/** + * SparkMD5 OOP implementation for array buffers. + * + * Use this class to perform an incremental md5 ONLY for array buffers. + */ +SparkMD5.ArrayBuffer = function() { + // call reset to init the instance + this.reset() +} + +/** + * Appends an array buffer. + * + * @param {ArrayBuffer} arr The array to be appended + * + * @return {SparkMD5.ArrayBuffer} The instance itself + */ +SparkMD5.ArrayBuffer.prototype.append = function(arr) { + var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), + length = buff.length, + i + + this._length += arr.byteLength + + for (i = 64; i <= length; i += 64) { + md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i))) + } + + this._buff = + i - 64 < length + ? new Uint8Array(buff.buffer.slice(i - 64)) + : new Uint8Array(0) + + return this +} + +/** + * Finishes the incremental computation, reseting the internal state and + * returning the result. + * + * @param {Boolean} raw True to get the raw string, false to get the hex string + * + * @return {String} The result + */ +SparkMD5.ArrayBuffer.prototype.end = function(raw) { + var buff = this._buff, + length = buff.length, + tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + i, + ret + + for (i = 0; i < length; i += 1) { + tail[i >> 2] |= buff[i] << ((i % 4) << 3) + } + + this._finish(tail, length) + ret = hex(this._hash) + + if (raw) { + ret = hexToBinaryString(ret) + } + + this.reset() + + return ret +} + +/** + * Resets the internal state of the computation. + * + * @return {SparkMD5.ArrayBuffer} The instance itself + */ +SparkMD5.ArrayBuffer.prototype.reset = function() { + this._buff = new Uint8Array(0) + this._length = 0 + this._hash = [1732584193, -271733879, -1732584194, 271733878] + + return this +} + +/** + * Gets the internal state of the computation. + * + * @return {Object} The state + */ +SparkMD5.ArrayBuffer.prototype.getState = function() { + var state = SparkMD5.prototype.getState.call(this) + + // Convert buffer to a string + state.buff = arrayBuffer2Utf8Str(state.buff) + + return state +} + +/** + * Gets the internal state of the computation. + * + * @param {Object} state The state + * + * @return {SparkMD5.ArrayBuffer} The instance itself + */ +SparkMD5.ArrayBuffer.prototype.setState = function(state) { + // Convert string to buffer + state.buff = utf8Str2ArrayBuffer(state.buff, true) + + return SparkMD5.prototype.setState.call(this, state) +} + +SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy + +SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish + +/** + * Performs the md5 hash on an array buffer. + * + * @param {ArrayBuffer} arr The array buffer + * @param {Boolean} [raw] True to get the raw string, false to get the hex one + * + * @return {String} The result + */ +SparkMD5.ArrayBuffer.hash = function(arr, raw) { + var hash = md51_array(new Uint8Array(arr)), + ret = hex(hash) + + return raw ? hexToBinaryString(ret) : ret +} + +export default new SparkMD5() diff --git a/src/js/md5/main.js b/src/js/md5/main.js deleted file mode 100644 index 4a376db..0000000 --- a/src/js/md5/main.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var r;try{r=window}catch(n){r=self}r.SparkMD5=t()}}(function(){"use strict";var t=function(t,r){return t+r&4294967295},r=function(r,n,e,i,f,o){return n=t(t(n,r),t(i,o)),t(n<>>32-f,e)},n=function(t,n,e,i,f,o,s){return r(n&e|~n&i,t,n,f,o,s)},e=function(t,n,e,i,f,o,s){return r(n&i|e&~i,t,n,f,o,s)},i=function(t,n,e,i,f,o,s){return r(n^e^i,t,n,f,o,s)},f=function(t,n,e,i,f,o,s){return r(e^(n|~i),t,n,f,o,s)},o=function(r,o){var s=r[0],u=r[1],a=r[2],h=r[3];s=n(s,u,a,h,o[0],7,-680876936),h=n(h,s,u,a,o[1],12,-389564586),a=n(a,h,s,u,o[2],17,606105819),u=n(u,a,h,s,o[3],22,-1044525330),s=n(s,u,a,h,o[4],7,-176418897),h=n(h,s,u,a,o[5],12,1200080426),a=n(a,h,s,u,o[6],17,-1473231341),u=n(u,a,h,s,o[7],22,-45705983),s=n(s,u,a,h,o[8],7,1770035416),h=n(h,s,u,a,o[9],12,-1958414417),a=n(a,h,s,u,o[10],17,-42063),u=n(u,a,h,s,o[11],22,-1990404162),s=n(s,u,a,h,o[12],7,1804603682),h=n(h,s,u,a,o[13],12,-40341101),a=n(a,h,s,u,o[14],17,-1502002290),u=n(u,a,h,s,o[15],22,1236535329),s=e(s,u,a,h,o[1],5,-165796510),h=e(h,s,u,a,o[6],9,-1069501632),a=e(a,h,s,u,o[11],14,643717713),u=e(u,a,h,s,o[0],20,-373897302),s=e(s,u,a,h,o[5],5,-701558691),h=e(h,s,u,a,o[10],9,38016083),a=e(a,h,s,u,o[15],14,-660478335),u=e(u,a,h,s,o[4],20,-405537848),s=e(s,u,a,h,o[9],5,568446438),h=e(h,s,u,a,o[14],9,-1019803690),a=e(a,h,s,u,o[3],14,-187363961),u=e(u,a,h,s,o[8],20,1163531501),s=e(s,u,a,h,o[13],5,-1444681467),h=e(h,s,u,a,o[2],9,-51403784),a=e(a,h,s,u,o[7],14,1735328473),u=e(u,a,h,s,o[12],20,-1926607734),s=i(s,u,a,h,o[5],4,-378558),h=i(h,s,u,a,o[8],11,-2022574463),a=i(a,h,s,u,o[11],16,1839030562),u=i(u,a,h,s,o[14],23,-35309556),s=i(s,u,a,h,o[1],4,-1530992060),h=i(h,s,u,a,o[4],11,1272893353),a=i(a,h,s,u,o[7],16,-155497632),u=i(u,a,h,s,o[10],23,-1094730640),s=i(s,u,a,h,o[13],4,681279174),h=i(h,s,u,a,o[0],11,-358537222),a=i(a,h,s,u,o[3],16,-722521979),u=i(u,a,h,s,o[6],23,76029189),s=i(s,u,a,h,o[9],4,-640364487),h=i(h,s,u,a,o[12],11,-421815835),a=i(a,h,s,u,o[15],16,530742520),u=i(u,a,h,s,o[2],23,-995338651),s=f(s,u,a,h,o[0],6,-198630844),h=f(h,s,u,a,o[7],10,1126891415),a=f(a,h,s,u,o[14],15,-1416354905),u=f(u,a,h,s,o[5],21,-57434055),s=f(s,u,a,h,o[12],6,1700485571),h=f(h,s,u,a,o[3],10,-1894986606),a=f(a,h,s,u,o[10],15,-1051523),u=f(u,a,h,s,o[1],21,-2054922799),s=f(s,u,a,h,o[8],6,1873313359),h=f(h,s,u,a,o[15],10,-30611744),a=f(a,h,s,u,o[6],15,-1560198380),u=f(u,a,h,s,o[13],21,1309151649),s=f(s,u,a,h,o[4],6,-145523070),h=f(h,s,u,a,o[11],10,-1120210379),a=f(a,h,s,u,o[2],15,718787259),u=f(u,a,h,s,o[9],21,-343485551),r[0]=t(s,r[0]),r[1]=t(u,r[1]),r[2]=t(a,r[2]),r[3]=t(h,r[3])},s=function(t){var r,n=[];for(r=0;64>r;r+=4)n[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return n},u=function(t){var r,n=[];for(r=0;64>r;r+=4)n[r>>2]=t[r]+(t[r+1]<<8)+(t[r+2]<<16)+(t[r+3]<<24);return n},a=function(t){var r,n,e,i,f,u,a=t.length,h=[1732584193,-271733879,-1732584194,271733878];for(r=64;a>=r;r+=64)o(h,s(t.substring(r-64,r)));for(t=t.substring(r-64),n=t.length,e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;n>r;r+=1)e[r>>2]|=t.charCodeAt(r)<<(r%4<<3);if(e[r>>2]|=128<<(r%4<<3),r>55)for(o(h,e),r=0;16>r;r+=1)e[r]=0;return i=8*a,i=i.toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(i[2],16),u=parseInt(i[1],16)||0,e[14]=f,e[15]=u,o(h,e),h},h=function(t){var r,n,e,i,f,s,a=t.length,h=[1732584193,-271733879,-1732584194,271733878];for(r=64;a>=r;r+=64)o(h,u(t.subarray(r-64,r)));for(t=a>r-64?t.subarray(r-64):new Uint8Array(0),n=t.length,e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;n>r;r+=1)e[r>>2]|=t[r]<<(r%4<<3);if(e[r>>2]|=128<<(r%4<<3),r>55)for(o(h,e),r=0;16>r;r+=1)e[r]=0;return i=8*a,i=i.toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(i[2],16),s=parseInt(i[1],16)||0,e[14]=f,e[15]=s,o(h,e),h},c=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],p=function(t){var r,n="";for(r=0;4>r;r+=1)n+=c[t>>8*r+4&15]+c[t>>8*r&15];return n},y=function(t){var r;for(r=0;r>16)+(r>>16)+(n>>16);return e<<16|65535&n}),d.prototype.append=function(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),this.appendBinary(t),this},d.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var r,n=this._buff.length;for(r=64;n>=r;r+=64)o(this._state,s(this._buff.substring(r-64,r)));return this._buff=this._buff.substr(r-64),this},d.prototype.end=function(t){var r,n,e=this._buff,i=e.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;i>r;r+=1)f[r>>2]|=e.charCodeAt(r)<<(r%4<<3);return this._finish(f,i),n=t?this._state:y(this._state),this.reset(),n},d.prototype.sign=function(t){return this.appendBinary(t),this.end()},d.prototype._finish=function(t,r){var n,e,i,f=r;if(t[f>>2]|=128<<(f%4<<3),f>55)for(o(this._state,t),f=0;16>f;f+=1)t[f]=0;n=8*this._length,n=n.toString(16).match(/(.*?)(.{0,8})$/),e=parseInt(n[2],16),i=parseInt(n[1],16)||0,t[14]=e,t[15]=i,o(this._state,t)},d.prototype.reset=function(){return this._buff="",this._length=0,this._state=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.destroy=function(){delete this._state,delete this._buff,delete this._length},d.hash=function(t,r){/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t)));var n=a(t);return r?n:y(n)},d.hashBinary=function(t,r){var n=a(t);return r?n:y(n)},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(t){var r,n=this._concatArrayBuffer(this._buff,t),e=n.length;for(this._length+=t.byteLength,r=64;e>=r;r+=64)o(this._state,u(n.subarray(r-64,r)));return this._buff=e>r-64?n.subarray(r-64):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(t){var r,n,e=this._buff,i=e.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;i>r;r+=1)f[r>>2]|=e[r]<<(r%4<<3);return this._finish(f,i),n=t?this._state:y(this._state),this.reset(),n},d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._state=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._concatArrayBuffer=function(t,r){var n=t.length,e=new Uint8Array(n+r.byteLength);return e.set(t),e.set(new Uint8Array(r),n),e},d.ArrayBuffer.hash=function(t,r){var n=h(new Uint8Array(t));return r?n:y(n)},d}); \ No newline at end of file diff --git a/src/js/pager/index.js b/src/js/pager/index.js index 38daf88..594fa1f 100644 --- a/src/js/pager/index.js +++ b/src/js/pager/index.js @@ -45,6 +45,8 @@ function update(currPage, vm) { vm.pageList.clear() if (totalPage > 1) { vm.pageList.pushArray(calculate({ currPage, totalPage, maxPageShow })) + } else { + vm.pageList.pushArray([1]) } } diff --git a/src/js/router/main.js b/src/js/router/index.js similarity index 100% rename from src/js/router/main.js rename to src/js/router/index.js