From fe5c0ae07208e55fb99c11212605b6a1a8c3e300 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Mon, 20 Mar 2017 23:50:02 +0800 Subject: [PATCH 01/20] =?UTF-8?q?=E2=9C=A8=20update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cc3b621..cce56db 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ new blurify({ #### v1.0.7 - fault-tolerance process +- set globalAlpha dynamicly based on blur radius #### v1.0.6 - fixed `toArray` bugs From 83ad3674e539a3ed0e6e0ef293e560874d18e816 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Wed, 22 Mar 2017 23:14:16 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E2=9C=A8=20update=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 - yarn.lock | 108 ++------------------------------------------------- 2 files changed, 4 insertions(+), 106 deletions(-) diff --git a/package.json b/package.json index 0f6163c..9f9fb33 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,6 @@ "babel-preset-es2015": "^6.22.0", "babel-preset-es2015-rollup": "^3.0.0", "eslint": "^3.16.1", - "expect.js": "^0.3.1", - "mocha": "^3.2.0", "path": "^0.12.7", "rollup-plugin-babel": "^2.7.1", "rollup-plugin-sourcemaps": "^0.4.1", diff --git a/yarn.lock b/yarn.lock index 49c1519..5b2a794 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,10 +666,6 @@ brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" @@ -849,7 +845,7 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@^2.9.0, commander@2.9.0: +commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -963,7 +959,7 @@ debug@^2.1.1, debug@^2.2.0: dependencies: ms "0.7.2" -debug@~2.2.0, debug@2.2.0: +debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" dependencies: @@ -1014,10 +1010,6 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -diff@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" - diffie-hellman@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" @@ -1132,7 +1124,7 @@ es6-weak-map@^2.0.1: es6-iterator "2" es6-symbol "3" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5, escape-string-regexp@1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1251,10 +1243,6 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -expect.js: - version "0.3.1" - resolved "https://registry.yarnpkg.com/expect.js/-/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" - extend@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" @@ -1432,17 +1420,6 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - globals@^9.0.0, globals@^9.14.0: version "9.16.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" @@ -1466,10 +1443,6 @@ graceful-fs@^4.1.2: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" - har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" @@ -1788,10 +1761,6 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - json5@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -1858,53 +1827,6 @@ loader-utils@^0.2.16: json5 "^0.5.0" object-assign "^4.0.1" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash.pickby@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" @@ -1987,28 +1909,12 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.0, mkdirp@~0.5.1, mkdirp@0.5.1: +mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -mocha: - version "3.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.2.0.tgz#7dc4f45e5088075171a68896814e6ae9eb7a85e3" - dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.2.0" - diff "1.4.0" - escape-string-regexp "1.0.5" - glob "7.0.5" - growl "1.9.2" - json3 "3.3.2" - lodash.create "3.1.1" - mkdirp "0.5.1" - supports-color "3.1.2" - ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" @@ -2764,12 +2670,6 @@ supports-color@^3.1.0: dependencies: has-flag "^1.0.0" -supports-color@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - dependencies: - has-flag "^1.0.0" - table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" From f36281606b9c5e8aae0352d51605f537ceb54922 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Sat, 25 Mar 2017 21:16:17 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=F0=9F=90=9B=20fixed=20#2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/blurify.js | 6 +++--- dist/blurify.js.map | 2 +- dist/blurify.min.js | 2 +- dist/blurify.min.js.map | 2 +- src/index.js | 2 +- src/utils.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/blurify.js b/dist/blurify.js index 39bba53..11b0fb5 100644 --- a/dist/blurify.js +++ b/dist/blurify.js @@ -21,7 +21,7 @@ images.map(function (image, i) { newimages[i] = new Image(); newimages[i].crossOrigin = '*'; - newimages[i].src = image.dataset.src; + newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); newimages[i].onload = function () { imageLoadPost(); }; @@ -79,7 +79,7 @@ var _this = this; this.$els.map(function (el) { - el.src = el.dataset.src; + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); el.style['filter'] = el.style['-webkit-filter'] = 'blur(' + _this.options.blur + 'px)'; }); } @@ -99,7 +99,7 @@ key: 'blurify', value: function blurify(canvas, blur) { var ctx = canvas.getContext('2d'); - ctx.globalAlpha = 0.5; + ctx.globalAlpha = 1 / (2 * blur); for (var y = -blur; y <= blur; y += 2) { for (var x = -blur; x <= blur; x += 2) { ctx.drawImage(canvas, x, y); diff --git a/dist/blurify.js.map b/dist/blurify.js.map index 9da9878..711050a 100644 --- a/dist/blurify.js.map +++ b/dist/blurify.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preloadImages(images) {\n let newimages = [],\n loadedImagesCount = 0,\n postAction = function () {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n function imageLoadPost() {\n loadedImagesCount++;\n if (loadedImagesCount == images.length) postAction(newimages);\n }\n\n images.map((image, i) => {\n newimages[i] = new Image();\n newimages[i].crossOrigin = '*';\n newimages[i].src = image.dataset.src;\n newimages[i].onload = function () {\n imageLoadPost();\n };\n newimages[i].onerror = function () {\n imageLoadPost();\n };\n });\n\n return {\n done(callback) {\n postAction = callback || postAction;\n },\n };\n}\n\nexport function cssSupport(...args) {\n let el = document.createElement('div'),\n property = args[0],\n value = args[1];\n if (args.length === 1) {\n return property in el.style ? true : false;\n } else if (args.length === 2) {\n el.style[property] = value;\n return el.style[property] ? true : false;\n } else {\n return false;\n }\n}\n","import {\n preloadImages,\n cssSupport,\n} from './utils';\n\nexport default class blurify {\n constructor(options) {\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n }\n\n useCSSMode() {\n this.$els.map(el => {\n el.src = el.dataset.src;\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`;\n });\n }\n\n useCanvasMode() {\n this.imageType = this.options.imageType || `image/jpeg`;\n preloadImages(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n }\n\n blurify(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 0.5;\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n }\n\n getDataURL(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n }\n}\n"],"names":["preloadImages","images","newimages","loadedImagesCount","postAction","imageLoadPost","length","map","image","i","Image","crossOrigin","src","dataset","onload","onerror","done","callback","cssSupport","el","document","createElement","property","value","style","blurify","options","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":";;;;;;;;AAAA,AAAO,IAAA,SAASA,aAAT,CAAuBC,MAAvB,EAA+B;AAClC,IAAA,QAAIC,YAAY,EAAhB;AAAA,IAAA,QACIC,oBAAoB,CADxB;AAAA,IAAA,QAEIC,aAAa,sBAAY,EAF7B;;AAIAH,IAAAA,aAAU,QAAOA,MAAP,yCAAOA,MAAP,MAAiB,QAAlB,GAA8B,CAACA,MAAD,CAA9B,GAAyCA,MAAlD;;AAEA,IAAA,aAASI,aAAT,GAAyB;AACrBF,IAAAA;AACA,IAAA,YAAIA,qBAAqBF,OAAOK,MAAhC,EAAwCF,WAAWF,SAAX;AAC3C,IAAA;;AAEDD,IAAAA,WAAOM,GAAP,CAAW,UAACC,KAAD,EAAQC,CAAR,EAAc;AACrBP,IAAAA,kBAAUO,CAAV,IAAe,IAAIC,KAAJ,EAAf;AACAR,IAAAA,kBAAUO,CAAV,EAAaE,WAAb,GAA2B,GAA3B;AACAT,IAAAA,kBAAUO,CAAV,EAAaG,GAAb,GAAmBJ,MAAMK,OAAN,CAAcD,GAAjC;AACAV,IAAAA,kBAAUO,CAAV,EAAaK,MAAb,GAAsB,YAAY;AAC9BT,IAAAA;AACH,IAAA,SAFD;AAGAH,IAAAA,kBAAUO,CAAV,EAAaM,OAAb,GAAuB,YAAY;AAC/BV,IAAAA;AACH,IAAA,SAFD;AAGH,IAAA,KAVD;;AAYA,IAAA,WAAO;AACHW,IAAAA,YADG,gBACEC,QADF,EACY;AACXb,IAAAA,yBAAaa,YAAYb,UAAzB;AACH,IAAA;AAHE,IAAA,KAAP;AAKH,IAAA;;AAED,AAAO,IAAA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;AACDH,IAAAA,gBAAIE,WAAJ,GAAkB,CAAlB;AACH,IAAA;;;uCAEUjC,OAAO;AACd,IAAA,gBAAI8B,SAASlB,SAASC,aAAT,CAAuB,QAAvB,CAAb;AAAA,IAAA,gBACIkB,MAAMD,OAAOE,UAAP,CAAkB,IAAlB,CADV;;AAGAF,IAAAA,mBAAOO,KAAP,GAAerC,MAAMqC,KAArB;AACAP,IAAAA,mBAAOQ,MAAP,GAAgBtC,MAAMsC,MAAtB;AACAP,IAAAA,gBAAIK,SAAJ,CAAcpC,KAAd,EAAqB,CAArB,EAAwB,CAAxB;AACA,IAAA,iBAAKiB,OAAL,CAAaa,MAAb,EAAqB,KAAKX,IAA1B;AACA,IAAA,mBAAOW,OAAOS,SAAP,CAAiB,KAAKZ,SAAtB,CAAP;AACH,IAAA;;;;;;;;"} \ No newline at end of file +{"version":3,"file":null,"sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preloadImages(images) {\n let newimages = [],\n loadedImagesCount = 0,\n postAction = function () {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n function imageLoadPost() {\n loadedImagesCount++;\n if (loadedImagesCount == images.length) postAction(newimages);\n }\n\n images.map((image, i) => {\n newimages[i] = new Image();\n newimages[i].crossOrigin = '*';\n newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n newimages[i].onload = function () {\n imageLoadPost();\n };\n newimages[i].onerror = function () {\n imageLoadPost();\n };\n });\n\n return {\n done(callback) {\n postAction = callback || postAction;\n },\n };\n}\n\nexport function cssSupport(...args) {\n let el = document.createElement('div'),\n property = args[0],\n value = args[1];\n if (args.length === 1) {\n return property in el.style ? true : false;\n } else if (args.length === 2) {\n el.style[property] = value;\n return el.style[property] ? true : false;\n } else {\n return false;\n }\n}\n","import {\n preloadImages,\n cssSupport,\n} from './utils';\n\nexport default class blurify {\n constructor(options) {\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n }\n\n useCSSMode() {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`;\n });\n }\n\n useCanvasMode() {\n this.imageType = this.options.imageType || `image/jpeg`;\n preloadImages(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n }\n\n blurify(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n }\n\n getDataURL(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n }\n}\n"],"names":["preloadImages","images","newimages","loadedImagesCount","postAction","imageLoadPost","length","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","done","callback","cssSupport","el","document","createElement","property","value","style","blurify","options","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":";;;;;;;;AAAA,AAAO,IAAA,SAASA,aAAT,CAAuBC,MAAvB,EAA+B;AAClC,IAAA,QAAIC,YAAY,EAAhB;AAAA,IAAA,QACIC,oBAAoB,CADxB;AAAA,IAAA,QAEIC,aAAa,sBAAY,EAF7B;;AAIAH,IAAAA,aAAU,QAAOA,MAAP,yCAAOA,MAA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AACAP,IAAAA,gBAAIK,SAAJ,CAAcrC,KAAd,EAAqB,CAArB,EAAwB,CAAxB;AACA,IAAA,iBAAKkB,OAAL,CAAaa,MAAb,EAAqB,KAAKX,IAA1B;AACA,IAAA,mBAAOW,OAAOS,SAAP,CAAiB,KAAKZ,SAAtB,CAAP;AACH,IAAA;;;;;;;;"} \ No newline at end of file diff --git a/dist/blurify.min.js b/dist/blurify.min.js index c677bbe..28955f8 100644 --- a/dist/blurify.min.js +++ b/dist/blurify.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("blurify",t):e.blurify=t()}(this,function(){"use strict";function e(e){function t(){i++,i==e.length&&r(n)}var n=[],i=0,r=function(){};return e="object"!=(void 0===e?"undefined":o(e))?[e]:e,e.map(function(e,o){n[o]=new Image,n[o].crossOrigin="*",n[o].src=e.dataset.src,n[o].onload=function(){t()},n[o].onerror=function(){t()}}),{done:function(e){r=e||r}}}function t(){var e=document.createElement("div"),t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1];return 1===arguments.length?t in e.style:2===arguments.length&&(e.style[t]=n,!!e.style[t])}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n=0&&o>=0&&n.drawImage(e,-(i-1),-(o-1));n.globalAlpha=1}},{key:"getDataURL",value:function(e){var t=document.createElement("canvas"),n=t.getContext("2d");return t.width=e.width,t.height=e.height,n.drawImage(e,0,0),this.blurify(t,this.blur),t.toDataURL(this.imageType)}}]),o}()}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("blurify",e):t.blurify=e()}(this,function(){"use strict";function t(t){function e(){i++,i==t.length&&r(n)}var n=[],i=0,r=function(){};return t="object"!=(void 0===t?"undefined":o(t))?[t]:t,t.map(function(t,o){n[o]=new Image,n[o].crossOrigin="*",n[o].src=t.dataset?t.dataset.src:t.getAttribute("data-src"),n[o].onload=function(){e()},n[o].onerror=function(){e()}}),{done:function(t){r=t||r}}}function e(){var t=document.createElement("div"),e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1];return 1===arguments.length?e in t.style:2===arguments.length&&(t.style[e]=n,!!t.style[e])}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n=0&&o>=0&&n.drawImage(t,-(i-1),-(o-1));n.globalAlpha=1}},{key:"getDataURL",value:function(t){var e=document.createElement("canvas"),n=e.getContext("2d");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),this.blurify(e,this.blur),e.toDataURL(this.imageType)}}]),o}()}); //# sourceMappingURL=blurify.min.js.map diff --git a/dist/blurify.min.js.map b/dist/blurify.min.js.map index c155e93..2203670 100644 --- a/dist/blurify.min.js.map +++ b/dist/blurify.min.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preloadImages(images) {\n let newimages = [],\n loadedImagesCount = 0,\n postAction = function () {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n function imageLoadPost() {\n loadedImagesCount++;\n if (loadedImagesCount == images.length) postAction(newimages);\n }\n\n images.map((image, i) => {\n newimages[i] = new Image();\n newimages[i].crossOrigin = '*';\n newimages[i].src = image.dataset.src;\n newimages[i].onload = function () {\n imageLoadPost();\n };\n newimages[i].onerror = function () {\n imageLoadPost();\n };\n });\n\n return {\n done(callback) {\n postAction = callback || postAction;\n },\n };\n}\n\nexport function cssSupport(...args) {\n let el = document.createElement('div'),\n property = args[0],\n value = args[1];\n if (args.length === 1) {\n return property in el.style ? true : false;\n } else if (args.length === 2) {\n el.style[property] = value;\n return el.style[property] ? true : false;\n } else {\n return false;\n }\n}\n","import {\n preloadImages,\n cssSupport,\n} from './utils';\n\nexport default class blurify {\n constructor(options) {\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n }\n\n useCSSMode() {\n this.$els.map(el => {\n el.src = el.dataset.src;\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`;\n });\n }\n\n useCanvasMode() {\n this.imageType = this.options.imageType || `image/jpeg`;\n preloadImages(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n }\n\n blurify(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 0.5;\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n }\n\n getDataURL(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n }\n}\n"],"names":["preloadImages","images","imageLoadPost","loadedImagesCount","length","postAction","newimages","map","image","i","Image","crossOrigin","src","dataset","onload","onerror","callback","cssSupport","el","document","createElement","property","value","arguments","style","options","blur","mode","$els","nodeType","slice","call","this","useCSSMode","useCanvasMode","_this","imageType","done","index","_this2","getDataURL","canvas","ctx","getContext","globalAlpha","y","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AAKD,GAAK,GAAGH,EAAIK,UAAUN,IAAUK,EAAI,KAAMD,EAAI,MAGhED,YAAc,qCAGXpC,MACHiC,GAAStB,SAASC,cAAc,UAChCsB,EAAMD,EAAOE,WAAW,eAErBK,MAAQxC,EAAMwC,QACdC,OAASzC,EAAMyC,SAClBF,UAAUvC,EAAO,EAAG,QACnB0C,QAAQT,EAAQT,KAAKN,MACnBe,EAAOU,UAAUnB,KAAKI"} \ No newline at end of file +{"version":3,"file":null,"sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preloadImages(images) {\n let newimages = [],\n loadedImagesCount = 0,\n postAction = function () {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n function imageLoadPost() {\n loadedImagesCount++;\n if (loadedImagesCount == images.length) postAction(newimages);\n }\n\n images.map((image, i) => {\n newimages[i] = new Image();\n newimages[i].crossOrigin = '*';\n newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n newimages[i].onload = function () {\n imageLoadPost();\n };\n newimages[i].onerror = function () {\n imageLoadPost();\n };\n });\n\n return {\n done(callback) {\n postAction = callback || postAction;\n },\n };\n}\n\nexport function cssSupport(...args) {\n let el = document.createElement('div'),\n property = args[0],\n value = args[1];\n if (args.length === 1) {\n return property in el.style ? true : false;\n } else if (args.length === 2) {\n el.style[property] = value;\n return el.style[property] ? true : false;\n } else {\n return false;\n }\n}\n","import {\n preloadImages,\n cssSupport,\n} from './utils';\n\nexport default class blurify {\n constructor(options) {\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n }\n\n useCSSMode() {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`;\n });\n }\n\n useCanvasMode() {\n this.imageType = this.options.imageType || `image/jpeg`;\n preloadImages(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n }\n\n blurify(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n }\n\n getDataURL(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n }\n}\n"],"names":["preloadImages","images","imageLoadPost","loadedImagesCount","length","postAction","newimages","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","callback","cssSupport","el","document","createElement","property","value","arguments","style","options","blur","mode","$els","nodeType","slice","call","this","useCSSMode","useCanvasMode","_this","imageType","done","index","_this2","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","blurify","toDataURL"],"mappings":"4LAAO,SAASA,GAAcC,WAOjBC,SAEDC,GAAqBF,EAAOG,QAAQC,EAAWC,MARnDA,MACAH,EAAoB,EACpBE,EAAa,sBAEU,oBAAVJ,gBAAAA,KAAuBA,GAAUA,IAO3CM,IAAI,SAACC,EAAOC,KACLA,GAAK,GAAIC,SACTD,GAAGE,YAAc,MACjBF,GAAGG,IAAMJ,EAAMK,QAAUL,EAAMK,QAAQD,IAAMJ,EAAMM,aAAa,cAChEL,GAAGM,OAAS,kBAGZN,GAAGO,QAAU,iCAMlBC,KACYA,GAAYZ,IAK9B,QAASa,QACRC,GAAKC,SAASC,cAAc,OAC5BC,0CACAC,gDACgB,KAAhBC,UAAKpB,OACEkB,IAAYH,GAAGM,MACC,IAAhBD,UAAKpB,WACTqB,MAAMH,GAAYC,IACdJ,EAAGM,MAAMH,okBCjCRI,kBACHA,QAAUA,OACVC,KAAOD,EAAQC,MAAQ,OACvBC,KAAOF,EAAQE,MAAQ,WACvBC,KAAmC,IAA5BH,EAAQzB,OAAO6B,UAAkBJ,EAAQzB,WAAa8B,MAAMC,KAAKN,EAAQzB,QAEpE,QAAbgC,KAAKL,OACM,SAAU,aAAeK,KAAKC,aAAeD,KAAKE,gBACzC,OAAbF,KAAKL,UACPM,kBAEAC,+EAKJN,KAAKtB,IAAI,cACPK,IAAMO,EAAGN,QAAUM,EAAGN,QAAQD,IAAMO,EAAGL,aAAa,cACpDW,MAAH,OAAqBN,EAAGM,MAAM,0BAA4BW,EAAKV,QAAQC,qEAKtEU,UAAYJ,KAAKP,QAAQW,0BAChBJ,KAAKJ,MAAMS,KAAK,cACnB/B,IAAI,SAACC,EAAO+B,KACVV,KAAKU,GAAO3B,IAAM4B,EAAKC,WAAWjC,uCAK3CkC,EAAQf,MACRgB,GAAMD,EAAOE,WAAW,QACxBC,YAAc,GAAK,EAAIlB,OACtB,GAAImB,IAAKnB,EAAMmB,GAAKnB,EAAMmB,GAAK,MAC3B,GAAIC,IAAKpB,EAAMoB,GAAKpB,EAAMoB,GAAK,IAC5BC,UAAUN,EAAQK,EAAGD,GACrBC,GAAK,GAAKD,GAAK,GAAGH,EAAIK,UAAUN,IAAUK,EAAI,KAAMD,EAAI,MAGhED,YAAc,qCAGXrC,MACHkC,GAAStB,SAASC,cAAc,UAChCsB,EAAMD,EAAOE,WAAW,eAErBK,MAAQzC,EAAMyC,QACdC,OAAS1C,EAAM0C,SAClBF,UAAUxC,EAAO,EAAG,QACnB2C,QAAQT,EAAQT,KAAKN,MACnBe,EAAOU,UAAUnB,KAAKI"} \ No newline at end of file diff --git a/src/index.js b/src/index.js index fccb091..6088716 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,7 @@ export default class blurify { useCSSMode() { this.$els.map(el => { - el.src = el.dataset.src; + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`; }); } diff --git a/src/utils.js b/src/utils.js index c60676c..8382e9a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -13,7 +13,7 @@ export function preloadImages(images) { images.map((image, i) => { newimages[i] = new Image(); newimages[i].crossOrigin = '*'; - newimages[i].src = image.dataset.src; + newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); newimages[i].onload = function () { imageLoadPost(); }; From c17c3ace071ec13c076879184664411014fdd838 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Sat, 25 Mar 2017 21:18:14 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E2=9C=A8=20update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cce56db..a53a6e9 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ new blurify({ ## Change log +#### v1.0.8 +- fixed [#2](https://github.com/JustClear/blurify/issues/2) + #### v1.0.7 - fault-tolerance process - set globalAlpha dynamicly based on blur radius From 42447090a3d344e7bb125d3a64a72aacd46f3181 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Sat, 25 Mar 2017 21:18:24 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E2=9C=A8=20update=20package.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9f9fb33..87ca1a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blurify", - "version": "1.0.7", + "version": "1.0.8", "description": "Image blurify.", "main": "dist/blurify.js", "scripts": { From 981f4d18c238f1905da8185236c4fda265b132c1 Mon Sep 17 00:00:00 2001 From: kevinyokutran Date: Thu, 6 Apr 2017 14:09:55 -0700 Subject: [PATCH 06/20] Update README.md Just a little grammatical fix :) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a53a6e9..8f27a79 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![dependencies](https://david-dm.org/justclear/blurify.svg)](https://david-dm.org/justclear/blurify#info=dependencies&view=table) [![devDependencies](https://david-dm.org/justclear/blurify/dev-status.svg)](https://david-dm.org/justclear/blurify#info=devDependencies&view=table) -blurify.js is a tiny(~2kb) library to blurred pictures, support graceful downgrade from `css` mode to `canvas` mode. +blurify.js is a tiny(~2kb) library to blur pictures, with graceful downgrade support from `css` mode to `canvas` mode. ## Installation From b130d07eddf101407384220e2d0cb9fcf2a2fabf Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Tue, 9 May 2017 21:16:02 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=20add=20.travis.?= =?UTF-8?q?yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6152786 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: node_js + +branches: + only: + - master + +cache: + directories: + - $HOME/.npm + - $HOME/.yarn-cache + - node_modules + +install: +- npm install + +script: +- npm run publish From 2ae243ffb58a978bcf4477c3fc586b927e1f7f2c Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Tue, 9 May 2017 21:24:36 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E2=9C=A8=20specified=20`nodejs`=20versio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6152786..8e053d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ language: node_js +node_js: +- "4" + branches: only: - master From 2d0e751cf720c3636c8cf6b062c3abba1133113f Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Tue, 9 May 2017 21:33:13 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E2=9C=A8=20add=20`travis`=20badge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8f27a79..ea8ed59 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # blurify +![travis](https://api.travis-ci.org/JustClear/blurify.svg?branch=master) [![dependencies](https://david-dm.org/justclear/blurify.svg)](https://david-dm.org/justclear/blurify#info=dependencies&view=table) [![devDependencies](https://david-dm.org/justclear/blurify/dev-status.svg)](https://david-dm.org/justclear/blurify#info=devDependencies&view=table) From eab4f2acfde189104c80a6e965513e4660edc3a1 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Thu, 29 Jun 2017 17:44:40 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E2=9C=A8=20refactor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++ dist/blurify.js | 214 +++++++++++++++++++--------------------- dist/blurify.js.map | 2 +- dist/blurify.min.js | 2 +- dist/blurify.min.js.map | 2 +- index.html | 3 +- package.json | 2 +- src/index.js | 101 ++++++++++--------- src/utils.js | 63 ++++++------ 9 files changed, 203 insertions(+), 193 deletions(-) diff --git a/README.md b/README.md index ea8ed59..5493546 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,17 @@ new blurify({ blur: 6, mode: 'css', }); + +// or in shorthand + +blurify(6, document.querySelectorAll('.blurify')); ``` ## Change log +#### v1.1.0 +- refactor + #### v1.0.8 - fixed [#2](https://github.com/JustClear/blurify/issues/2) diff --git a/dist/blurify.js b/dist/blurify.js index 11b0fb5..c8feddb 100644 --- a/dist/blurify.js +++ b/dist/blurify.js @@ -1,131 +1,125 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define('blurify', factory) : - (global.blurify = factory()); -}(this, function () { 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define('blurify', factory) : + (global.blurify = factory()); +}(this, (function () { 'use strict'; - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - function preloadImages(images) { - var newimages = [], - loadedImagesCount = 0, - postAction = function postAction() {}; +function preload(imageUrls) { + var images = [], + count = 0, + doneAction = function doneAction() {}; - images = (typeof images === 'undefined' ? 'undefined' : _typeof(images)) != 'object' ? [images] : images; + imageUrls = (typeof imageUrls === 'undefined' ? 'undefined' : _typeof(imageUrls)) != 'object' ? [imageUrls] : imageUrls; - function imageLoadPost() { - loadedImagesCount++; - if (loadedImagesCount == images.length) postAction(newimages); - } + imageUrls.length === 0 && doneAction(images); - images.map(function (image, i) { - newimages[i] = new Image(); - newimages[i].crossOrigin = '*'; - newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - newimages[i].onload = function () { - imageLoadPost(); - }; - newimages[i].onerror = function () { - imageLoadPost(); - }; - }); + imageUrls.map(function (image, i) { + images[i] = new Image(); + images[i].crossOrigin = '*'; + images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + images[i].onload = imageLoad; + images[i].onerror = imageLoad; + }); - return { - done: function done(callback) { - postAction = callback || postAction; - } - }; + function imageLoad() { + count++; + if (count == imageUrls.length) doneAction(images); } - function cssSupport() { - var el = document.createElement('div'), - property = arguments.length <= 0 ? undefined : arguments[0], - value = arguments.length <= 1 ? undefined : arguments[1]; - if (arguments.length === 1) { + return { + done: function done() { + doneAction = arguments[0] || doneAction; + } + }; +} + +function cssSupport() { + var el = document.createElement('div'); + var property = arguments[0]; + + switch (arguments.length) { + case 1: return property in el.style ? true : false; - } else if (arguments.length === 2) { - el.style[property] = value; + case 2: + el.style[property] = arguments[1]; return el.style[property] ? true : false; - } else { + default: return false; - } } +} - var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); +function blurify(options) { + if (!(this instanceof blurify)) return new (Function.prototype.bind.apply(blurify, [null].concat(Array.prototype.slice.call(arguments))))(); - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + if (typeof options === 'number') { + options = { + blur: options, + images: arguments[1], + mode: 'auto' + }; + } - var blurify = function () { - function blurify(options) { - _classCallCheck(this, blurify); + this.options = options; + this.blur = options.blur || 6; + this.mode = options.mode || 'css'; + this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); + + if (this.mode == 'auto') { + cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); + } else if (this.mode == 'css') { + this.blur = this.blur / 2; + this.useCSSMode(); + } else { + this.useCanvasMode(); + } +} + +blurify.prototype.useCSSMode = function () { + var _this = this; - this.options = options; - this.blur = options.blur || 6; - this.mode = options.mode || 'css'; - this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); + this.$els.map(function (el) { + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); + el.style['filter'] = el.style['-webkit-filter'] = 'blur(' + _this.blur + 'px)'; + }); +}; - if (this.mode == 'auto') { - cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); - } else if (this.mode == 'css') { - this.useCSSMode(); - } else { - this.useCanvasMode(); - } +blurify.prototype.useCanvasMode = function () { + var _this2 = this; + + this.imageType = this.options.imageType || 'image/jpeg'; + preload(this.$els).done(function (images) { + images.map(function (image, index) { + _this2.$els[index].src = _this2.getDataURL(image); + }); + }); +}; + +blurify.prototype.blurify = function (canvas, blur) { + var ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * blur); + for (var y = -blur; y <= blur; y += 2) { + for (var x = -blur; x <= blur; x += 2) { + ctx.drawImage(canvas, x, y); + if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); } + } + ctx.globalAlpha = 1; +}; + +blurify.prototype.getDataURL = function (image) { + var canvas = document.createElement('canvas'), + ctx = canvas.getContext('2d'); + + canvas.width = image.width; + canvas.height = image.height; + ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); + return canvas.toDataURL(this.imageType); +}; + +return blurify; - _createClass(blurify, [{ - key: 'useCSSMode', - value: function useCSSMode() { - var _this = this; - - this.$els.map(function (el) { - el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); - el.style['filter'] = el.style['-webkit-filter'] = 'blur(' + _this.options.blur + 'px)'; - }); - } - }, { - key: 'useCanvasMode', - value: function useCanvasMode() { - var _this2 = this; - - this.imageType = this.options.imageType || 'image/jpeg'; - preloadImages(this.$els).done(function (images) { - images.map(function (image, index) { - _this2.$els[index].src = _this2.getDataURL(image); - }); - }); - } - }, { - key: 'blurify', - value: function blurify(canvas, blur) { - var ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * blur); - for (var y = -blur; y <= blur; y += 2) { - for (var x = -blur; x <= blur; x += 2) { - ctx.drawImage(canvas, x, y); - if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); - } - } - ctx.globalAlpha = 1; - } - }, { - key: 'getDataURL', - value: function getDataURL(image) { - var canvas = document.createElement('canvas'), - ctx = canvas.getContext('2d'); - - canvas.width = image.width; - canvas.height = image.height; - ctx.drawImage(image, 0, 0); - this.blurify(canvas, this.blur); - return canvas.toDataURL(this.imageType); - } - }]); - - return blurify; - }(); - - return blurify; - -})); +}))); //# sourceMappingURL=blurify.js.map diff --git a/dist/blurify.js.map b/dist/blurify.js.map index 711050a..3fbf866 100644 --- a/dist/blurify.js.map +++ b/dist/blurify.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preloadImages(images) {\n let newimages = [],\n loadedImagesCount = 0,\n postAction = function () {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n function imageLoadPost() {\n loadedImagesCount++;\n if (loadedImagesCount == images.length) postAction(newimages);\n }\n\n images.map((image, i) => {\n newimages[i] = new Image();\n newimages[i].crossOrigin = '*';\n newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n newimages[i].onload = function () {\n imageLoadPost();\n };\n newimages[i].onerror = function () {\n imageLoadPost();\n };\n });\n\n return {\n done(callback) {\n postAction = callback || postAction;\n },\n };\n}\n\nexport function cssSupport(...args) {\n let el = document.createElement('div'),\n property = args[0],\n value = args[1];\n if (args.length === 1) {\n return property in el.style ? true : false;\n } else if (args.length === 2) {\n el.style[property] = value;\n return el.style[property] ? true : false;\n } else {\n return false;\n }\n}\n","import {\n preloadImages,\n cssSupport,\n} from './utils';\n\nexport default class blurify {\n constructor(options) {\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n }\n\n useCSSMode() {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`;\n });\n }\n\n useCanvasMode() {\n this.imageType = this.options.imageType || `image/jpeg`;\n preloadImages(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n }\n\n blurify(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n }\n\n getDataURL(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n }\n}\n"],"names":["preloadImages","images","newimages","loadedImagesCount","postAction","imageLoadPost","length","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","done","callback","cssSupport","el","document","createElement","property","value","style","blurify","options","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":";;;;;;;;AAAA,AAAO,IAAA,SAASA,aAAT,CAAuBC,MAAvB,EAA+B;AAClC,IAAA,QAAIC,YAAY,EAAhB;AAAA,IAAA,QACIC,oBAAoB,CADxB;AAAA,IAAA,QAEIC,aAAa,sBAAY,EAF7B;;AAIAH,IAAAA,aAAU,QAAOA,MAAP,yCAAOA,MAAP,MAAiB,QAAlB,GAA8B,CAACA,MAAD,CAA9B,GAAyCA,MAAlD;;AAEA,IA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B;AACA,IAAA,iBAAKkB,OAAL,CAAaa,MAAb,EAAqB,KAAKX,IAA1B;AACA,IAAA,mBAAOW,OAAOS,SAAP,CAAiB,KAAKZ,SAAtB,CAAP;AACH,IAAA;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"blurify.js","sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preload(imageUrls) {\n let images = [],\n count = 0,\n doneAction = function () {};\n\n imageUrls = (typeof imageUrls != 'object') ? [imageUrls] : imageUrls;\n\n imageUrls.length === 0 && doneAction(images);\n\n imageUrls.map((image, i) => {\n images[i] = new Image();\n images[i].crossOrigin = '*';\n images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n images[i].onload = imageLoad;\n images[i].onerror = imageLoad;\n });\n\n function imageLoad() {\n count++;\n if (count == imageUrls.length) doneAction(images);\n }\n\n return {\n done() {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport() {\n const el = document.createElement('div');\n const property = arguments[0];\n\n switch (arguments.length) {\n case 1:\n return property in el.style ? true : false;\n case 2:\n el.style[property] = arguments[1];\n return el.style[property] ? true : false;\n default:\n return false;\n }\n}\n","import {\n preload,\n cssSupport,\n} from './utils';\n\nexport default function blurify(options) {\n if (!(this instanceof blurify)) return new blurify(...arguments);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function () {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function () {\n this.imageType = this.options.imageType || `image/jpeg`;\n preload(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","imageUrls","images","count","doneAction","length","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","imageLoad","onerror","arguments","cssSupport","el","document","createElement","property","style","blurify","options","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","imageType","done","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":";;;;;;;;AAAA,AAAO,SAASA,OAAT,CAAiBC,SAAjB,EAA4B;QAC3BC,SAAS,EAAb;QACIC,QAAQ,CADZ;QAEIC,aAAa,sBAAY,EAF7B;;gBAIa,QAAOH,SAAP,yCAAOA,SAAP,MAAoB,QAArB,GAAiC,CAACA,SAAD,CAAjC,GAA+CA,SAA3D;;cAEUI,MAAV,KAAqB,CAArB,IAA0BD,WAAWF,MAAX,CAA1B;;cAEUI,GAAV,CAAc,UAACC,KAAD,EAAQC,CAAR,EAAc;eACjBA,CAAP,IAAY,IAAIC,KAAJ,EAAZ;eACOD,CAAP,EAAUE,WAAV,GAAwB,GAAxB;eACOF,CAAP,EAAUG,GAAV,GAAgBJ,MAAMK,OAAN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,KAAK,CAAL,IAAUD,KAAK,CAAnB,EAAsBH,IAAIK,SAAJ,CAAcN,MAAd,EAAsB,EAAEK,IAAI,CAAN,CAAtB,EAAgC,EAAED,IAAI,CAAN,CAAhC;;;QAG1BD,WAAJ,GAAkB,CAAlB;CATJ;;AAYAlB,QAAQU,SAAR,CAAkBI,UAAlB,GAA+B,UAAS/B,KAAT,EAAgB;QACvCgC,SAASnB,SAASC,aAAT,CAAuB,QAAvB,CAAb;QACImB,MAAMD,OAAOE,UAAP,CAAkB,IAAlB,CADV;;WAGOK,KAAP,GAAevC,MAAMuC,KAArB;WACOC,MAAP,GAAgBxC,MAAMwC,MAAtB;QACIF,SAAJ,CAActC,KAAd,EAAqB,CAArB,EAAwB,CAAxB;SACKiB,OAAL,CAAae,MAAb,EAAqB,KAAKb,IAA1B;WACOa,OAAOS,SAAP,CAAiB,KAAKb,SAAtB,CAAP;CARJ;;;;"} \ No newline at end of file diff --git a/dist/blurify.min.js b/dist/blurify.min.js index 28955f8..58889fd 100644 --- a/dist/blurify.min.js +++ b/dist/blurify.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("blurify",e):t.blurify=e()}(this,function(){"use strict";function t(t){function e(){i++,i==t.length&&r(n)}var n=[],i=0,r=function(){};return t="object"!=(void 0===t?"undefined":o(t))?[t]:t,t.map(function(t,o){n[o]=new Image,n[o].crossOrigin="*",n[o].src=t.dataset?t.dataset.src:t.getAttribute("data-src"),n[o].onload=function(){e()},n[o].onerror=function(){e()}}),{done:function(t){r=t||r}}}function e(){var t=document.createElement("div"),e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1];return 1===arguments.length?e in t.style:2===arguments.length&&(t.style[e]=n,!!t.style[e])}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(){function t(t,e){for(var n=0;n=0&&o>=0&&n.drawImage(t,-(i-1),-(o-1));n.globalAlpha=1}},{key:"getDataURL",value:function(t){var e=document.createElement("canvas"),n=e.getContext("2d");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),this.blurify(e,this.blur),e.toDataURL(this.imageType)}}]),o}()}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("blurify",e):t.blurify=e()}(this,function(){"use strict";function t(t){function e(){i++,i==t.length&&r(o)}var o=[],i=0,r=function(){};return t="object"!=(void 0===t?"undefined":n(t))?[t]:t,0===t.length&&r(o),t.map(function(t,n){o[n]=new Image,o[n].crossOrigin="*",o[n].src=t.dataset?t.dataset.src:t.getAttribute("data-src"),o[n].onload=e,o[n].onerror=e}),{done:function(){r=arguments[0]||r}}}function e(){var t=document.createElement("div"),e=arguments[0];switch(arguments.length){case 1:return e in t.style;case 2:return t.style[e]=arguments[1],!!t.style[e];default:return!1}}function o(t){if(!(this instanceof o))return new(Function.prototype.bind.apply(o,[null].concat(Array.prototype.slice.call(arguments))));"number"==typeof t&&(t={blur:t,images:arguments[1],mode:"auto"}),this.options=t,this.blur=t.blur||6,this.mode=t.mode||"css",this.$els=1===t.images.nodeType?[t.images]:[].slice.call(t.images),"auto"==this.mode?e("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur=this.blur/2,this.useCSSMode()):this.useCanvasMode()}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return o.prototype.useCSSMode=function(){var t=this;this.$els.map(function(e){e.src=e.dataset?e.dataset.src:e.getAttribute("data-src"),e.style.filter=e.style["-webkit-filter"]="blur("+t.blur+"px)"})},o.prototype.useCanvasMode=function(){var e=this;this.imageType=this.options.imageType||"image/jpeg",t(this.$els).done(function(t){t.map(function(t,o){e.$els[o].src=e.getDataURL(t)})})},o.prototype.blurify=function(t,e){var o=t.getContext("2d");o.globalAlpha=1/(2*e);for(var n=-e;n<=e;n+=2)for(var i=-e;i<=e;i+=2)o.drawImage(t,i,n),i>=0&&n>=0&&o.drawImage(t,-(i-1),-(n-1));o.globalAlpha=1},o.prototype.getDataURL=function(t){var e=document.createElement("canvas"),o=e.getContext("2d");return e.width=t.width,e.height=t.height,o.drawImage(t,0,0),this.blurify(e,this.blur),e.toDataURL(this.imageType)},o}); //# sourceMappingURL=blurify.min.js.map diff --git a/dist/blurify.min.js.map b/dist/blurify.min.js.map index 2203670..c057e3a 100644 --- a/dist/blurify.min.js.map +++ b/dist/blurify.min.js.map @@ -1 +1 @@ -{"version":3,"file":null,"sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preloadImages(images) {\n let newimages = [],\n loadedImagesCount = 0,\n postAction = function () {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n function imageLoadPost() {\n loadedImagesCount++;\n if (loadedImagesCount == images.length) postAction(newimages);\n }\n\n images.map((image, i) => {\n newimages[i] = new Image();\n newimages[i].crossOrigin = '*';\n newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n newimages[i].onload = function () {\n imageLoadPost();\n };\n newimages[i].onerror = function () {\n imageLoadPost();\n };\n });\n\n return {\n done(callback) {\n postAction = callback || postAction;\n },\n };\n}\n\nexport function cssSupport(...args) {\n let el = document.createElement('div'),\n property = args[0],\n value = args[1];\n if (args.length === 1) {\n return property in el.style ? true : false;\n } else if (args.length === 2) {\n el.style[property] = value;\n return el.style[property] ? true : false;\n } else {\n return false;\n }\n}\n","import {\n preloadImages,\n cssSupport,\n} from './utils';\n\nexport default class blurify {\n constructor(options) {\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n }\n\n useCSSMode() {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`;\n });\n }\n\n useCanvasMode() {\n this.imageType = this.options.imageType || `image/jpeg`;\n preloadImages(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n }\n\n blurify(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n }\n\n getDataURL(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n }\n}\n"],"names":["preloadImages","images","imageLoadPost","loadedImagesCount","length","postAction","newimages","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","callback","cssSupport","el","document","createElement","property","value","arguments","style","options","blur","mode","$els","nodeType","slice","call","this","useCSSMode","useCanvasMode","_this","imageType","done","index","_this2","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","blurify","toDataURL"],"mappings":"4LAAO,SAASA,GAAcC,WAOjBC,SAEDC,GAAqBF,EAAOG,QAAQC,EAAWC,MARnDA,MACAH,EAAoB,EACpBE,EAAa,sBAEU,oBAAVJ,gBAAAA,KAAuBA,GAAUA,IAO3CM,IAAI,SAACC,EAAOC,KACLA,GAAK,GAAIC,SACTD,GAAGE,YAAc,MACjBF,GAAGG,IAAMJ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1C,EAAM0C,SAClBF,UAAUxC,EAAO,EAAG,QACnB2C,QAAQT,EAAQT,KAAKN,MACnBe,EAAOU,UAAUnB,KAAKI"} \ No newline at end of file +{"version":3,"file":"blurify.min.js","sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preload(imageUrls) {\n let images = [],\n count = 0,\n doneAction = function () {};\n\n imageUrls = (typeof imageUrls != 'object') ? [imageUrls] : imageUrls;\n\n imageUrls.length === 0 && doneAction(images);\n\n imageUrls.map((image, i) => {\n images[i] = new Image();\n images[i].crossOrigin = '*';\n images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n images[i].onload = imageLoad;\n images[i].onerror = imageLoad;\n });\n\n function imageLoad() {\n count++;\n if (count == imageUrls.length) doneAction(images);\n }\n\n return {\n done() {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport() {\n const el = document.createElement('div');\n const property = arguments[0];\n\n switch (arguments.length) {\n case 1:\n return property in el.style ? true : false;\n case 2:\n el.style[property] = arguments[1];\n return el.style[property] ? true : false;\n default:\n return false;\n }\n}\n","import {\n preload,\n cssSupport,\n} from './utils';\n\nexport default function blurify(options) {\n if (!(this instanceof blurify)) return new blurify(...arguments);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function () {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function () {\n this.imageType = this.options.imageType || `image/jpeg`;\n preload(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","imageUrls","imageLoad","count","length","doneAction","images","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","arguments","cssSupport","el","document","createElement","property","style","blurify","options","this","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","_this","imageType","done","index","_this2","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":"4LAAA,SAAgBA,GAAQC,WAiBXC,SAEDC,GAASF,EAAUG,QAAQC,EAAWC,MAlB1CA,MACAH,EAAQ,EACRE,EAAa,sBAEgB,oBAAbJ,gBAAAA,KAA0BA,GAAaA,EAEtC,MAAXG,QAAgBC,EAAWC,KAE3BC,IAAI,SAACC,EAAOC,KACXA,GAAK,GAAIC,SACTD,GAAGE,YAAc,MACjBF,GAAGG,IAAMJ,EAAMK,QAAUL,EAAMK,QAAQD,IAAMJ,EAAMM,aAAa,cAChEL,GAAGM,OAASb,IACZO,GAAGO,QAAUd,uBAUHe,UAAU,IAAMZ,IAKzC,QAAgBa,QACNC,GAAKC,SAASC,cAAc,OAC5BC,EAAWL,UAAU,UAEnBA,UAAUb,YACT,SACMkB,KAAYH,GAAGI,U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1C,EAAM0C,SAClBF,UAAUxC,EAAO,EAAG,QACnBgB,QAAQkB,EAAQhB,KAAKC,MACnBe,EAAOS,UAAUzB,KAAKW"} \ No newline at end of file diff --git a/index.html b/index.html index 0cff4aa..9d601f3 100644 --- a/index.html +++ b/index.html @@ -20,11 +20,12 @@ diff --git a/package.json b/package.json index 87ca1a9..03625fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blurify", - "version": "1.0.8", + "version": "1.1.0", "description": "Image blurify.", "main": "dist/blurify.js", "scripts": { diff --git a/src/index.js b/src/index.js index 6088716..203933c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,60 +1,69 @@ import { - preloadImages, + preload, cssSupport, } from './utils'; -export default class blurify { - constructor(options) { - this.options = options; - this.blur = options.blur || 6; - this.mode = options.mode || 'css'; - this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); - - if (this.mode == 'auto') { - cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); - } else if (this.mode == 'css') { - this.useCSSMode(); - } else { - this.useCanvasMode(); - } +export default function blurify(options) { + if (!(this instanceof blurify)) return new blurify(...arguments); + + if (typeof options === 'number') { + options = { + blur: options, + images: arguments[1], + mode: 'auto', + }; } - useCSSMode() { - this.$els.map(el => { - el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); - el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.options.blur}px)`; - }); + this.options = options; + this.blur = options.blur || 6; + this.mode = options.mode || 'css'; + this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); + + if (this.mode == 'auto') { + cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); + } else if (this.mode == 'css') { + this.blur = this.blur / 2; + this.useCSSMode(); + } else { + this.useCanvasMode(); } +} - useCanvasMode() { - this.imageType = this.options.imageType || `image/jpeg`; - preloadImages(this.$els).done(images => { - images.map((image, index) => { - this.$els[index].src = this.getDataURL(image); - }); +blurify.prototype.useCSSMode = function () { + this.$els.map(el => { + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); + el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`; + }); +}; + +blurify.prototype.useCanvasMode = function () { + this.imageType = this.options.imageType || `image/jpeg`; + preload(this.$els).done(images => { + images.map((image, index) => { + this.$els[index].src = this.getDataURL(image); }); - } + }); +}; - blurify(canvas, blur) { - let ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * blur); - for (let y = -blur; y <= blur; y += 2) { - for (let x = -blur; x <= blur; x += 2) { - ctx.drawImage(canvas, x, y); - if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); - } +blurify.prototype.blurify = function(canvas, blur) { + let ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * blur); + for (let y = -blur; y <= blur; y += 2) { + for (let x = -blur; x <= blur; x += 2) { + ctx.drawImage(canvas, x, y); + if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); } - ctx.globalAlpha = 1; } + ctx.globalAlpha = 1; +}; - getDataURL(image) { - let canvas = document.createElement('canvas'), - ctx = canvas.getContext('2d'); +blurify.prototype.getDataURL = function(image) { + let canvas = document.createElement('canvas'), + ctx = canvas.getContext('2d'); - canvas.width = image.width; - canvas.height = image.height; - ctx.drawImage(image, 0, 0); - this.blurify(canvas, this.blur); - return canvas.toDataURL(this.imageType); - } -} + canvas.width = image.width; + canvas.height = image.height; + ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); + return canvas.toDataURL(this.imageType); +}; diff --git a/src/utils.js b/src/utils.js index 8382e9a..cbb6df1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,44 +1,43 @@ -export function preloadImages(images) { - let newimages = [], - loadedImagesCount = 0, - postAction = function () {}; +export function preload(imageUrls) { + let images = [], + count = 0, + doneAction = function () {}; - images = (typeof images != 'object') ? [images] : images; + imageUrls = (typeof imageUrls != 'object') ? [imageUrls] : imageUrls; - function imageLoadPost() { - loadedImagesCount++; - if (loadedImagesCount == images.length) postAction(newimages); - } + imageUrls.length === 0 && doneAction(images); - images.map((image, i) => { - newimages[i] = new Image(); - newimages[i].crossOrigin = '*'; - newimages[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - newimages[i].onload = function () { - imageLoadPost(); - }; - newimages[i].onerror = function () { - imageLoadPost(); - }; + imageUrls.map((image, i) => { + images[i] = new Image(); + images[i].crossOrigin = '*'; + images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + images[i].onload = imageLoad; + images[i].onerror = imageLoad; }); + function imageLoad() { + count++; + if (count == imageUrls.length) doneAction(images); + } + return { - done(callback) { - postAction = callback || postAction; + done() { + doneAction = arguments[0] || doneAction; }, }; } -export function cssSupport(...args) { - let el = document.createElement('div'), - property = args[0], - value = args[1]; - if (args.length === 1) { - return property in el.style ? true : false; - } else if (args.length === 2) { - el.style[property] = value; - return el.style[property] ? true : false; - } else { - return false; +export function cssSupport() { + const el = document.createElement('div'); + const property = arguments[0]; + + switch (arguments.length) { + case 1: + return property in el.style ? true : false; + case 2: + el.style[property] = arguments[1]; + return el.style[property] ? true : false; + default: + return false; } } From d2dbf83218b258cd20c6994811607d4f1b0ea33e Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Mon, 7 Aug 2017 01:49:54 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=F0=9F=93=9D=20update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 5493546..bb5f1de 100644 --- a/README.md +++ b/README.md @@ -43,29 +43,6 @@ new blurify({ blurify(6, document.querySelectorAll('.blurify')); ``` -## Change log +### License -#### v1.1.0 -- refactor - -#### v1.0.8 -- fixed [#2](https://github.com/JustClear/blurify/issues/2) - -#### v1.0.7 -- fault-tolerance process -- set globalAlpha dynamicly based on blur radius - -#### v1.0.6 -- fixed `toArray` bugs - -#### v1.0.5 -- add `auto` mode - -#### v1.0.4 -- add `css` mode - -#### v1.0.3 -- fixed image cross origin issue - -#### v1.0.2 -- fixed images reference error +Licensed under the [MIT License](https://github.com/JustClear/blurify/blob/master/LICENSE) From 5ad9ff783f3c8fccfb0394e5884bdcc54993844f Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Mon, 7 Aug 2017 01:51:31 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E2=9C=A8=20add=20`CHANGELOG.md`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..603ab22 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change log + +- v1.1.0 + - refactor + +- v1.0.8 + - fixed [#2](https://github.com/JustClear/blurify/issues/2) + +- v1.0.7 + - fault-tolerance process + - set globalAlpha dynamicly based on blur radius + +- v1.0.6 + - fixed `toArray` bugs + +- v1.0.5 + - add `auto` mode + +- v1.0.4 + - add `css` mode + +- v1.0.3 + - fixed image cross origin issue + +- v1.0.2 + - fixed images reference error From d79c19d3008529afed5f68331b2c5a3e07d1b0b3 Mon Sep 17 00:00:00 2001 From: JustClear <576839360@qq.com> Date: Mon, 7 Aug 2017 01:52:40 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=F0=9F=93=9D=20fix:=20#8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..880f6e0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 大板栗 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 30229f08c81ab147151fda09a51c2c821040be75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= <576839360@qq.com> Date: Mon, 24 Sep 2018 20:28:57 +0800 Subject: [PATCH 14/20] update --- .babelrc | 2 +- README.md | 2 +- dist/blurify.js | 192 ++- dist/blurify.js.map | 2 +- dist/blurify.min.js | 2 - dist/blurify.min.js.map | 1 - package.json | 30 +- rollup.config.js | 48 +- src/{utils.js => common.js} | 24 +- src/index.js | 13 +- webpack.config.babel.js | 24 - yarn.lock | 2244 ++++++++++------------------------- 12 files changed, 793 insertions(+), 1791 deletions(-) delete mode 100644 dist/blurify.min.js delete mode 100644 dist/blurify.min.js.map rename src/{utils.js => common.js} (51%) delete mode 100644 webpack.config.babel.js diff --git a/.babelrc b/.babelrc index a581d15..b493c2f 100644 --- a/.babelrc +++ b/.babelrc @@ -1,7 +1,7 @@ { "presets": [ [ - "es2015", + "env", { "modules": false } diff --git a/README.md b/README.md index bb5f1de..38ecb7a 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ blurify.js is a tiny(~2kb) library to blur pictures, with graceful downgrade sup $ npm i blurify ``` -## Demo +## DEMO [Demo](https://justclear.github.io/blurify/) diff --git a/dist/blurify.js b/dist/blurify.js index c8feddb..2c43486 100644 --- a/dist/blurify.js +++ b/dist/blurify.js @@ -1,125 +1,121 @@ (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define('blurify', factory) : - (global.blurify = factory()); + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.blurify = factory()); }(this, (function () { 'use strict'; -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + function preload(imageURLs) { + const images = []; + let count = 0, + doneAction = () => {}; -function preload(imageUrls) { - var images = [], - count = 0, - doneAction = function doneAction() {}; + imageURLs = (typeof imageURLs != 'object') ? [imageURLs] : imageURLs; - imageUrls = (typeof imageUrls === 'undefined' ? 'undefined' : _typeof(imageUrls)) != 'object' ? [imageUrls] : imageUrls; + imageURLs.length === 0 && doneAction(images); - imageUrls.length === 0 && doneAction(images); + imageURLs.map((image, i) => { + images[i] = new Image(); + images[i].crossOrigin = '*'; + images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + images[i].onload = imageLoad; + images[i].onerror = imageLoad; + }); - imageUrls.map(function (image, i) { - images[i] = new Image(); - images[i].crossOrigin = '*'; - images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - images[i].onload = imageLoad; - images[i].onerror = imageLoad; - }); + function imageLoad() { + count++; + if (count == imageURLs.length) doneAction(images); + } - function imageLoad() { - count++; - if (count == imageUrls.length) doneAction(images); + return { + done() { + doneAction = arguments[0] || doneAction; + }, + }; } - return { - done: function done() { - doneAction = arguments[0] || doneAction; + function cssSupport() { + const element = document.createElement('div'); + const property = arguments[0]; + + switch (arguments.length) { + case 1: + return property in element.style ? true : false; + case 2: + element.style[property] = arguments[1]; + return element.style[property] ? true : false; + default: + return false; } - }; -} - -function cssSupport() { - var el = document.createElement('div'); - var property = arguments[0]; - - switch (arguments.length) { - case 1: - return property in el.style ? true : false; - case 2: - el.style[property] = arguments[1]; - return el.style[property] ? true : false; - default: - return false; } -} -function blurify(options) { - if (!(this instanceof blurify)) return new (Function.prototype.bind.apply(blurify, [null].concat(Array.prototype.slice.call(arguments))))(); + function blurify(options) { + if (!(this instanceof blurify)) return new blurify(...arguments); - if (typeof options === 'number') { - options = { - blur: options, - images: arguments[1], - mode: 'auto' - }; - } + if (typeof options === 'number') { + options = { + blur: options, + images: arguments[1], + mode: 'auto', + }; + } - this.options = options; - this.blur = options.blur || 6; - this.mode = options.mode || 'css'; - this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); - - if (this.mode == 'auto') { - cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); - } else if (this.mode == 'css') { - this.blur = this.blur / 2; - this.useCSSMode(); - } else { - this.useCanvasMode(); + this.options = options; + this.blur = options.blur || 6; + this.mode = options.mode || 'css'; + this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); + + if (this.mode == 'auto') { + cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); + } else if (this.mode == 'css') { + this.blur = this.blur / 2; + this.useCSSMode(); + } else { + this.useCanvasMode(); + } } -} - -blurify.prototype.useCSSMode = function () { - var _this = this; - this.$els.map(function (el) { - el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); - el.style['filter'] = el.style['-webkit-filter'] = 'blur(' + _this.blur + 'px)'; - }); -}; + blurify.prototype.useCSSMode = function () { + this.$els.map(el => { + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); + el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`; + }); + }; -blurify.prototype.useCanvasMode = function () { - var _this2 = this; + blurify.prototype.useCanvasMode = function () { + this.imageType = this.options.imageType || `image/jpeg`; - this.imageType = this.options.imageType || 'image/jpeg'; - preload(this.$els).done(function (images) { - images.map(function (image, index) { - _this2.$els[index].src = _this2.getDataURL(image); + preload(this.$els).done(images => { + images.map((image, index) => { + this.$els[index].src = this.getDataURL(image); + }); }); - }); -}; - -blurify.prototype.blurify = function (canvas, blur) { - var ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * blur); - for (var y = -blur; y <= blur; y += 2) { - for (var x = -blur; x <= blur; x += 2) { - ctx.drawImage(canvas, x, y); - if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); + }; + + blurify.prototype.blurify = function(canvas, blur) { + const ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * blur); + for (let y = -blur; y <= blur; y += 2) { + for (let x = -blur; x <= blur; x += 2) { + ctx.drawImage(canvas, x, y); + if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); + } } - } - ctx.globalAlpha = 1; -}; + ctx.globalAlpha = 1; + }; -blurify.prototype.getDataURL = function (image) { - var canvas = document.createElement('canvas'), - ctx = canvas.getContext('2d'); + blurify.prototype.getDataURL = function(image) { + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); - canvas.width = image.width; - canvas.height = image.height; - ctx.drawImage(image, 0, 0); - this.blurify(canvas, this.blur); - return canvas.toDataURL(this.imageType); -}; + canvas.width = image.width; + canvas.height = image.height; + ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); + + return canvas.toDataURL(this.imageType); + }; -return blurify; + return blurify; }))); //# sourceMappingURL=blurify.js.map diff --git a/dist/blurify.js.map b/dist/blurify.js.map index 3fbf866..da9f0b9 100644 --- a/dist/blurify.js.map +++ b/dist/blurify.js.map @@ -1 +1 @@ -{"version":3,"file":"blurify.js","sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preload(imageUrls) {\n let images = [],\n count = 0,\n doneAction = function () {};\n\n imageUrls = (typeof imageUrls != 'object') ? [imageUrls] : imageUrls;\n\n imageUrls.length === 0 && doneAction(images);\n\n imageUrls.map((image, i) => {\n images[i] = new Image();\n images[i].crossOrigin = '*';\n images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n images[i].onload = imageLoad;\n images[i].onerror = imageLoad;\n });\n\n function imageLoad() {\n count++;\n if (count == imageUrls.length) doneAction(images);\n }\n\n return {\n done() {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport() {\n const el = document.createElement('div');\n const property = arguments[0];\n\n switch (arguments.length) {\n case 1:\n return property in el.style ? true : false;\n case 2:\n el.style[property] = arguments[1];\n return el.style[property] ? true : false;\n default:\n return false;\n }\n}\n","import {\n preload,\n cssSupport,\n} from './utils';\n\nexport default function blurify(options) {\n if (!(this instanceof blurify)) return new blurify(...arguments);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function () {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function () {\n this.imageType = this.options.imageType || `image/jpeg`;\n preload(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","imageUrls","images","count","doneAction","length","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","imageLoad","onerror","arguments","cssSupport","el","document","createElement","property","style","blurify","options","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","imageType","done","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":";;;;;;;;AAAA,AAAO,SAASA,OAAT,CAAiBC,SAAjB,EAA4B;QAC3BC,SAAS,EAAb;QACIC,QAAQ,CADZ;QAEIC,aAAa,sBAAY,EAF7B;;gBAIa,QAAOH,SAAP,yCAAOA,SAAP,MAAoB,QAArB,GAAiC,CAACA,SAAD,CAAjC,GAA+CA,SAA3D;;cAEUI,MAAV,KAAqB,CAArB,IAA0BD,WAAWF,MAAX,CAA1B;;cAEUI,GAAV,CAAc,UAACC,KAAD,EAAQC,CAAR,EAAc;eACjBA,CAAP,IAAY,IAAIC,KAAJ,EAAZ;eACOD,CAAP,EAAUE,WAAV,GAAwB,GAAxB;eACOF,CAAP,EAAUG,GAAV,GAAgBJ,MAAMK,OAAN,GAAgBL,MAAMK,OAAN,CAAcD,GAA9B,GAAoCJ,MAAMM,YAAN,CAAmB,UAAnB,CAApD;eACOL,CAAP,EAAUM,MAAV,GAAmBC,SAAnB;eACOP,CAAP,EAAUQ,OAAV,GAAoBD,SAApB;KALJ;;aAQSA,SAAT,GAAqB;;YAEbZ,SAASF,UA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AlB,GAA+B,UAAS/B,KAAT,EAAgB;QACvCgC,SAASnB,SAASC,aAAT,CAAuB,QAAvB,CAAb;QACImB,MAAMD,OAAOE,UAAP,CAAkB,IAAlB,CADV;;WAGOK,KAAP,GAAevC,MAAMuC,KAArB;WACOC,MAAP,GAAgBxC,MAAMwC,MAAtB;QACIF,SAAJ,CAActC,KAAd,EAAqB,CAArB,EAAwB,CAAxB;SACKiB,OAAL,CAAae,MAAb,EAAqB,KAAKb,IAA1B;WACOa,OAAOS,SAAP,CAAiB,KAAKb,SAAtB,CAAP;CARJ;;;;"} \ No newline at end of file +{"version":3,"file":"blurify.js","sources":["../src/common.js","../src/index.js"],"sourcesContent":["export function preload(imageURLs) {\n const images = [];\n let count = 0,\n doneAction = () => {};\n\n imageURLs = (typeof imageURLs != 'object') ? [imageURLs] : imageURLs;\n\n imageURLs.length === 0 && doneAction(images);\n\n imageURLs.map((image, i) => {\n images[i] = new Image();\n images[i].crossOrigin = '*';\n images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n images[i].onload = imageLoad;\n images[i].onerror = imageLoad;\n });\n\n function imageLoad() {\n count++;\n if (count == imageURLs.length) doneAction(images);\n }\n\n return {\n done() {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport() {\n const element = document.createElement('div');\n const property = arguments[0];\n\n switch (arguments.length) {\n case 1:\n return property in element.style ? true : false;\n case 2:\n element.style[property] = arguments[1];\n return element.style[property] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options) {\n if (!(this instanceof blurify)) return new blurify(...arguments);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function () {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function () {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function(canvas, blur) {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":[],"mappings":";;;;;;IAAO,SAAS,OAAO,CAAC,SAAS,EAAE;IACnC,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;IACtB,IAAI,IAAI,KAAK,GAAG,CAAC;IACjB,QAAQ,UAAU,GAAG,MAAM,EAAE,CAAC;;IAE9B,IAAI,SAAS,GAAG,CAAC,OAAO,SAAS,IAAI,QAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;;IAEzE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;;IAEjD,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK;IAChC,QAAQ,MAAM,CAAC,CAAC,CAAC,GAAG,I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CAAC,EAAE;IAC3C,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE;IAC/C,YAAY,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,YAAY,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5E,SAAS;IACT,KAAK;IACL,IAAI,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC;;IAEF,OAAO,CAAC,SAAS,CAAC,UAAU,GAAG,SAAS,KAAK,EAAE;IAC/C,IAAI,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;;IAExC,IAAI,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC/B,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;IAEpC,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/dist/blurify.min.js b/dist/blurify.min.js deleted file mode 100644 index 58889fd..0000000 --- a/dist/blurify.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define("blurify",e):t.blurify=e()}(this,function(){"use strict";function t(t){function e(){i++,i==t.length&&r(o)}var o=[],i=0,r=function(){};return t="object"!=(void 0===t?"undefined":n(t))?[t]:t,0===t.length&&r(o),t.map(function(t,n){o[n]=new Image,o[n].crossOrigin="*",o[n].src=t.dataset?t.dataset.src:t.getAttribute("data-src"),o[n].onload=e,o[n].onerror=e}),{done:function(){r=arguments[0]||r}}}function e(){var t=document.createElement("div"),e=arguments[0];switch(arguments.length){case 1:return e in t.style;case 2:return t.style[e]=arguments[1],!!t.style[e];default:return!1}}function o(t){if(!(this instanceof o))return new(Function.prototype.bind.apply(o,[null].concat(Array.prototype.slice.call(arguments))));"number"==typeof t&&(t={blur:t,images:arguments[1],mode:"auto"}),this.options=t,this.blur=t.blur||6,this.mode=t.mode||"css",this.$els=1===t.images.nodeType?[t.images]:[].slice.call(t.images),"auto"==this.mode?e("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur=this.blur/2,this.useCSSMode()):this.useCanvasMode()}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};return o.prototype.useCSSMode=function(){var t=this;this.$els.map(function(e){e.src=e.dataset?e.dataset.src:e.getAttribute("data-src"),e.style.filter=e.style["-webkit-filter"]="blur("+t.blur+"px)"})},o.prototype.useCanvasMode=function(){var e=this;this.imageType=this.options.imageType||"image/jpeg",t(this.$els).done(function(t){t.map(function(t,o){e.$els[o].src=e.getDataURL(t)})})},o.prototype.blurify=function(t,e){var o=t.getContext("2d");o.globalAlpha=1/(2*e);for(var n=-e;n<=e;n+=2)for(var i=-e;i<=e;i+=2)o.drawImage(t,i,n),i>=0&&n>=0&&o.drawImage(t,-(i-1),-(n-1));o.globalAlpha=1},o.prototype.getDataURL=function(t){var e=document.createElement("canvas"),o=e.getContext("2d");return e.width=t.width,e.height=t.height,o.drawImage(t,0,0),this.blurify(e,this.blur),e.toDataURL(this.imageType)},o}); -//# sourceMappingURL=blurify.min.js.map diff --git a/dist/blurify.min.js.map b/dist/blurify.min.js.map deleted file mode 100644 index c057e3a..0000000 --- a/dist/blurify.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blurify.min.js","sources":["../src/utils.js","../src/index.js"],"sourcesContent":["export function preload(imageUrls) {\n let images = [],\n count = 0,\n doneAction = function () {};\n\n imageUrls = (typeof imageUrls != 'object') ? [imageUrls] : imageUrls;\n\n imageUrls.length === 0 && doneAction(images);\n\n imageUrls.map((image, i) => {\n images[i] = new Image();\n images[i].crossOrigin = '*';\n images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n images[i].onload = imageLoad;\n images[i].onerror = imageLoad;\n });\n\n function imageLoad() {\n count++;\n if (count == imageUrls.length) doneAction(images);\n }\n\n return {\n done() {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport() {\n const el = document.createElement('div');\n const property = arguments[0];\n\n switch (arguments.length) {\n case 1:\n return property in el.style ? true : false;\n case 2:\n el.style[property] = arguments[1];\n return el.style[property] ? true : false;\n default:\n return false;\n }\n}\n","import {\n preload,\n cssSupport,\n} from './utils';\n\nexport default function blurify(options) {\n if (!(this instanceof blurify)) return new blurify(...arguments);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function () {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function () {\n this.imageType = this.options.imageType || `image/jpeg`;\n preload(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function(canvas, blur) {\n let ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image) {\n let canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","imageUrls","imageLoad","count","length","doneAction","images","map","image","i","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","arguments","cssSupport","el","document","createElement","property","style","blurify","options","this","blur","mode","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","_this","imageType","done","index","_this2","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":"4LAAA,SAAgBA,GAAQC,WAiBXC,SAEDC,GAASF,EAAUG,QAAQC,EAAWC,MAlB1CA,MACAH,EAAQ,EACRE,EAAa,sBAEgB,oBAAbJ,gBAAAA,KAA0BA,GAAaA,EAEtC,MAAXG,QAAgBC,EAAWC,KAE3BC,IAAI,SAACC,EAAOC,KACXA,GAAK,GAAIC,SACTD,GAAGE,YAAc,MACjBF,GAAGG,IAAMJ,EAAMK,QAAUL,EAAMK,QAAQD,IAAMJ,EAAMM,aAAa,cAChEL,GAAGM,OAASb,IACZO,GAAGO,QAAUd,uBAUHe,UAAU,IAAMZ,IAKzC,QAAgBa,QACNC,GAAKC,SAASC,c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cAAc,UAChCsB,EAAMD,EAAOE,WAAW,eAErBK,MAAQzC,EAAMyC,QACdC,OAAS1C,EAAM0C,SAClBF,UAAUxC,EAAO,EAAG,QACnBgB,QAAQkB,EAAQhB,KAAKC,MACnBe,EAAOS,UAAUzB,KAAKW"} \ No newline at end of file diff --git a/package.json b/package.json index 03625fd..bcb6b80 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,14 @@ "version": "1.1.0", "description": "Image blurify.", "main": "dist/blurify.js", + "moduleName": "blurify", "scripts": { "test": "mocha test/index.js", - "start": "http-server", - "dev": "NODE_ENV=development rollup -c rollup.config.js", + "start": "npm run watch", "watch": "NODE_ENV=development rollup -w -c rollup.config.js", + "dev": "NODE_ENV=development rollup -c rollup.config.js", "prod": "NODE_ENV=production rollup -c rollup.config.js", - "publish": "rm -rf dist && npm run dev && npm run prod && npm run lint", - "dev:webpack": "NODE_ENV=development webpack", - "watch:webpack": "NODE_ENV=development webpack -w", - "prod:webpack": "NODE_ENV=production webpack -p", + "publish": "rm -rf dist && npm run dev && npm run prod", "lint": "eslint src" }, "repository": { @@ -30,18 +28,18 @@ }, "homepage": "https://github.com/JustClear/blurify#readme", "devDependencies": { - "babel-core": "^6.23.1", - "babel-eslint": "^7.1.1", - "babel-loader": "^6.3.2", - "babel-plugin-transform-object-rest-spread": "^6.23.0", - "babel-preset-es2015": "^6.22.0", - "babel-preset-es2015-rollup": "^3.0.0", + "@babel/core": "^7.1.0", + "babel-eslint": "^9.0.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.7.0", "eslint": "^3.16.1", - "path": "^0.12.7", - "rollup-plugin-babel": "^2.7.1", + "expect.js": "^0.3.1", + "mocha": "^5.2.0", + "rollup-plugin-babel": "^4.0.3", + "rollup-plugin-commonjs": "^9.1.8", + "rollup-plugin-node-resolve": "^3.4.0", "rollup-plugin-sourcemaps": "^0.4.1", "rollup-plugin-uglify": "^1.0.1", - "rollup-watch": "^3.2.2", - "webpack": "^2.2.1" + "rollup-watch": "^3.2.2" } } diff --git a/rollup.config.js b/rollup.config.js index 9ecfd4b..98d5c25 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,42 +1,26 @@ -// -// Rollup configure file -// - -import babel from 'rollup-plugin-babel'; +import resolve from 'rollup-plugin-node-resolve'; +import commonjs from 'rollup-plugin-commonjs'; import uglify from 'rollup-plugin-uglify'; import sourcemaps from 'rollup-plugin-sourcemaps'; -const paths = { - root: '/', - source: { - root: './src/', - modules: './src/modules/', - }, - dist: { - root: './dist/', - }, -}; - -let fileName, - Configure; - -fileName = process.env.NODE_ENV === 'development' ? 'blurify' : 'blurify.min'; +const packages = require('./package.json'); +const fileName = process.env.NODE_ENV === 'development' ? packages.moduleName : `${packages.moduleName}.min`; -Configure = { - format: 'umd', // 'amd', 'cjs', 'es', 'iife', 'umd' - moduleName: 'blurify', - moduleId: 'blurify', - entry: `${paths.source.root}index.js`, - dest: `${paths.dist.root}${fileName}.js`, - sourceMap: true, +const configure = { + input: `src/index.js`, + output: [{ + format: 'umd', + name: fileName, + sourcemap: true, + file: `dist/${fileName.toLowerCase()}.js`, + }], plugins: [ - babel(), + resolve(), + commonjs(), sourcemaps(), ], }; -if (process.env.NODE_ENV === 'production') { - Configure.plugins.push(uglify()); -} +if (process.env.NODE_ENV === 'production') configure.plugins.push(uglify()); -export default Configure; +export default configure; diff --git a/src/utils.js b/src/common.js similarity index 51% rename from src/utils.js rename to src/common.js index cbb6df1..abe3608 100644 --- a/src/utils.js +++ b/src/common.js @@ -1,13 +1,13 @@ -export function preload(imageUrls) { - let images = [], - count = 0, - doneAction = function () {}; +export function preload(imageURLs) { + const images = []; + let count = 0, + doneAction = () => {}; - imageUrls = (typeof imageUrls != 'object') ? [imageUrls] : imageUrls; + imageURLs = (typeof imageURLs != 'object') ? [imageURLs] : imageURLs; - imageUrls.length === 0 && doneAction(images); + imageURLs.length === 0 && doneAction(images); - imageUrls.map((image, i) => { + imageURLs.map((image, i) => { images[i] = new Image(); images[i].crossOrigin = '*'; images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); @@ -17,7 +17,7 @@ export function preload(imageUrls) { function imageLoad() { count++; - if (count == imageUrls.length) doneAction(images); + if (count == imageURLs.length) doneAction(images); } return { @@ -28,15 +28,15 @@ export function preload(imageUrls) { } export function cssSupport() { - const el = document.createElement('div'); + const element = document.createElement('div'); const property = arguments[0]; switch (arguments.length) { case 1: - return property in el.style ? true : false; + return property in element.style ? true : false; case 2: - el.style[property] = arguments[1]; - return el.style[property] ? true : false; + element.style[property] = arguments[1]; + return element.style[property] ? true : false; default: return false; } diff --git a/src/index.js b/src/index.js index 203933c..1f8ab06 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,4 @@ -import { - preload, - cssSupport, -} from './utils'; +import { preload, cssSupport } from './common'; export default function blurify(options) { if (!(this instanceof blurify)) return new blurify(...arguments); @@ -38,6 +35,7 @@ blurify.prototype.useCSSMode = function () { blurify.prototype.useCanvasMode = function () { this.imageType = this.options.imageType || `image/jpeg`; + preload(this.$els).done(images => { images.map((image, index) => { this.$els[index].src = this.getDataURL(image); @@ -46,7 +44,7 @@ blurify.prototype.useCanvasMode = function () { }; blurify.prototype.blurify = function(canvas, blur) { - let ctx = canvas.getContext('2d'); + const ctx = canvas.getContext('2d'); ctx.globalAlpha = 1 / (2 * blur); for (let y = -blur; y <= blur; y += 2) { for (let x = -blur; x <= blur; x += 2) { @@ -58,12 +56,13 @@ blurify.prototype.blurify = function(canvas, blur) { }; blurify.prototype.getDataURL = function(image) { - let canvas = document.createElement('canvas'), - ctx = canvas.getContext('2d'); + const canvas = document.createElement('canvas'); + const ctx = canvas.getContext('2d'); canvas.width = image.width; canvas.height = image.height; ctx.drawImage(image, 0, 0); this.blurify(canvas, this.blur); + return canvas.toDataURL(this.imageType); }; diff --git a/webpack.config.babel.js b/webpack.config.babel.js deleted file mode 100644 index a1f1305..0000000 --- a/webpack.config.babel.js +++ /dev/null @@ -1,24 +0,0 @@ -export default { - entry: { - 'blurify': [ - './src/index.js', - ], - 'blurify.min': [ - './src/index.js', - ], - }, - output: { - path: './dist', - filename: '[name].js?[hash:8]', - }, - module: { - loaders: [{ - test: /\.(js|es6)$/, - loader: 'babel-loader', - exclude: /node_modules/, - }], - }, - resolve: { - extensions: ['.js', '.es6', '.scss', '.css'], - }, -}; diff --git a/yarn.lock b/yarn.lock index 5b2a794..4bd3ae8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,14 +1,117 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 -abbrev@1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" -acorn-dynamic-import@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@^7.1.0": + version "7.1.0" + resolved "http://registry.npm.taobao.org/@babel/core/download/@babel/core-7.1.0.tgz#08958f1371179f62df6966d8a614003d11faeb04" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.0.0" + "@babel/helpers" "^7.1.0" + "@babel/parser" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + convert-source-map "^1.1.0" + debug "^3.1.0" + json5 "^0.5.0" + lodash "^4.17.10" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.0.0.tgz#1efd58bffa951dc846449e58ce3a1d7f02d393aa" + dependencies: + "@babel/types" "^7.0.0" + jsesc "^2.5.1" + lodash "^4.17.10" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "http://registry.npm.taobao.org/@babel/helper-function-name/download/@babel/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-imports@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/helper-module-imports/download/@babel/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helpers@^7.1.0": + version "7.1.0" + resolved "http://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.1.0.tgz#429bf0f0020be56a4242883432084e3d70a8a141" + dependencies: + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0": + version "7.1.0" + resolved "http://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e" + +"@babel/template@^7.1.0": + version "7.1.0" + resolved "http://registry.npm.taobao.org/@babel/template/download/@babel/template-7.1.0.tgz#58cc9572e1bfe24fe1537fdf99d839d53e517e22" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0": + version "7.1.0" + resolved "http://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.1.0.tgz#503ec6669387efd182c3888c4eec07bcc45d91b2" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.0.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + debug "^3.1.0" + globals "^11.1.0" + lodash "^4.17.10" + +"@babel/types@^7.0.0": + version "7.0.0" + resolved "http://registry.npm.taobao.org/@babel/types/download/@babel/types-7.0.0.tgz#6e191793d3c854d19c6749989e3bc55f0e962118" dependencies: - acorn "^4.0.3" + esutils "^2.0.2" + lodash "^4.17.10" + to-fast-properties "^2.0.0" acorn-jsx@^3.0.0: version "3.0.1" @@ -16,19 +119,15 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^4.0.3, acorn@^4.0.4: - version "4.0.11" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" - acorn@4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" -ajv-keywords@^1.0.0, ajv-keywords@^1.1.1: +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -59,23 +158,11 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -anymatch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" - dependencies: - arrify "^1.0.0" - micromatch "^2.1.5" - -aproba@^1.0.3: - version "1.1.1" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" - -are-we-there-yet@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" +ansi-styles@^3.2.1: + version "3.2.1" + resolved "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: - delegates "^1.0.0" - readable-stream "^2.0.0 || ^1.1.13" + color-convert "^1.9.0" argparse@^1.0.7: version "1.0.9" @@ -111,63 +198,15 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -asn1.js@^4.0.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.1.tgz#48ba240b45a9280e94748990ba597d216617fd40" - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" - -assert-plus@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" - -assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - -assert@^1.1.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" - dependencies: - util "0.10.3" - -async-each@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" - -async@^2.1.2: - version "2.1.5" - resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc" - dependencies: - lodash "^4.14.0" - async@~0.2.6: version "0.2.10" resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - atob@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" -aws-sign2@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" - -aws4@^1.2.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" - -babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: +babel-code-frame@^6.16.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -175,477 +214,437 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core, babel-core@^6.23.0, babel-core@6: - version "6.23.1" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.23.1.tgz#c143cb621bb2f621710c220c5d579d15b8a442df" +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: - babel-code-frame "^6.22.0" - babel-generator "^6.23.0" - babel-helpers "^6.23.0" - babel-messages "^6.23.0" - babel-register "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.1" - babel-types "^6.23.0" - babylon "^6.11.0" - convert-source-map "^1.1.0" - debug "^2.1.1" - json5 "^0.5.0" - lodash "^4.2.0" - minimatch "^3.0.2" - path-is-absolute "^1.0.0" - private "^0.1.6" - slash "^1.0.0" - source-map "^0.5.0" + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" -babel-eslint: - version "7.1.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" +babel-eslint@^9.0.0: + version "9.0.0" + resolved "http://registry.npm.taobao.org/babel-eslint/download/babel-eslint-9.0.0.tgz#7d9445f81ed9f60aff38115f838970df9f2b6220" dependencies: - babel-code-frame "^6.16.0" - babel-traverse "^6.15.0" - babel-types "^6.15.0" - babylon "^6.13.0" - lodash.pickby "^4.6.0" + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + eslint-scope "3.7.1" + eslint-visitor-keys "^1.0.0" -babel-generator@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.23.0.tgz#6b8edab956ef3116f79d8c84c5a3c05f32a74bc5" +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-builder-binary-assignment-operator-visitor/download/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" dependencies: - babel-messages "^6.23.0" + babel-helper-explode-assignable-expression "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.23.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" + babel-types "^6.24.1" -babel-helper-call-delegate@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.22.0.tgz#119921b56120f17e9dae3f74b4f5cc7bcc1b37ef" +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-call-delegate/download/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" dependencies: - babel-helper-hoist-variables "^6.22.0" + babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" - babel-traverse "^6.22.0" - babel-types "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-helper-define-map@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.23.0.tgz#1444f960c9691d69a2ced6a205315f8fd00804e7" +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-helper-define-map/download/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" dependencies: - babel-helper-function-name "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.23.0" - lodash "^4.2.0" + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" -babel-helper-function-name@^6.22.0, babel-helper-function-name@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.23.0.tgz#25742d67175c8903dbe4b6cb9d9e1fcb8dcf23a6" +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-explode-assignable-expression/download/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" dependencies: - babel-helper-get-function-arity "^6.22.0" babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-helper-get-function-arity@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.22.0.tgz#0beb464ad69dc7347410ac6ade9f03a50634f5ce" +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-function-name/download/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" dependencies: + babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-helper-hoist-variables@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.22.0.tgz#3eacbf731d80705845dd2e9718f600cfb9b4ba72" +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-get-function-arity/download/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" -babel-helper-optimise-call-expression@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.23.0.tgz#f3ee7eed355b4282138b33d02b78369e470622f5" +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-hoist-variables/download/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" dependencies: babel-runtime "^6.22.0" - babel-types "^6.23.0" + babel-types "^6.24.1" -babel-helper-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.22.0.tgz#79f532be1647b1f0ee3474b5f5c3da58001d247d" +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-optimise-call-expression/download/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" - lodash "^4.2.0" + babel-types "^6.24.1" -babel-helper-replace-supers@^6.22.0, babel-helper-replace-supers@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.23.0.tgz#eeaf8ad9b58ec4337ca94223bacdca1f8d9b4bfd" +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-helper-regex/download/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" dependencies: - babel-helper-optimise-call-expression "^6.23.0" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" -babel-helpers@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.23.0.tgz#4f8f2e092d0b6a8808a4bde79c27f1e2ecf0d992" +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-remap-async-to-generator/download/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" dependencies: + babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.23.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" -babel-loader: - version "6.3.2" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-6.3.2.tgz#18de4566385578c1b4f8ffe6cbc668f5e2a5ef03" +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-helper-replace-supers/download/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" dependencies: - find-cache-dir "^0.1.1" - loader-utils "^0.2.16" - mkdirp "^0.5.1" - object-assign "^4.0.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babel-messages@^6.23.0: version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + resolved "http://registry.npm.taobao.org/babel-messages/download/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: babel-runtime "^6.22.0" babel-plugin-check-es2015-constants@^6.22.0: version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + resolved "http://registry.npm.taobao.org/babel-plugin-check-es2015-constants/download/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" dependencies: babel-runtime "^6.22.0" -babel-plugin-external-helpers@^6.18.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "http://registry.npm.taobao.org/babel-plugin-syntax-async-functions/download/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "http://registry.npm.taobao.org/babel-plugin-syntax-exponentiation-operator/download/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" - resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + resolved "http://registry.npm.taobao.org/babel-plugin-syntax-object-rest-spread/download/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "http://registry.npm.taobao.org/babel-plugin-syntax-trailing-function-commas/download/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.22.0: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-async-to-generator/download/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" babel-plugin-transform-es2015-arrow-functions@^6.22.0: version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-arrow-functions/download/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoped-functions/download/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.23.0.tgz#e48895cf0b375be148cd7c8879b422707a053b51" +babel-plugin-transform-es2015-block-scoping@^6.23.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoping/download/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" dependencies: - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" -babel-plugin-transform-es2015-classes@^6.22.0, babel-plugin-transform-es2015-classes@^6.9.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.23.0.tgz#49b53f326202a2fd1b3bbaa5e2edd8a4f78643c1" +babel-plugin-transform-es2015-classes@^6.23.0: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-classes/download/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" dependencies: - babel-helper-define-map "^6.23.0" - babel-helper-function-name "^6.23.0" - babel-helper-optimise-call-expression "^6.23.0" - babel-helper-replace-supers "^6.23.0" + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.22.0.tgz#7c383e9629bba4820c11b0425bdd6290f7f057e7" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-computed-properties/download/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" dependencies: babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" -babel-plugin-transform-es2015-destructuring@^6.22.0: +babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-destructuring/download/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.22.0.tgz#672397031c21610d72dd2bbb0ba9fb6277e1c36b" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-duplicate-keys/download/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" -babel-plugin-transform-es2015-for-of@^6.22.0: +babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-for-of/download/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.22.0.tgz#f5fcc8b09093f9a23c76ac3d9e392c3ec4b77104" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-function-name/download/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" dependencies: - babel-helper-function-name "^6.22.0" + babel-helper-function-name "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-literals@^6.22.0: version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-literals/download/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.22.0.tgz#bf69cd34889a41c33d90dfb740e0091ccff52f21" +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-amd/download/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.22.0" + babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-commonjs@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.23.0.tgz#cba7aa6379fb7ec99250e6d46de2973aaffa7b92" +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.2" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-commonjs/download/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" dependencies: - babel-plugin-transform-strict-mode "^6.22.0" - babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-types "^6.23.0" + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" -babel-plugin-transform-es2015-modules-systemjs@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.23.0.tgz#ae3469227ffac39b0310d90fec73bfdc4f6317b0" +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-systemjs/download/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" dependencies: - babel-helper-hoist-variables "^6.22.0" + babel-helper-hoist-variables "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.23.0" + babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-umd@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.23.0.tgz#8d284ae2e19ed8fe21d2b1b26d6e7e0fcd94f0f1" +babel-plugin-transform-es2015-modules-umd@^6.23.0: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-umd/download/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" dependencies: - babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.23.0" + babel-template "^6.24.1" babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.22.0.tgz#daa60e114a042ea769dd53fe528fc82311eb98fc" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-object-super/download/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" dependencies: - babel-helper-replace-supers "^6.22.0" + babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.23.0.tgz#3a2aabb70c8af945d5ce386f1a4250625a83ae3b" +babel-plugin-transform-es2015-parameters@^6.23.0: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-parameters/download/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" dependencies: - babel-helper-call-delegate "^6.22.0" - babel-helper-get-function-arity "^6.22.0" + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.23.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.22.0.tgz#8ba776e0affaa60bff21e921403b8a652a2ff723" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-shorthand-properties/download/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-spread@^6.22.0: version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-spread/download/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.22.0.tgz#ab316829e866ee3f4b9eb96939757d19a5bc4593" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-sticky-regex/download/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" dependencies: - babel-helper-regex "^6.22.0" + babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" babel-plugin-transform-es2015-template-literals@^6.22.0: version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-template-literals/download/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-typeof-symbol/download/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: babel-runtime "^6.22.0" babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.22.0.tgz#8d9cc27e7ee1decfe65454fb986452a04a613d20" + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-unicode-regex/download/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" dependencies: - babel-helper-regex "^6.22.0" + babel-helper-regex "^6.24.1" babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-object-rest-spread: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" +babel-plugin-transform-exponentiation-operator@^6.22.0: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-exponentiation-operator/download/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" babel-runtime "^6.22.0" +babel-plugin-transform-object-rest-spread@^6.26.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-object-rest-spread/download/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.26.0" + babel-plugin-transform-regenerator@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.22.0.tgz#65740593a319c44522157538d690b84094617ea6" + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-regenerator/download/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" dependencies: - regenerator-transform "0.9.8" + regenerator-transform "^0.10.0" -babel-plugin-transform-strict-mode@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.22.0.tgz#e008df01340fdc87e959da65991b7e05970c8c7c" +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "http://registry.npm.taobao.org/babel-plugin-transform-strict-mode/download/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" dependencies: babel-runtime "^6.22.0" - babel-types "^6.22.0" + babel-types "^6.24.1" -babel-preset-es2015, babel-preset-es2015@^6.3.13: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.22.0.tgz#af5a98ecb35eb8af764ad8a5a05eb36dc4386835" +babel-preset-env@^1.7.0: + version "1.7.0" + resolved "http://registry.npm.taobao.org/babel-preset-env/download/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" dependencies: babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.22.0" - babel-plugin-transform-es2015-classes "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" babel-plugin-transform-es2015-function-name "^6.22.0" babel-plugin-transform-es2015-literals "^6.22.0" babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.22.0" - babel-plugin-transform-es2015-modules-systemjs "^6.22.0" - babel-plugin-transform-es2015-modules-umd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" babel-plugin-transform-es2015-shorthand-properties "^6.22.0" babel-plugin-transform-es2015-spread "^6.22.0" babel-plugin-transform-es2015-sticky-regex "^6.22.0" babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" babel-plugin-transform-regenerator "^6.22.0" + browserslist "^3.2.6" + invariant "^2.2.2" + semver "^5.3.0" -babel-preset-es2015-rollup: - version "3.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-es2015-rollup/-/babel-preset-es2015-rollup-3.0.0.tgz#854b63ecde2ee98cac40e882f67bfcf185b1f24a" - dependencies: - babel-plugin-external-helpers "^6.18.0" - babel-preset-es2015 "^6.3.13" - require-relative "^0.8.7" - -babel-register@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.23.0.tgz#c9aa3d4cca94b51da34826c4a0f9e08145d74ff3" +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: - babel-core "^6.23.0" - babel-runtime "^6.22.0" core-js "^2.4.0" - home-or-tmp "^2.0.0" - lodash "^4.2.0" - mkdirp "^0.5.1" - source-map-support "^0.4.2" + regenerator-runtime "^0.11.0" -babel-runtime@^6.18.0, babel-runtime@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-template@^6.22.0, babel-template@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.23.0.tgz#04d4f270adbb3aa704a8143ae26faa529238e638" +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-template/download/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.23.0" - babel-types "^6.23.0" - babylon "^6.11.0" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" -babel-traverse@^6.15.0, babel-traverse@^6.22.0, babel-traverse@^6.23.0, babel-traverse@^6.23.1: - version "6.23.1" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-traverse/download/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: - babel-code-frame "^6.22.0" + babel-code-frame "^6.26.0" babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.23.0" - babylon "^6.15.0" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - -babel-types@^6.15.0, babel-types@^6.19.0, babel-types@^6.22.0, babel-types@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" - dependencies: - babel-runtime "^6.22.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "http://registry.npm.taobao.org/babel-types/download/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" + lodash "^4.17.4" + to-fast-properties "^1.0.3" -babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: - version "6.16.1" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" +babylon@^6.18.0: + version "6.18.0" + resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" -base64-js@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" - -bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" - dependencies: - tweetnacl "^0.14.3" - -big.js@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" - -binary-extensions@^1.0.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" - -block-stream@*: - version "0.0.9" - resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" - dependencies: - inherits "~2.0.0" - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: - version "4.11.6" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" - -boom@2.x.x: - version "2.10.1" - resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" - dependencies: - hoek "2.x.x" +balanced-match@^1.0.0: + version "1.0.0" + resolved "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" brace-expansion@^1.0.0: version "1.1.6" @@ -654,6 +653,13 @@ brace-expansion@^1.0.0: balanced-match "^0.4.1" concat-map "0.0.1" +brace-expansion@^1.1.7: + version "1.1.11" + resolved "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" @@ -662,84 +668,24 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -brorand@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" - dependencies: - buffer-xor "^1.0.2" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - inherits "^2.0.1" - -browserify-cipher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - -browserify-rsa@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" - dependencies: - bn.js "^4.1.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" - dependencies: - bn.js "^4.1.1" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.2" - elliptic "^6.0.0" - inherits "^2.0.1" - parse-asn1 "^5.0.0" +browser-stdout@1.3.1: + version "1.3.1" + resolved "http://registry.npm.taobao.org/browser-stdout/download/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" -browserify-zlib@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" +browserslist@^3.2.6: + version "3.2.8" + resolved "http://registry.npm.taobao.org/browserslist/download/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" dependencies: - pako "~0.2.0" + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" -buffer-xor@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - -buffer@^4.3.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" +builtin-modules@^2.0.0: + version "2.0.0" + resolved "http://registry.npm.taobao.org/builtin-modules/download/builtin-modules-2.0.0.tgz#60b7ef5ae6546bd7deefa74b08b62a43a232648e" caller-path@^0.1.0: version "0.1.0" @@ -755,13 +701,9 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caniuse-lite@^1.0.30000844: + version "1.0.30000887" + resolved "http://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30000887.tgz#1769458c27bbdcf61b0cb6b5072bb6cd11fd9c23" center-align@^0.1.1: version "0.1.3" @@ -780,26 +722,13 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.4.3: - version "1.6.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -cipher-base@^1.0.0, cipher-base@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" +chalk@^2.0.0: + version "2.4.1" + resolved "http://registry.npm.taobao.org/chalk/download/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: - inherits "^2.0.1" + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" circular-json@^0.3.1: version "0.3.1" @@ -823,14 +752,6 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -839,21 +760,19 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" +color-convert@^1.9.0: + version "1.9.3" + resolved "http://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" dependencies: - delayed-stream "~1.0.0" + color-name "1.1.3" -commander@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" +color-name@1.1.3: + version "1.1.3" + resolved "http://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" +commander@2.15.1: + version "2.15.1" + resolved "http://registry.npm.taobao.org/commander/download/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" concat-map@0.0.1: version "0.0.1" @@ -867,112 +786,54 @@ concat-stream@^1.4.6: readable-stream "^2.2.2" typedarray "^0.0.6" -console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - dependencies: - date-now "^0.1.4" - -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - convert-source-map@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.4.0.tgz#e3dad195bf61bfe13a7a3c73e9876ec14a0268f3" + version "1.6.0" + resolved "http://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + dependencies: + safe-buffer "~5.1.1" core-js@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + version "2.5.7" + resolved "http://registry.npm.taobao.org/core-js/download/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -create-ecdh@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" - dependencies: - bn.js "^4.1.0" - elliptic "^6.0.0" - -create-hash@^1.1.0, create-hash@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - ripemd160 "^1.0.0" - sha.js "^2.3.6" - -create-hmac@^1.1.0, create-hmac@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" - dependencies: - create-hash "^1.1.0" - inherits "^2.0.1" - -cryptiles@2.x.x: - version "2.0.5" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" - dependencies: - boom "2.x.x" - -crypto-browserify@^3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - d@^0.1.1, d@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" dependencies: es5-ext "~0.10.2" -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" +debug@3.1.0: + version "3.1.0" + resolved "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: - assert-plus "^1.0.0" + ms "2.0.0" -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - -debug@^2.1.1, debug@^2.2.0: +debug@^2.1.1: version "2.6.1" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" dependencies: ms "0.7.2" -debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" +debug@^2.6.8: + version "2.6.9" + resolved "http://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: - ms "0.7.1" + ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1: +debug@^3.1.0: + version "3.2.5" + resolved "http://registry.npm.taobao.org/debug/download/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407" + dependencies: + ms "^2.1.1" + +decamelize@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -deep-extend@~0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -989,34 +850,9 @@ del@^2.0.2: pinkie-promise "^2.0.0" rimraf "^2.2.8" -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - dependencies: - repeating "^2.0.0" - -diffie-hellman@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" +diff@3.5.0: + version "3.5.0" + resolved "http://registry.npm.taobao.org/diff/download/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" doctrine@^1.2.2: version "1.5.0" @@ -1025,52 +861,9 @@ doctrine@^1.2.2: esutils "^2.0.2" isarray "^1.0.0" -domain-browser@^1.1.1: - version "1.1.7" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" - -ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" - dependencies: - jsbn "~0.1.0" - -elliptic@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" - dependencies: - bn.js "^4.4.0" - brorand "^1.0.1" - hash.js "^1.0.0" - hmac-drbg "^1.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.0" - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - -enhanced-resolve@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.1.0.tgz#9f4b626f577245edcf4b2ad83d86e17f4f421dec" - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.4.0" - object-assign "^4.0.1" - tapable "^0.2.5" - -errno@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" - dependencies: - prr "~0.0.0" - -error-ex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" - dependencies: - is-arrayish "^0.2.1" +electron-to-chromium@^1.3.47: + version "1.3.70" + resolved "http://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.70.tgz#ded377256d92d81b4257d36c65aa890274afcfd2" es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: version "0.10.12" @@ -1108,7 +901,7 @@ es6-set@~0.1.3: es6-symbol "3" event-emitter "~0.3.4" -es6-symbol@~3.1, es6-symbol@~3.1.0, es6-symbol@3: +es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" dependencies: @@ -1124,7 +917,7 @@ es6-weak-map@^2.0.1: es6-iterator "2" es6-symbol "3" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1137,7 +930,18 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint: +eslint-scope@3.7.1: + version "3.7.1" + resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "http://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + +eslint@^3.16.1: version "3.16.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.16.1.tgz#9bc31fc7341692cf772e80607508f67d711c5609" dependencies: @@ -1206,6 +1010,10 @@ estree-walker@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" +estree-walker@^0.5.1, estree-walker@^0.5.2: + version "0.5.2" + resolved "http://registry.npm.taobao.org/estree-walker/download/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" + esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1217,16 +1025,6 @@ event-emitter@~0.3.4: d "~0.1.1" es5-ext "~0.10.7" -events@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - -evp_bytestokey@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" - dependencies: - create-hash "^1.1.1" - exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -1243,9 +1041,9 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" -extend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" +expect.js@^0.3.1: + version "0.3.1" + resolved "http://registry.npm.taobao.org/expect.js/download/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" extglob@^0.3.1: version "0.3.2" @@ -1253,10 +1051,6 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -extsprintf@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" - fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -1289,21 +1083,6 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -1323,59 +1102,10 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - -form-data@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.2.tgz#89c3534008b97eada4cbb157d58f6f5df025eae4" - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.5" - mime-types "^2.1.12" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" - dependencies: - nan "^2.3.0" - node-pre-gyp "^0.6.29" - -fstream-ignore@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" - dependencies: - fstream "^1.0.0" - inherits "2" - minimatch "^3.0.0" - -fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - -gauge@~2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - generate-function@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" @@ -1386,16 +1116,6 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" -get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" - -getpass@^0.1.1: - version "0.1.6" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" - dependencies: - assert-plus "^1.0.0" - glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -1409,6 +1129,17 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" +glob@7.1.2: + version "7.1.2" + resolved "http://registry.npm.taobao.org/glob/download/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" @@ -1420,10 +1151,18 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.0.0, globals@^9.14.0: +globals@^11.1.0: + version "11.7.0" + resolved "http://registry.npm.taobao.org/globals/download/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" + +globals@^9.14.0: version "9.16.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" +globals@^9.18.0: + version "9.18.0" + resolved "http://registry.npm.taobao.org/globals/download/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -1439,18 +1178,9 @@ graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" +growl@1.10.5: + version "1.10.5" + resolved "http://registry.npm.taobao.org/growl/download/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" has-ansi@^2.0.0: version "2.0.0" @@ -1458,67 +1188,13 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" - dependencies: - inherits "^2.0.1" - -hawk@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" - dependencies: - boom "2.x.x" - cryptiles "2.x.x" - hoek "2.x.x" - sntp "1.x.x" - -hmac-drbg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.0.tgz#3db471f45aae4a994a0688322171f51b8b91bee5" - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -hoek@2.x.x: - version "2.16.3" - resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" - -home-or-tmp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.1" - -hosted-git-info@^2.1.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.2.0.tgz#7a0d097863d886c0fabbdcd37bf1758d8becf8a5" +has-flag@^3.0.0: + version "3.0.0" + resolved "http://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" -http-signature@~1.1.0: +he@1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" - dependencies: - assert-plus "^0.2.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -https-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" - -ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + resolved "http://registry.npm.taobao.org/he/download/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" ignore@^3.2.0: version "3.2.4" @@ -1528,10 +1204,6 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1539,18 +1211,10 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@2: +inherits@2, inherits@^2.0.3, inherits@~2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - -ini@~1.3.0: - version "1.3.4" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" - inquirer@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" @@ -1573,36 +1237,16 @@ interpret@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" -invariant@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" +invariant@^2.2.2: + version "2.2.4" + resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: loose-envify "^1.0.0" -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - dependencies: - binary-extensions "^1.0.0" - is-buffer@^1.0.2: version "1.1.4" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - is-dotfile@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" @@ -1621,12 +1265,6 @@ is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - dependencies: - number-is-nan "^1.0.0" - is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -1643,7 +1281,11 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: +is-module@^1.0.0: + version "1.0.0" + resolved "http://registry.npm.taobao.org/is-module/download/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + +is-my-json-valid@^2.10.0: version "2.16.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: @@ -1692,15 +1334,7 @@ is-resolvable@^1.0.0: dependencies: tryit "^1.0.1" -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - -isarray@^1.0.0, isarray@~1.0.0, isarray@1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1710,20 +1344,18 @@ isobject@^2.0.0: dependencies: isarray "1.0.0" -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - -jodid25519@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" - dependencies: - jsbn "~0.1.0" - js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + +js-tokens@^3.0.2: + version "3.0.2" + resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + js-yaml@^3.5.1: version "3.8.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" @@ -1731,25 +1363,13 @@ js-yaml@^3.5.1: argparse "^1.0.7" esprima "^3.1.1" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" +jsesc@^2.5.1: + version "2.5.1" + resolved "http://registry.npm.taobao.org/jsesc/download/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" jsesc@~0.5.0: version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - -json-loader@^0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.4.tgz#8baa1365a632f58a3c46d20175fc6002c96e37de" - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + resolved "http://registry.npm.taobao.org/jsesc/download/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" @@ -1757,13 +1377,9 @@ json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - json5@^0.5.0: version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + resolved "http://registry.npm.taobao.org/json5/download/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" jsonify@~0.0.0: version "0.0.0" @@ -1771,15 +1387,7 @@ jsonify@~0.0.0: jsonpointer@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - -jsprim@^1.2.2: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" - dependencies: - extsprintf "1.0.2" - json-schema "0.2.3" - verror "1.3.6" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" kind-of@^3.0.2: version "3.1.0" @@ -1791,12 +1399,6 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -1804,57 +1406,33 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -loader-runner@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" - -loader-utils@^0.2.16: - version "0.2.17" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - object-assign "^4.0.1" - -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - -lodash@^4.0.0, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.17.10, lodash@^4.17.4: + version "4.17.11" + resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" loose-envify@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + version "1.4.0" + resolved "http://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" dependencies: - js-tokens "^3.0.0" + js-tokens "^3.0.0 || ^4.0.0" -memory-fs@^0.4.0, memory-fs@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" +magic-string@^0.22.4: + version "0.22.5" + resolved "http://registry.npm.taobao.org/magic-string/download/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" + vlq "^0.2.2" -micromatch@^2.1.5: +micromatch@^2.3.11: version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + resolved "http://registry.npm.taobao.org/micromatch/download/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -1870,149 +1448,72 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -miller-rabin@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@~1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" - -mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.14" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - mime-db "~1.26.0" - -minimalistic-assert@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" - -minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + brace-expansion "^1.1.7" -minimatch@^3.0.0, minimatch@^3.0.2: +minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: brace-expansion "^1.0.0" -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -mkdirp@^0.5.0, mkdirp@^0.5.1, "mkdirp@>=0.5 0", mkdirp@~0.5.0, mkdirp@~0.5.1: +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" +mocha@^5.2.0: + version "5.2.0" + resolved "http://registry.npm.taobao.org/mocha/download/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" +ms@2.0.0: + version "2.0.0" + resolved "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +ms@^2.1.1: + version "2.1.1" + resolved "http://registry.npm.taobao.org/ms/download/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" -nan@^2.3.0: - version "2.5.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -node-libs-browser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.0.0.tgz#a3a59ec97024985b46e958379646f96c4b616646" - dependencies: - assert "^1.1.1" - browserify-zlib "^0.1.4" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^1.0.0" - https-browserify "0.0.1" - os-browserify "^0.2.0" - path-browserify "0.0.0" - process "^0.11.0" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.0.5" - stream-browserify "^2.0.1" - stream-http "^2.3.1" - string_decoder "^0.10.25" - timers-browserify "^2.0.2" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.10.3" - vm-browserify "0.0.4" - -node-pre-gyp@^0.6.29: - version "0.6.33" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" - dependencies: - mkdirp "~0.5.1" - nopt "~3.0.6" - npmlog "^4.0.1" - rc "~1.1.6" - request "^2.79.0" - rimraf "~2.5.4" - semver "~5.3.0" - tar "~2.2.1" - tar-pack "~3.3.0" - -nopt@~3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - dependencies: - abbrev "1" - -normalize-package-data@^2.3.2: - version "2.3.5" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - normalize-path@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" -npmlog@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.1" - set-blocking "~2.0.0" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -oauth-sign@~0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" - object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2030,12 +1531,6 @@ once@^1.3.0: dependencies: wrappy "1" -once@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" @@ -2051,38 +1546,10 @@ optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -os-browserify@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" - os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.0.0" - -os-tmpdir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -pako@~0.2.0: - version "0.2.9" - resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" - -parse-asn1@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" - dependencies: - asn1.js "^4.0.0" - browserify-aes "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" @@ -2092,29 +1559,6 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -path: - version "0.12.7" - resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f" - dependencies: - process "^0.11.1" - util "^0.10.3" - -path-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2127,20 +1571,6 @@ path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -pbkdf2@^3.0.3: - version "3.0.9" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" - dependencies: - create-hmac "^1.1.2" - pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -2155,12 +1585,6 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" - pluralize@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" @@ -2174,55 +1598,17 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" private@^0.1.6: - version "0.1.7" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + version "0.1.8" + resolved "http://registry.npm.taobao.org/private/download/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" -process@^0.11.0, process@^0.11.1: - version "0.11.9" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" - progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" -prr@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" - -public-encrypt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - -punycode@^1.2.4, punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - -qs@~6.3.0: - version "6.3.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.1.tgz#918c0b3bcd36679772baf135b1acb4c1651ed79d" - -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - randomatic@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" @@ -2230,35 +1616,7 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" -randombytes@^2.0.0, randombytes@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" - -rc@~1.1.6: - version "1.1.7" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.7.tgz#c5ea564bb07aff9fd3a5b32e906c1d3a65940fea" - dependencies: - deep-extend "~0.4.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.0, readable-stream@^2.2.2: +readable-stream@^2.2.2: version "2.2.3" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729" dependencies: @@ -2270,27 +1628,6 @@ read-pkg@^1.0.0: string_decoder "~0.10.x" util-deprecate "~1.0.1" -readable-stream@~2.1.4: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdirp@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" - dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" - readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" - readline2@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" @@ -2306,16 +1643,16 @@ rechoir@^0.6.2: resolve "^1.1.6" regenerate@^1.2.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" + version "1.4.0" + resolved "http://registry.npm.taobao.org/regenerate/download/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" -regenerator-runtime@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" -regenerator-transform@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.8.tgz#0f88bb2bc03932ddb7b6b7312e68078f01026d6c" +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "http://registry.npm.taobao.org/regenerator-transform/download/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -2330,7 +1667,7 @@ regex-cache@^0.4.2: regexpu-core@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + resolved "http://registry.npm.taobao.org/regexpu-core/download/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" dependencies: regenerate "^1.2.1" regjsgen "^0.2.0" @@ -2338,11 +1675,11 @@ regexpu-core@^2.0.0: regjsgen@^0.2.0: version "0.2.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + resolved "http://registry.npm.taobao.org/regjsgen/download/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" regjsparser@^0.1.4: version "0.1.5" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + resolved "http://registry.npm.taobao.org/regjsparser/download/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" dependencies: jsesc "~0.5.0" @@ -2354,46 +1691,7 @@ repeat-string@^1.5.2: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - dependencies: - is-finite "^1.0.0" - -request@^2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - qs "~6.3.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - uuid "^3.0.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - -require-relative@^0.8.7, require-relative@0.8.7: +require-relative@0.8.7: version "0.8.7" resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" @@ -2418,6 +1716,12 @@ resolve@^1.1.6: dependencies: path-parse "^1.0.5" +resolve@^1.3.2, resolve@^1.5.0: + version "1.8.1" + resolved "http://registry.npm.taobao.org/resolve/download/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + dependencies: + path-parse "^1.0.5" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -2431,39 +1735,44 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@^2.2.8, rimraf@2: +rimraf@^2.2.8: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" -rimraf@~2.5.1, rimraf@~2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" +rollup-plugin-babel@^4.0.3: + version "4.0.3" + resolved "http://registry.npm.taobao.org/rollup-plugin-babel/download/rollup-plugin-babel-4.0.3.tgz#8282b0e22233160d679e9c7631342e848422fb02" dependencies: - glob "^7.0.5" + "@babel/helper-module-imports" "^7.0.0" + rollup-pluginutils "^2.3.0" -ripemd160@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" +rollup-plugin-commonjs@^9.1.8: + version "9.1.8" + resolved "http://registry.npm.taobao.org/rollup-plugin-commonjs/download/rollup-plugin-commonjs-9.1.8.tgz#4113ed94e6054b5f8a3501d8811f934cadde3246" + dependencies: + estree-walker "^0.5.1" + magic-string "^0.22.4" + resolve "^1.5.0" + rollup-pluginutils "^2.0.1" -rollup-plugin-babel: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" +rollup-plugin-node-resolve@^3.4.0: + version "3.4.0" + resolved "http://registry.npm.taobao.org/rollup-plugin-node-resolve/download/rollup-plugin-node-resolve-3.4.0.tgz#908585eda12e393caac7498715a01e08606abc89" dependencies: - babel-core "6" - babel-plugin-transform-es2015-classes "^6.9.0" - object-assign "^4.1.0" - rollup-pluginutils "^1.5.0" + builtin-modules "^2.0.0" + is-module "^1.0.0" + resolve "^1.1.6" -rollup-plugin-sourcemaps: +rollup-plugin-sourcemaps@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.4.1.tgz#fa7decbe012989e10d1aa6851d0c11e6d48812b7" dependencies: rollup-pluginutils "^1.5.0" source-map-resolve "^0.5.0" -rollup-plugin-uglify: +rollup-plugin-uglify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-1.0.1.tgz#11d0b0c8bcd2d07e6908f74fd16b0152390b922a" dependencies: @@ -2476,7 +1785,14 @@ rollup-pluginutils@^1.5.0: estree-walker "^0.2.1" minimatch "^3.0.2" -rollup-watch: +rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0: + version "2.3.3" + resolved "http://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" + dependencies: + estree-walker "^0.5.2" + micromatch "^2.3.11" + +rollup-watch@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-3.2.2.tgz#5e574232e9ef36da9177f46946d8080cb267354b" dependencies: @@ -2492,27 +1808,13 @@ rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" -semver@~5.3.0, "semver@2 || 3 || 4 || 5": - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -set-blocking@^2.0.0, set-blocking@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" - -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" +safe-buffer@~5.1.1: + version "5.1.2" + resolved "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" -sha.js@^2.3.6: - version "2.4.8" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" - dependencies: - inherits "^2.0.1" +semver@^5.3.0, semver@^5.4.1: + version "5.5.1" + resolved "http://registry.npm.taobao.org/semver/download/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" shelljs@^0.7.5: version "0.7.6" @@ -2522,28 +1824,10 @@ shelljs@^0.7.5: interpret "^1.0.0" rechoir "^0.6.2" -signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" -sntp@1.x.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" - dependencies: - hoek "2.x.x" - -source-list-map@~0.1.7: - version "0.1.8" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" - source-map-resolve@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.0.tgz#fcad0b64b70afb27699e425950cb5ebcd410bc20" @@ -2553,75 +1837,23 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.2: - version "0.4.11" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.11.tgz#647f939978b38535909530885303daf23279f322" - dependencies: - source-map "^0.5.3" - source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" -source-map@^0.5.0, source-map@^0.5.3, source-map@~0.5.1, source-map@~0.5.3: +source-map@^0.5.0: + version "0.5.7" + resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" - dependencies: - spdx-license-ids "^1.0.2" - -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" - -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" - sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" -sshpk@^1.7.0: - version "1.10.2" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.2.tgz#d5a804ce22695515638e798dbe23273de070a5fa" - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: - bcrypt-pbkdf "^1.0.0" - ecc-jsbn "~0.1.1" - jodid25519 "^1.0.0" - jsbn "~0.1.0" - tweetnacl "~0.14.0" - -stream-browserify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-http@^2.3.1: - version "2.6.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.6.3.tgz#4c3ddbf9635968ea2cfd4e48d43de5def2625ac3" - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.1.0" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -string_decoder@^0.10.25, string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -string-width@^1.0.1, string-width@^1.0.2: +string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -2636,22 +1868,16 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -stringstream@~0.0.4: - version "0.0.5" - resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -strip-ansi@^3.0.0, strip-ansi@^3.0.1: +strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" dependencies: ansi-regex "^2.0.0" -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - dependencies: - is-utf8 "^0.2.0" - strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -2660,15 +1886,21 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +supports-color@5.4.0: + version "5.4.0" + resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + dependencies: + has-flag "^3.0.0" + supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" +supports-color@^5.3.0: + version "5.5.0" + resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" dependencies: - has-flag "^1.0.0" + has-flag "^3.0.0" table@^3.7.8: version "3.8.3" @@ -2681,31 +1913,6 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -tapable@^0.2.5, tapable@~0.2.5: - version "0.2.6" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.6.tgz#206be8e188860b514425375e6f1ae89bfb01fd8d" - -tar-pack@~3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" - dependencies: - debug "~2.2.0" - fstream "~1.0.10" - fstream-ignore "~1.0.5" - once "~1.3.3" - readable-stream "~2.1.4" - rimraf "~2.5.1" - tar "~2.2.1" - uid-number "~0.0.6" - -tar@~2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" - dependencies: - block-stream "*" - fstream "^1.0.2" - inherits "2" - text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -2714,46 +1921,22 @@ through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -timers-browserify@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.2.tgz#ab4883cf597dcd50af211349a00fbca56ac86b86" - dependencies: - setimmediate "^1.0.4" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - -to-fast-properties@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" -tough-cookie@~2.3.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" - dependencies: - punycode "^1.4.1" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" trim-right@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + resolved "http://registry.npm.taobao.org/trim-right/download/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -2773,34 +1956,14 @@ uglify-js@^2.6.1: uglify-to-browserify "~1.0.0" yargs "~3.10.0" -uglify-js@^2.7.5: - version "2.8.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.4.tgz#5aeb6fd6f1f0a672dea63795016590502c290513" - dependencies: - async "~0.2.6" - source-map "~0.5.1" - uglify-to-browserify "~1.0.0" - yargs "~3.10.0" - uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" -uid-number@~0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" - urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - dependencies: - punycode "1.3.2" - querystring "0.2.0" - user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -2811,103 +1974,21 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -util@^0.10.3, util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - dependencies: - inherits "2.0.1" - -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" - -validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" - dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" - -verror@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" - dependencies: - extsprintf "1.0.2" - -vm-browserify@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - dependencies: - indexof "0.0.1" - -watchpack@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.3.1.tgz#7d8693907b28ce6013e7f3610aa2a1acf07dad87" - dependencies: - async "^2.1.2" - chokidar "^1.4.3" - graceful-fs "^4.1.2" - -webpack: - version "2.2.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.2.1.tgz#7bb1d72ae2087dd1a4af526afec15eed17dda475" - dependencies: - acorn "^4.0.4" - acorn-dynamic-import "^2.0.0" - ajv "^4.7.0" - ajv-keywords "^1.1.1" - async "^2.1.2" - enhanced-resolve "^3.0.0" - interpret "^1.0.0" - json-loader "^0.5.4" - loader-runner "^2.3.0" - loader-utils "^0.2.16" - memory-fs "~0.4.1" - mkdirp "~0.5.0" - node-libs-browser "^2.0.0" - source-map "^0.5.3" - supports-color "^3.1.0" - tapable "~0.2.5" - uglify-js "^2.7.5" - watchpack "^1.2.0" - webpack-sources "^0.1.4" - yargs "^6.0.0" - -webpack-sources@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.4.tgz#ccc2c817e08e5fa393239412690bb481821393cd" - dependencies: - source-list-map "~0.1.7" - source-map "~0.5.3" - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - -wide-align@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" - dependencies: - string-width "^1.0.1" +vlq@^0.2.2: + version "0.2.3" + resolved "http://registry.npm.taobao.org/vlq/download/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" wrappy@1: version "1.0.2" @@ -2923,34 +2004,6 @@ xtend@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yargs-parser@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" - dependencies: - camelcase "^3.0.0" - -yargs@^6.0.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "^4.2.0" - yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" @@ -2959,4 +2012,3 @@ yargs@~3.10.0: cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" - From 87977194f1544fd9f1d2a8901556930abd59a4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= Date: Thu, 10 Jan 2019 14:21:23 +0800 Subject: [PATCH 15/20] use TypeScript --- .travis.yml | 6 +- dist/blurify.es.js | 110 +++ dist/blurify.es.js.map | 1 + dist/blurify.es.min.js | 2 + dist/blurify.es.min.js.map | 1 + dist/blurify.js | 121 ++- dist/blurify.js.map | 2 +- dist/blurify.min.js | 2 + dist/blurify.min.js.map | 1 + package.json | 27 +- rollup.config.js | 51 +- src/common.js | 43 - src/common.ts | 42 + src/index.d.ts | 5 + src/{index.js => index.ts} | 35 +- yarn.lock | 1910 +++++++----------------------------- 16 files changed, 650 insertions(+), 1709 deletions(-) create mode 100644 dist/blurify.es.js create mode 100644 dist/blurify.es.js.map create mode 100644 dist/blurify.es.min.js create mode 100644 dist/blurify.es.min.js.map create mode 100644 dist/blurify.min.js create mode 100644 dist/blurify.min.js.map delete mode 100644 src/common.js create mode 100644 src/common.ts create mode 100644 src/index.d.ts rename src/{index.js => index.ts} (64%) diff --git a/.travis.yml b/.travis.yml index 8e053d6..5c807aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: -- "4" +- "8" branches: only: @@ -14,7 +14,7 @@ cache: - node_modules install: -- npm install +- yarn install script: -- npm run publish +- yarn run publish diff --git a/dist/blurify.es.js b/dist/blurify.es.js new file mode 100644 index 0000000..7ffa4b8 --- /dev/null +++ b/dist/blurify.es.js @@ -0,0 +1,110 @@ +function preload(images) { + var imageNodes = []; + var count = 0, doneAction = function (images) { }; + images = (typeof images != 'object') ? [images] : images; + images.length === 0 && doneAction(imageNodes); + images.map(function (image) { + var _image = new Image(); + _image.crossOrigin = '*'; + _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + _image.onload = imageLoad; + _image.onerror = imageLoad; + imageNodes.push(_image); + }); + function imageLoad() { + count++; + if (count == images.length) + doneAction(imageNodes); + } + return { + done: function (cb) { + doneAction = arguments[0] || doneAction; + } + }; +} +function cssSupport(key, value) { + var element = document.createElement('div'); + switch (arguments.length) { + case 1: + return key in element.style ? true : false; + case 2: + element.style[key] = value; + return element.style[key] ? true : false; + default: + return false; + } +} + +function blurify(options) { + if (options === void 0) { options = { + blur: 6, + mode: 'auto', + images: [] + }; } + if (!(this instanceof blurify)) + return new blurify(options); + if (typeof options === 'number') { + options = { + blur: options, + images: arguments[1], + mode: 'auto' + }; + } + this.options = options; + this.blur = options.blur || 6; + this.mode = options.mode || 'css'; + console.log(); + this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); + if (this.mode == 'auto') { + cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); + } + else if (this.mode == 'css') { + this.blur = this.blur / 2; + this.useCSSMode(); + } + else { + this.useCanvasMode(); + } +} +blurify.prototype.useCSSMode = function () { + var _this = this; + console.log(this.$els); + this.$els.map(function (el) { + console.log('el', el); + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); + el.style['filter'] = el.style['-webkit-filter'] = "blur(" + _this.blur + "px)"; + }); +}; +blurify.prototype.useCanvasMode = function () { + var _this = this; + this.imageType = this.options.imageType || "image/jpeg"; + preload(this.$els).done(function (images) { + images.map(function (image, index) { + _this.$els[index].src = _this.getDataURL(image); + }); + }); +}; +blurify.prototype.blurify = function (canvas, blur) { + var ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * +blur); + for (var y = -blur; y <= blur; y += 2) { + for (var x = -blur; x <= blur; x += 2) { + ctx.drawImage(canvas, x, y); + if (x >= 0 && y >= 0) + ctx.drawImage(canvas, -(x - 1), -(y - 1)); + } + } + ctx.globalAlpha = 1; +}; +blurify.prototype.getDataURL = function (image) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + canvas.width = image.width; + canvas.height = image.height; + ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); + return canvas.toDataURL(this.imageType); +}; + +export default blurify; +//# sourceMappingURL=blurify.es.js.map diff --git a/dist/blurify.es.js.map b/dist/blurify.es.js.map new file mode 100644 index 0000000..948d5f4 --- /dev/null +++ b/dist/blurify.es.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blurify.es.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":[],"mappings":"SAAgB,OAAO,CAAC,MAA0B;IAC9C,IAAM,UAAU,GAAuB,EAAE,CAAC;IAC1C,IAAI,KAAK,GAAG,CAAC,EAAE,UAAU,GAAG,UAAC,MAAa,KAAO,CAAC;IAElD,MAAM,GAAG,CAAC,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAEzD,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;IAE9C,MAAM,CAAC,GAAG,CAAC,UAAC,KAAuB;QAC/B,IAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QAC3B,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;QACzB,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAChF,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC;QAC1B,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;QAC3B,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3B,CAAC,CAA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,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC3B,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC;;;;"} \ No newline at end of file diff --git a/dist/blurify.es.min.js b/dist/blurify.es.min.js new file mode 100644 index 0000000..8186c54 --- /dev/null +++ b/dist/blurify.es.min.js @@ -0,0 +1,2 @@ +function preload(a){function b(){d++,d==a.length&&e(c)}var c=[],d=0,e=function(){};return a="object"==typeof a?a:[a],0===a.length&&e(c),a.map(function(a){var d=new Image;d.crossOrigin="*",d.src=a.dataset?a.dataset.src:a.getAttribute("data-src"),d.onload=b,d.onerror=b,c.push(d)}),{done:function(){e=arguments[0]||e}}}function cssSupport(a,b){var c=document.createElement("div");switch(arguments.length){case 1:return!!(a in c.style);case 2:return c.style[a]=b,!!c.style[a];default:return!1;}}function blurify(a){return void 0===a&&(a={blur:6,mode:"auto",images:[]}),this instanceof blurify?void("number"==typeof a&&(a={blur:a,images:arguments[1],mode:"auto"}),this.options=a,this.blur=a.blur||6,this.mode=a.mode||"css",console.log(),this.$els=1==a.images.nodeType?[a.images]:[].slice.call(a.images),"auto"==this.mode?cssSupport("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur/=2,this.useCSSMode()):this.useCanvasMode()):new blurify(a)}blurify.prototype.useCSSMode=function(){var a=this;console.log(this.$els),this.$els.map(function(b){console.log("el",b),b.src=b.dataset?b.dataset.src:b.getAttribute("data-src"),b.style.filter=b.style["-webkit-filter"]="blur("+a.blur+"px)"})},blurify.prototype.useCanvasMode=function(){var a=this;this.imageType=this.options.imageType||"image/jpeg",preload(this.$els).done(function(b){b.map(function(b,c){a.$els[c].src=a.getDataURL(b)})})},blurify.prototype.blurify=function(a,b){var c=a.getContext("2d");c.globalAlpha=1/(2*+b);for(var d=-b;d<=b;d+=2)for(var e=-b;e<=b;e+=2)c.drawImage(a,e,d),0<=e&&0<=d&&c.drawImage(a,-(e-1),-(d-1));c.globalAlpha=1},blurify.prototype.getDataURL=function(a){var b=document.createElement("canvas"),c=b.getContext("2d");return b.width=a.width,b.height=a.height,c.drawImage(a,0,0),this.blurify(b,this.blur),b.toDataURL(this.imageType)};export default blurify; +//# sourceMappingURL=blurify.es.min.js.map diff --git a/dist/blurify.es.min.js.map b/dist/blurify.es.min.js.map new file mode 100644 index 0000000..5ff84d3 --- /dev/null +++ b/dist/blurify.es.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blurify.es.min.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","images","imageLoad","count","length","doneAction","imageNodes","map","image","_image","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","push","done","arguments","cssSupport","key","value","element","document","createElement","style","blurify","options","blur","mode","console","log","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","el","_this","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":"QAAgBA,CAAAA,QAAQC,GAiBpB,QAASC,CAAAA,CAAT,GACIC,CAAK,GACDA,CAAK,EAAIF,CAAM,CAACG,QAAQC,CAAU,CAACC,CAAD,CACzC,IAnBKA,CAAAA,CAAU,CAAuB,GACnCH,CAAK,CAAG,EAAGE,CAAU,CAAG,WAAqB,EAoBjD,MAlBAJ,CAAAA,CAAM,CAAqB,QAAjB,QAAOA,CAAAA,CAAR,CAAyCA,CAAzC,CAA8B,CAACA,CAAD,CAkBvC,CAhBkB,CAAlB,GAAAA,CAAM,CAACG,MAAP,EAAuBC,CAAU,CAACC,CAAD,CAgBjC,CAdAL,CAAM,CAACM,GAAP,CAAW,SAACC,CAAD,EACP,GAAMC,CAAAA,CAAM,CAAG,GAAIC,CAAAA,KAAnB,CACAD,CAAM,CAACE,WAAP,CAAqB,IACrBF,CAAM,CAACG,GAAP,CAAaJ,CAAK,CAACK,OAAN,CAAgBL,CAAK,CAACK,OAAN,CAAcD,GAA9B,CAAoCJ,CAAK,CAACM,YAAN,CAAmB,UAAnB,EACjDL,CAAM,CAACM,MAAP,CAAgBb,EAChBO,CAAM,CAACO,OAAP,CAAiBd,EACjBI,CAAU,CAACW,IAAX,CAAgBR,CAAhB,CACH,CAPD,CAcA,CAAO,CACHS,IAAI,YACAb,CAAU,CAAGc,SAAS,CAAC,CAAD,CAAT,EAAgBd,CAChC,CAHE,CAKV,SAEee,CAAAA,WAAWC,EAAaC,GACpC,GAAMC,CAAAA,CAAO,CAAmBC,QAAQ,CAACC,aAAT,CAAuB,KAAvB,CAAhC,CAEA,OAAQN,SAAS,CAACf,MAAlB,EACI,IAAK,EAAL,CACI,SAAOiB,CAAG,GAAIE,CAAAA,CAAO,CAACG,KAAtB,EACJ,IAAK,EAAL,CAEI,MADAH,CAAAA,CAAO,CAACG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CAAN,CAAhC,CAF1B,CAKJH,CAAG,CAACE,WAAJ,CAAkB,CACrB,EAEDrB,OAAO,CAACY,SAAR,CAAkBK,UAAlB,CAA+B,SAASpC,CAAT,KACrBqC,CAAAA,CAAM,CAAGrB,QAAQ,CAACC,aAAT,CAAuB,QAAvB,EACTqB,CAAG,CAAGD,CAAM,CAACE,UAAP,CAAkB,IAAlB,EAQZ,MANAF,CAAAA,CAAM,CAACO,KAAP,CAAe5C,CAAK,CAAC4C,KAMrB,CALAP,CAAM,CAACQ,MAAP,CAAgB7C,CAAK,CAAC6C,MAKtB,CAJAP,CAAG,CAACK,SAAJ,CAAc3C,CAAd,CAAqB,CAArB,CAAwB,CAAxB,CAIA,CAFA,KAAKmB,OAAL,CAAakB,CAAb,CAAqB,KAAKhB,IAA1B,CAEA,CAAOgB,CAAM,CAACS,SAAP,CAAiB,KAAKZ,SAAtB,CACV"} \ No newline at end of file diff --git a/dist/blurify.js b/dist/blurify.js index 2c43486..1314fbd 100644 --- a/dist/blurify.js +++ b/dist/blurify.js @@ -1,121 +1,118 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : - (global.blurify = factory()); -}(this, (function () { 'use strict'; - - function preload(imageURLs) { - const images = []; - let count = 0, - doneAction = () => {}; - - imageURLs = (typeof imageURLs != 'object') ? [imageURLs] : imageURLs; - - imageURLs.length === 0 && doneAction(images); - - imageURLs.map((image, i) => { - images[i] = new Image(); - images[i].crossOrigin = '*'; - images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - images[i].onload = imageLoad; - images[i].onerror = imageLoad; + global.blurify = factory(); +}(typeof self !== 'undefined' ? self : this, function () { 'use strict'; + + function preload(images) { + var imageNodes = []; + var count = 0, doneAction = function (images) { }; + images = (typeof images != 'object') ? [images] : images; + images.length === 0 && doneAction(imageNodes); + images.map(function (image) { + var _image = new Image(); + _image.crossOrigin = '*'; + _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + _image.onload = imageLoad; + _image.onerror = imageLoad; + imageNodes.push(_image); }); - function imageLoad() { count++; - if (count == imageURLs.length) doneAction(images); + if (count == images.length) + doneAction(imageNodes); } - return { - done() { + done: function (cb) { doneAction = arguments[0] || doneAction; - }, + } }; } - - function cssSupport() { - const element = document.createElement('div'); - const property = arguments[0]; - + function cssSupport(key, value) { + var element = document.createElement('div'); switch (arguments.length) { case 1: - return property in element.style ? true : false; + return key in element.style ? true : false; case 2: - element.style[property] = arguments[1]; - return element.style[property] ? true : false; + element.style[key] = value; + return element.style[key] ? true : false; default: return false; } } function blurify(options) { - if (!(this instanceof blurify)) return new blurify(...arguments); - + if (options === void 0) { options = { + blur: 6, + mode: 'auto', + images: [] + }; } + if (!(this instanceof blurify)) + return new blurify(options); if (typeof options === 'number') { options = { blur: options, images: arguments[1], - mode: 'auto', + mode: 'auto' }; } - this.options = options; this.blur = options.blur || 6; this.mode = options.mode || 'css'; - this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); - + console.log(); + this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); if (this.mode == 'auto') { cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); - } else if (this.mode == 'css') { + } + else if (this.mode == 'css') { this.blur = this.blur / 2; this.useCSSMode(); - } else { + } + else { this.useCanvasMode(); } } - blurify.prototype.useCSSMode = function () { - this.$els.map(el => { + var _this = this; + console.log(this.$els); + this.$els.map(function (el) { + console.log('el', el); el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); - el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`; + el.style['filter'] = el.style['-webkit-filter'] = "blur(" + _this.blur + "px)"; }); }; - blurify.prototype.useCanvasMode = function () { - this.imageType = this.options.imageType || `image/jpeg`; - - preload(this.$els).done(images => { - images.map((image, index) => { - this.$els[index].src = this.getDataURL(image); + var _this = this; + this.imageType = this.options.imageType || "image/jpeg"; + preload(this.$els).done(function (images) { + images.map(function (image, index) { + _this.$els[index].src = _this.getDataURL(image); }); }); }; - - blurify.prototype.blurify = function(canvas, blur) { - const ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * blur); - for (let y = -blur; y <= blur; y += 2) { - for (let x = -blur; x <= blur; x += 2) { + blurify.prototype.blurify = function (canvas, blur) { + var ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * +blur); + for (var y = -blur; y <= blur; y += 2) { + for (var x = -blur; x <= blur; x += 2) { ctx.drawImage(canvas, x, y); - if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1)); + if (x >= 0 && y >= 0) + ctx.drawImage(canvas, -(x - 1), -(y - 1)); } } ctx.globalAlpha = 1; }; - - blurify.prototype.getDataURL = function(image) { - const canvas = document.createElement('canvas'); - const ctx = canvas.getContext('2d'); - + blurify.prototype.getDataURL = function (image) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); canvas.width = image.width; canvas.height = image.height; ctx.drawImage(image, 0, 0); this.blurify(canvas, this.blur); - return canvas.toDataURL(this.imageType); }; return blurify; -}))); +})); //# sourceMappingURL=blurify.js.map diff --git a/dist/blurify.js.map b/dist/blurify.js.map index da9f0b9..83f0779 100644 --- a/dist/blurify.js.map +++ b/dist/blurify.js.map @@ -1 +1 @@ -{"version":3,"file":"blurify.js","sources":["../src/common.js","../src/index.js"],"sourcesContent":["export function preload(imageURLs) {\n const images = [];\n let count = 0,\n doneAction = () => {};\n\n imageURLs = (typeof imageURLs != 'object') ? [imageURLs] : imageURLs;\n\n imageURLs.length === 0 && doneAction(images);\n\n imageURLs.map((image, i) => {\n images[i] = new Image();\n images[i].crossOrigin = '*';\n images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n images[i].onload = imageLoad;\n images[i].onerror = imageLoad;\n });\n\n function imageLoad() {\n count++;\n if (count == imageURLs.length) doneAction(images);\n }\n\n return {\n done() {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport() {\n const element = document.createElement('div');\n const property = arguments[0];\n\n switch (arguments.length) {\n case 1:\n return property in element.style ? true : false;\n case 2:\n element.style[property] = arguments[1];\n return element.style[property] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options) {\n if (!(this instanceof blurify)) return new blurify(...arguments);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function () {\n this.$els.map(el => {\n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function () {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done(images => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function(canvas, blur) {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":[],"mappings":";;;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K,CAAC,MAAM,CAAC;IACjC,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;IAEpC,IAAI,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"blurify.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":[],"mappings":";;;;;;aAAgB,OAAO,CAAC,MAA0B;QAC9C,IAAM,UAAU,GAAuB,EAAE,CAAC;QAC1C,IAAI,KAAK,GAAG,CAAC,EAAE,UAAU,GAAG,UAAC,MAAa,KAAO,CAAC;QAElD,MAAM,GAAG,CAAC,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;QAEzD,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;QAE9C,M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C;gBAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;oBAAE,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACnE;SACJ;QACD,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CAAC,SAAS,CAAC,UAAU,GAAG,UAAS,KAAuB;QAC3D,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,IAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEpC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC3B,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC7B,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAE3B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/dist/blurify.min.js b/dist/blurify.min.js new file mode 100644 index 0000000..91429fc --- /dev/null +++ b/dist/blurify.min.js @@ -0,0 +1,2 @@ +(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.blurify=b()})("undefined"==typeof self?this:self,function(){"use strict";function a(a){function b(){d++,d==a.length&&e(c)}var c=[],d=0,e=function(){};return a="object"==typeof a?a:[a],0===a.length&&e(c),a.map(function(a){var d=new Image;d.crossOrigin="*",d.src=a.dataset?a.dataset.src:a.getAttribute("data-src"),d.onload=b,d.onerror=b,c.push(d)}),{done:function(){e=arguments[0]||e}}}function b(a,b){var c=document.createElement("div");switch(arguments.length){case 1:return!!(a in c.style);case 2:return c.style[a]=b,!!c.style[a];default:return!1;}}function c(a){return void 0===a&&(a={blur:6,mode:"auto",images:[]}),this instanceof c?void("number"==typeof a&&(a={blur:a,images:arguments[1],mode:"auto"}),this.options=a,this.blur=a.blur||6,this.mode=a.mode||"css",console.log(),this.$els=1==a.images.nodeType?[a.images]:[].slice.call(a.images),"auto"==this.mode?b("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur/=2,this.useCSSMode()):this.useCanvasMode()):new c(a)}return c.prototype.useCSSMode=function(){var a=this;console.log(this.$els),this.$els.map(function(b){console.log("el",b),b.src=b.dataset?b.dataset.src:b.getAttribute("data-src"),b.style.filter=b.style["-webkit-filter"]="blur("+a.blur+"px)"})},c.prototype.useCanvasMode=function(){var b=this;this.imageType=this.options.imageType||"image/jpeg",a(this.$els).done(function(a){a.map(function(a,c){b.$els[c].src=b.getDataURL(a)})})},c.prototype.blurify=function(a,b){var c=a.getContext("2d");c.globalAlpha=1/(2*+b);for(var d=-b;d<=b;d+=2)for(var e=-b;e<=b;e+=2)c.drawImage(a,e,d),0<=e&&0<=d&&c.drawImage(a,-(e-1),-(d-1));c.globalAlpha=1},c.prototype.getDataURL=function(a){var b=document.createElement("canvas"),c=b.getContext("2d");return b.width=a.width,b.height=a.height,c.drawImage(a,0,0),this.blurify(b,this.blur),b.toDataURL(this.imageType)},c}); +//# sourceMappingURL=blurify.min.js.map diff --git a/dist/blurify.min.js.map b/dist/blurify.min.js.map new file mode 100644 index 0000000..2595e86 --- /dev/null +++ b/dist/blurify.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"blurify.min.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","images","imageLoad","count","length","doneAction","imageNodes","map","image","_image","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","push","done","arguments","cssSupport","key","value","element","document","createElement","style","blurify","options","blur","mode","console","log","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","el","_this","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":"0NAAgBA,CAAAA,EAAQC,GAiBpB,QAASC,CAAAA,CAAT,GACIC,CAAK,GACDA,CAAK,EAAIF,CAAM,CAACG,QAAQC,CAAU,CAACC,CAAD,CACzC,IAnBKA,CAAAA,CAAU,CAAuB,GACnCH,CAAK,CAAG,EAAGE,CAAU,CAAG,WAAqB,EAoBjD,MAlBAJ,CAAAA,CAAM,CAAqB,QAAjB,QAAOA,CAAAA,CAAR,CAAyCA,CAAzC,CAA8B,CAACA,CAAD,CAkBvC,CAhBkB,CAAlB,GAAAA,CAAM,CAACG,MAAP,EAAuBC,CAAU,CAACC,CAAD,CAgBjC,CAdAL,CAAM,CAACM,GAAP,CAAW,SAACC,CAAD,EACP,GAAMC,CAAAA,CAAM,CAAG,GAAIC,CAAAA,KAAnB,CACAD,CAAM,CAACE,WAAP,CAAqB,IACrBF,CAAM,CAACG,GAAP,CAAaJ,CAAK,CAACK,OAAN,CAAgBL,CAAK,CAACK,OAAN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kB,IAAlB,CAAZ,CACAD,CAAG,CAACE,WAAJ,CAAkB,GAAK,EAAI,CAACnB,CAAV,EAClB,IAAK,GAAIoB,CAAAA,CAAC,CAAG,CAACpB,CAAd,CAAoBoB,CAAC,EAAIpB,CAAzB,CAA+BoB,CAAC,EAAI,CAApC,CACI,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAACrB,CAAd,CAAoBqB,CAAC,EAAIrB,CAAzB,CAA+BqB,CAAC,EAAI,CAApC,CACIJ,CAAG,CAACK,SAAJ,CAAcN,CAAd,CAAsBK,CAAtB,CAAyBD,CAAzB,CADJ,CAEa,CAAL,EAAAC,CAAC,EAAc,CAAL,EAAAD,CAFlB,EAE0BH,CAAG,CAACK,SAAJ,CAAcN,CAAd,CAAsB,EAAEK,CAAC,CAAG,CAAN,CAAtB,CAAgC,EAAED,CAAC,CAAG,CAAN,CAAhC,CAF1B,CAKJH,CAAG,CAACE,WAAJ,CAAkB,CACrB,EAEDrB,CAAO,CAACY,SAAR,CAAkBK,UAAlB,CAA+B,SAASpC,CAAT,KACrBqC,CAAAA,CAAM,CAAGrB,QAAQ,CAACC,aAAT,CAAuB,QAAvB,EACTqB,CAAG,CAAGD,CAAM,CAACE,UAAP,CAAkB,IAAlB,EAQZ,MANAF,CAAAA,CAAM,CAACO,KAAP,CAAe5C,CAAK,CAAC4C,KAMrB,CALAP,CAAM,CAACQ,MAAP,CAAgB7C,CAAK,CAAC6C,MAKtB,CAJAP,CAAG,CAACK,SAAJ,CAAc3C,CAAd,CAAqB,CAArB,CAAwB,CAAxB,CAIA,CAFA,KAAKmB,OAAL,CAAakB,CAAb,CAAqB,KAAKhB,IAA1B,CAEA,CAAOgB,CAAM,CAACS,SAAP,CAAiB,KAAKZ,SAAtB,CACV"} \ No newline at end of file diff --git a/package.json b/package.json index bcb6b80..83ec84c 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,15 @@ { "name": "blurify", - "version": "1.1.0", + "version": "1.2.0", "description": "Image blurify.", "main": "dist/blurify.js", "moduleName": "blurify", "scripts": { "test": "mocha test/index.js", - "start": "npm run watch", - "watch": "NODE_ENV=development rollup -w -c rollup.config.js", + "start": "NODE_ENV=development rollup -w -c rollup.config.js", "dev": "NODE_ENV=development rollup -c rollup.config.js", "prod": "NODE_ENV=production rollup -c rollup.config.js", - "publish": "rm -rf dist && npm run dev && npm run prod", - "lint": "eslint src" + "publish": "rm -rf dist && npm run dev && npm run prod" }, "repository": { "type": "git", @@ -28,18 +26,13 @@ }, "homepage": "https://github.com/JustClear/blurify#readme", "devDependencies": { - "@babel/core": "^7.1.0", - "babel-eslint": "^9.0.0", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.7.0", - "eslint": "^3.16.1", - "expect.js": "^0.3.1", + "tslib": "^1.9.3", "mocha": "^5.2.0", - "rollup-plugin-babel": "^4.0.3", - "rollup-plugin-commonjs": "^9.1.8", - "rollup-plugin-node-resolve": "^3.4.0", - "rollup-plugin-sourcemaps": "^0.4.1", - "rollup-plugin-uglify": "^1.0.1", - "rollup-watch": "^3.2.2" + "expect.js": "^0.3.1", + "typescript": "^3.2.2", + "rollup-plugin-alias": "^1.5.1", + "rollup-plugin-babel-minify": "^6.2.0", + "rollup-plugin-node-resolve": "^3.0.0", + "rollup-plugin-typescript": "^1.0.0" } } diff --git a/rollup.config.js b/rollup.config.js index 98d5c25..819c798 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,26 +1,45 @@ +import alias from 'rollup-plugin-alias'; +import minify from 'rollup-plugin-babel-minify'; import resolve from 'rollup-plugin-node-resolve'; -import commonjs from 'rollup-plugin-commonjs'; -import uglify from 'rollup-plugin-uglify'; -import sourcemaps from 'rollup-plugin-sourcemaps'; +import typescript from 'rollup-plugin-typescript'; -const packages = require('./package.json'); -const fileName = process.env.NODE_ENV === 'development' ? packages.moduleName : `${packages.moduleName}.min`; +const isProd = process.env.NODE_ENV === 'production'; +const { moduleName } = require('./package.json'); +const getFilePath = (type = '') => `dist/${moduleName}${type == '' ? '' : '.'}${type}.js`; +const output = options => ({ + name: moduleName, + sourcemap: true, + ...options, +}); const configure = { - input: `src/index.js`, - output: [{ + input: 'src/index.ts', + output: [output({ + file: getFilePath(), format: 'umd', - name: fileName, - sourcemap: true, - file: `dist/${fileName.toLowerCase()}.js`, - }], + }), output({ + file: getFilePath('es'), + format: 'es', + })], plugins: [ - resolve(), - commonjs(), - sourcemaps(), + alias({ + common: './common', + }), + typescript(), + resolve({ + extensions: ['.js', '.ts'], + }), ], + external: [], }; -if (process.env.NODE_ENV === 'production') configure.plugins.push(uglify()); +if (isProd) { + configure.output = configure.output.map(output => { + const format = output.format == 'umd' ? '' : `.${output.format}`; + output.file = `dist/${moduleName}${format}.min.js`; + return output; + }); + configure.plugins.push(minify()); +} -export default configure; +module.exports = configure; diff --git a/src/common.js b/src/common.js deleted file mode 100644 index abe3608..0000000 --- a/src/common.js +++ /dev/null @@ -1,43 +0,0 @@ -export function preload(imageURLs) { - const images = []; - let count = 0, - doneAction = () => {}; - - imageURLs = (typeof imageURLs != 'object') ? [imageURLs] : imageURLs; - - imageURLs.length === 0 && doneAction(images); - - imageURLs.map((image, i) => { - images[i] = new Image(); - images[i].crossOrigin = '*'; - images[i].src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - images[i].onload = imageLoad; - images[i].onerror = imageLoad; - }); - - function imageLoad() { - count++; - if (count == imageURLs.length) doneAction(images); - } - - return { - done() { - doneAction = arguments[0] || doneAction; - }, - }; -} - -export function cssSupport() { - const element = document.createElement('div'); - const property = arguments[0]; - - switch (arguments.length) { - case 1: - return property in element.style ? true : false; - case 2: - element.style[property] = arguments[1]; - return element.style[property] ? true : false; - default: - return false; - } -} diff --git a/src/common.ts b/src/common.ts new file mode 100644 index 0000000..4f4dae5 --- /dev/null +++ b/src/common.ts @@ -0,0 +1,42 @@ +export function preload(images: HTMLImageElement[]) { + const imageNodes: HTMLImageElement[] = []; + let count = 0, doneAction = (images: any[]) => {}; + + images = (typeof images != 'object') ? [images] : images; + + images.length === 0 && doneAction(imageNodes); + + images.map((image: HTMLImageElement) => { + const _image = new Image(); + _image.crossOrigin = '*'; + _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + _image.onload = imageLoad; + _image.onerror = imageLoad; + imageNodes.push(_image); + }); + + function imageLoad() { + count++; + if (count == images.length) doneAction(imageNodes); + } + + return { + done(cb: (images: []) => void) { + doneAction = arguments[0] || doneAction; + }, + }; +} + +export function cssSupport(key: string, value: string) { + const element: HTMLDivElement = document.createElement('div'); + + switch (arguments.length) { + case 1: + return key in element.style ? true : false; + case 2: + element.style[key] = value; + return element.style[key] ? true : false; + default: + return false; + } +} diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..4368dd8 --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,5 @@ +declare module 'common'; +declare module 'rollup-plugin-alias'; +declare module 'rollup-plugin-babel-minify'; +declare module 'rollup-plugin-node-resolve'; +declare module 'rollup-plugin-typescript'; \ No newline at end of file diff --git a/src/index.js b/src/index.ts similarity index 64% rename from src/index.js rename to src/index.ts index 1f8ab06..ef234c0 100644 --- a/src/index.js +++ b/src/index.ts @@ -1,7 +1,15 @@ import { preload, cssSupport } from './common'; -export default function blurify(options) { - if (!(this instanceof blurify)) return new blurify(...arguments); +export default function blurify(options: { + blur: number + mode: string + images: HTMLImageElement | HTMLImageElement[] +} = { + blur: 6, + mode: 'auto', + images: [], +}) { + if (!(this instanceof blurify)) return new blurify(options); if (typeof options === 'number') { options = { @@ -14,7 +22,9 @@ export default function blurify(options) { this.options = options; this.blur = options.blur || 6; this.mode = options.mode || 'css'; - this.$els = options.images.nodeType === 1 ? [options.images] : [].slice.call(options.images); + console.log(); + + this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); if (this.mode == 'auto') { cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); @@ -26,26 +36,30 @@ export default function blurify(options) { } } -blurify.prototype.useCSSMode = function () { - this.$els.map(el => { +blurify.prototype.useCSSMode = function (): void { + console.log(this.$els); + + this.$els.map((el: HTMLImageElement) => { + console.log('el', el); + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`; }); }; -blurify.prototype.useCanvasMode = function () { +blurify.prototype.useCanvasMode = function (): void { this.imageType = this.options.imageType || `image/jpeg`; - preload(this.$els).done(images => { + preload(this.$els).done((images: []) => { images.map((image, index) => { this.$els[index].src = this.getDataURL(image); }); }); }; -blurify.prototype.blurify = function(canvas, blur) { +blurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void { const ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * blur); + ctx.globalAlpha = 1 / (2 * +blur); for (let y = -blur; y <= blur; y += 2) { for (let x = -blur; x <= blur; x += 2) { ctx.drawImage(canvas, x, y); @@ -55,13 +69,14 @@ blurify.prototype.blurify = function(canvas, blur) { ctx.globalAlpha = 1; }; -blurify.prototype.getDataURL = function(image) { +blurify.prototype.getDataURL = function(image: HTMLImageElement) { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); canvas.width = image.width; canvas.height = image.height; ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); return canvas.toDataURL(this.imageType); diff --git a/yarn.lock b/yarn.lock index 4bd3ae8..e5a6cf3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,34 +4,34 @@ "@babel/code-frame@^7.0.0": version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + resolved "http://npm.meitu-int.com/@babel%2fcode-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0": - version "7.1.0" - resolved "http://registry.npm.taobao.org/@babel/core/download/@babel/core-7.1.0.tgz#08958f1371179f62df6966d8a614003d11faeb04" +"@babel/core@^7.0.0": + version "7.2.2" + resolved "http://npm.meitu-int.com/@babel%2fcore/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.0.0" - "@babel/helpers" "^7.1.0" - "@babel/parser" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/generator" "^7.2.2" + "@babel/helpers" "^7.2.0" + "@babel/parser" "^7.2.2" + "@babel/template" "^7.2.2" + "@babel/traverse" "^7.2.2" + "@babel/types" "^7.2.2" convert-source-map "^1.1.0" - debug "^3.1.0" - json5 "^0.5.0" + debug "^4.1.0" + json5 "^2.1.0" lodash "^4.17.10" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0": - version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.0.0.tgz#1efd58bffa951dc846449e58ce3a1d7f02d393aa" +"@babel/generator@^7.2.2": + version "7.2.2" + resolved "http://npm.meitu-int.com/@babel%2fgenerator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.2.2" jsesc "^2.5.1" lodash "^4.17.10" source-map "^0.5.0" @@ -39,7 +39,7 @@ "@babel/helper-function-name@^7.1.0": version "7.1.0" - resolved "http://registry.npm.taobao.org/@babel/helper-function-name/download/@babel/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + resolved "http://npm.meitu-int.com/@babel%2fhelper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" dependencies: "@babel/helper-get-function-arity" "^7.0.0" "@babel/template" "^7.1.0" @@ -47,622 +47,271 @@ "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-module-imports@^7.0.0": - version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/helper-module-imports/download/@babel/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + resolved "http://npm.meitu-int.com/@babel%2fhelper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" dependencies: "@babel/types" "^7.0.0" "@babel/helper-split-export-declaration@^7.0.0": version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" + resolved "http://npm.meitu-int.com/@babel%2fhelper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" dependencies: "@babel/types" "^7.0.0" -"@babel/helpers@^7.1.0": - version "7.1.0" - resolved "http://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.1.0.tgz#429bf0f0020be56a4242883432084e3d70a8a141" +"@babel/helpers@^7.2.0": + version "7.2.0" + resolved "http://npm.meitu-int.com/@babel%2fhelpers/-/helpers-7.2.0.tgz#8335f3140f3144270dc63c4732a4f8b0a50b7a21" dependencies: - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/template" "^7.1.2" + "@babel/traverse" "^7.1.5" + "@babel/types" "^7.2.0" "@babel/highlight@^7.0.0": version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + resolved "http://npm.meitu-int.com/@babel%2fhighlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0": - version "7.1.0" - resolved "http://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e" +"@babel/parser@^7.2.2", "@babel/parser@^7.2.3": + version "7.2.3" + resolved "http://npm.meitu-int.com/@babel%2fparser/-/parser-7.2.3.tgz#32f5df65744b70888d17872ec106b02434ba1489" -"@babel/template@^7.1.0": - version "7.1.0" - resolved "http://registry.npm.taobao.org/@babel/template/download/@babel/template-7.1.0.tgz#58cc9572e1bfe24fe1537fdf99d839d53e517e22" +"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": + version "7.2.2" + resolved "http://npm.meitu-int.com/@babel%2ftemplate/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.2.2" + "@babel/types" "^7.2.2" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0": - version "7.1.0" - resolved "http://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.1.0.tgz#503ec6669387efd182c3888c4eec07bcc45d91b2" +"@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2": + version "7.2.3" + resolved "http://npm.meitu-int.com/@babel%2ftraverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.0.0" + "@babel/generator" "^7.2.2" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - debug "^3.1.0" + "@babel/parser" "^7.2.3" + "@babel/types" "^7.2.2" + debug "^4.1.0" globals "^11.1.0" lodash "^4.17.10" -"@babel/types@^7.0.0": - version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/types/download/@babel/types-7.0.0.tgz#6e191793d3c854d19c6749989e3bc55f0e962118" +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.2.2": + version "7.2.2" + resolved "http://npm.meitu-int.com/@babel%2ftypes/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" dependencies: esutils "^2.0.2" lodash "^4.17.10" to-fast-properties "^2.0.0" -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" - -acorn@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" - -ajv@^4.7.0: - version "4.11.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.3.tgz#ce30bdb90d1254f762c75af915fb3a63e7183d22" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +"@comandeer/babel-plugin-banner@^4.0.0": + version "4.1.0" + resolved "http://npm.meitu-int.com/@comandeer%2fbabel-plugin-banner/-/babel-plugin-banner-4.1.0.tgz#5f9f22f3ba5a4e87d0c972c402f039c6eeffc079" ansi-styles@^3.2.1: version "3.2.1" - resolved "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + resolved "http://npm.meitu-int.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: color-convert "^1.9.0" -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - dependencies: - sprintf-js "~1.0.2" - arr-diff@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + resolved "http://npm.meitu-int.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" dependencies: arr-flatten "^1.0.1" arr-flatten@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + version "1.1.0" + resolved "http://npm.meitu-int.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" array-unique@^0.2.1: version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + resolved "http://npm.meitu-int.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - -atob@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" - -babel-code-frame@^6.16.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-code-frame@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-eslint@^9.0.0: - version "9.0.0" - resolved "http://registry.npm.taobao.org/babel-eslint/download/babel-eslint-9.0.0.tgz#7d9445f81ed9f60aff38115f838970df9f2b6220" - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - eslint-scope "3.7.1" - eslint-visitor-keys "^1.0.0" - -babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-builder-binary-assignment-operator-visitor/download/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" - dependencies: - babel-helper-explode-assignable-expression "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-call-delegate@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-call-delegate/download/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-define-map@^6.24.1: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-helper-define-map/download/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-explode-assignable-expression@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-explode-assignable-expression/download/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-function-name@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-function-name/download/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" - dependencies: - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-get-function-arity@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-get-function-arity/download/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-hoist-variables@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-hoist-variables/download/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-optimise-call-expression@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-optimise-call-expression/download/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - -babel-helper-regex@^6.24.1: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-helper-regex/download/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" - dependencies: - babel-runtime "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-helper-remap-async-to-generator@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-remap-async-to-generator/download/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" - dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-helper-replace-supers@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-helper-replace-supers/download/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" - dependencies: - babel-helper-optimise-call-expression "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "http://registry.npm.taobao.org/babel-messages/download/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-check-es2015-constants@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-check-es2015-constants/download/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" - dependencies: - babel-runtime "^6.22.0" - -babel-plugin-syntax-async-functions@^6.8.0: - version "6.13.0" - resolved "http://registry.npm.taobao.org/babel-plugin-syntax-async-functions/download/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" +babel-helper-evaluate-path@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" -babel-plugin-syntax-exponentiation-operator@^6.8.0: - version "6.13.0" - resolved "http://registry.npm.taobao.org/babel-plugin-syntax-exponentiation-operator/download/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" +babel-helper-flip-expressions@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" -babel-plugin-syntax-object-rest-spread@^6.8.0: - version "6.13.0" - resolved "http://registry.npm.taobao.org/babel-plugin-syntax-object-rest-spread/download/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" +babel-helper-is-nodes-equiv@^0.0.1: + version "0.0.1" + resolved "http://npm.meitu-int.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" -babel-plugin-syntax-trailing-function-commas@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-syntax-trailing-function-commas/download/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" +babel-helper-is-void-0@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" -babel-plugin-transform-async-to-generator@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-async-to-generator/download/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" - dependencies: - babel-helper-remap-async-to-generator "^6.24.1" - babel-plugin-syntax-async-functions "^6.8.0" - babel-runtime "^6.22.0" +babel-helper-mark-eval-scopes@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" -babel-plugin-transform-es2015-arrow-functions@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-arrow-functions/download/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" - dependencies: - babel-runtime "^6.22.0" +babel-helper-remove-or-void@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" -babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoped-functions/download/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" - dependencies: - babel-runtime "^6.22.0" +babel-helper-to-multiple-sequence-expressions@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" -babel-plugin-transform-es2015-block-scoping@^6.23.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-block-scoping/download/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" - dependencies: - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - lodash "^4.17.4" - -babel-plugin-transform-es2015-classes@^6.23.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-classes/download/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" - dependencies: - babel-helper-define-map "^6.24.1" - babel-helper-function-name "^6.24.1" - babel-helper-optimise-call-expression "^6.24.1" - babel-helper-replace-supers "^6.24.1" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-computed-properties@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-computed-properties/download/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" - dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" +babel-plugin-minify-builtins@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" -babel-plugin-transform-es2015-destructuring@^6.23.0: - version "6.23.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-destructuring/download/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" +babel-plugin-minify-constant-folding@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e" dependencies: - babel-runtime "^6.22.0" + babel-helper-evaluate-path "^0.5.0" -babel-plugin-transform-es2015-duplicate-keys@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-duplicate-keys/download/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" +babel-plugin-minify-dead-code-elimination@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.0.tgz#d23ef5445238ad06e8addf5c1cf6aec835bcda87" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" + babel-helper-evaluate-path "^0.5.0" + babel-helper-mark-eval-scopes "^0.4.3" + babel-helper-remove-or-void "^0.4.3" + lodash.some "^4.6.0" -babel-plugin-transform-es2015-for-of@^6.23.0: - version "6.23.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-for-of/download/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" +babel-plugin-minify-flip-comparisons@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" dependencies: - babel-runtime "^6.22.0" + babel-helper-is-void-0 "^0.4.3" -babel-plugin-transform-es2015-function-name@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-function-name/download/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" +babel-plugin-minify-guarded-expressions@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.3.tgz#cc709b4453fd21b1f302877444c89f88427ce397" dependencies: - babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" + babel-helper-flip-expressions "^0.4.3" -babel-plugin-transform-es2015-literals@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-literals/download/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-minify-infinity@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" -babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-amd/download/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" +babel-plugin-minify-mangle-names@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz#bcddb507c91d2c99e138bd6b17a19c3c271e3fd3" dependencies: - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" + babel-helper-mark-eval-scopes "^0.4.3" -babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.26.2" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-commonjs/download/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" - dependencies: - babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.26.0" - babel-template "^6.26.0" - babel-types "^6.26.0" - -babel-plugin-transform-es2015-modules-systemjs@^6.23.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-systemjs/download/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" - dependencies: - babel-helper-hoist-variables "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" +babel-plugin-minify-numeric-literals@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" -babel-plugin-transform-es2015-modules-umd@^6.23.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-modules-umd/download/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" - dependencies: - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" +babel-plugin-minify-replace@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c" -babel-plugin-transform-es2015-object-super@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-object-super/download/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" +babel-plugin-minify-simplify@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.0.tgz#1f090018afb90d8b54d3d027fd8a4927f243da6f" dependencies: - babel-helper-replace-supers "^6.24.1" - babel-runtime "^6.22.0" + babel-helper-flip-expressions "^0.4.3" + babel-helper-is-nodes-equiv "^0.0.1" + babel-helper-to-multiple-sequence-expressions "^0.5.0" -babel-plugin-transform-es2015-parameters@^6.23.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-parameters/download/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" - dependencies: - babel-helper-call-delegate "^6.24.1" - babel-helper-get-function-arity "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - -babel-plugin-transform-es2015-shorthand-properties@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-shorthand-properties/download/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" +babel-plugin-minify-type-constructors@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" + babel-helper-is-void-0 "^0.4.3" -babel-plugin-transform-es2015-spread@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-spread/download/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-transform-inline-consecutive-adds@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" -babel-plugin-transform-es2015-sticky-regex@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-sticky-regex/download/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" - dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" +babel-plugin-transform-member-expression-literals@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" -babel-plugin-transform-es2015-template-literals@^6.22.0: - version "6.22.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-template-literals/download/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-transform-merge-sibling-variables@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" -babel-plugin-transform-es2015-typeof-symbol@^6.23.0: - version "6.23.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-typeof-symbol/download/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" - dependencies: - babel-runtime "^6.22.0" +babel-plugin-transform-minify-booleans@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" -babel-plugin-transform-es2015-unicode-regex@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-es2015-unicode-regex/download/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" +babel-plugin-transform-property-literals@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" dependencies: - babel-helper-regex "^6.24.1" - babel-runtime "^6.22.0" - regexpu-core "^2.0.0" - -babel-plugin-transform-exponentiation-operator@^6.22.0: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-exponentiation-operator/download/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" - dependencies: - babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" - babel-plugin-syntax-exponentiation-operator "^6.8.0" - babel-runtime "^6.22.0" + esutils "^2.0.2" -babel-plugin-transform-object-rest-spread@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-object-rest-spread/download/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" - dependencies: - babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.26.0" +babel-plugin-transform-regexp-constructors@^0.4.3: + version "0.4.3" + resolved "http://npm.meitu-int.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" -babel-plugin-transform-regenerator@^6.22.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-regenerator/download/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" - dependencies: - regenerator-transform "^0.10.0" +babel-plugin-transform-remove-console@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" -babel-plugin-transform-strict-mode@^6.24.1: - version "6.24.1" - resolved "http://registry.npm.taobao.org/babel-plugin-transform-strict-mode/download/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" - dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" +babel-plugin-transform-remove-debugger@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" -babel-preset-env@^1.7.0: - version "1.7.0" - resolved "http://registry.npm.taobao.org/babel-preset-env/download/babel-preset-env-1.7.0.tgz#dea79fa4ebeb883cd35dab07e260c1c9c04df77a" - dependencies: - babel-plugin-check-es2015-constants "^6.22.0" - babel-plugin-syntax-trailing-function-commas "^6.22.0" - babel-plugin-transform-async-to-generator "^6.22.0" - babel-plugin-transform-es2015-arrow-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.23.0" - babel-plugin-transform-es2015-classes "^6.23.0" - babel-plugin-transform-es2015-computed-properties "^6.22.0" - babel-plugin-transform-es2015-destructuring "^6.23.0" - babel-plugin-transform-es2015-duplicate-keys "^6.22.0" - babel-plugin-transform-es2015-for-of "^6.23.0" - babel-plugin-transform-es2015-function-name "^6.22.0" - babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.22.0" - babel-plugin-transform-es2015-modules-commonjs "^6.23.0" - babel-plugin-transform-es2015-modules-systemjs "^6.23.0" - babel-plugin-transform-es2015-modules-umd "^6.23.0" - babel-plugin-transform-es2015-object-super "^6.22.0" - babel-plugin-transform-es2015-parameters "^6.23.0" - babel-plugin-transform-es2015-shorthand-properties "^6.22.0" - babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.22.0" - babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.23.0" - babel-plugin-transform-es2015-unicode-regex "^6.22.0" - babel-plugin-transform-exponentiation-operator "^6.22.0" - babel-plugin-transform-regenerator "^6.22.0" - browserslist "^3.2.6" - invariant "^2.2.2" - semver "^5.3.0" - -babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" +babel-plugin-transform-remove-undefined@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd" dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" + babel-helper-evaluate-path "^0.5.0" -babel-template@^6.24.1, babel-template@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-template/download/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" - dependencies: - babel-runtime "^6.26.0" - babel-traverse "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - lodash "^4.17.4" - -babel-traverse@^6.24.1, babel-traverse@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-traverse/download/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" - dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" - babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" - -babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-types/download/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" - dependencies: - babel-runtime "^6.26.0" - esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" +babel-plugin-transform-simplify-comparison-operators@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" -babylon@^6.18.0: - version "6.18.0" - resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" +babel-plugin-transform-undefined-to-void@^6.9.4: + version "6.9.4" + resolved "http://npm.meitu-int.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +babel-preset-minify@^0.5.0: + version "0.5.0" + resolved "http://npm.meitu-int.com/babel-preset-minify/-/babel-preset-minify-0.5.0.tgz#e25bb8d3590087af02b650967159a77c19bfb96b" + dependencies: + babel-plugin-minify-builtins "^0.5.0" + babel-plugin-minify-constant-folding "^0.5.0" + babel-plugin-minify-dead-code-elimination "^0.5.0" + babel-plugin-minify-flip-comparisons "^0.4.3" + babel-plugin-minify-guarded-expressions "^0.4.3" + babel-plugin-minify-infinity "^0.4.3" + babel-plugin-minify-mangle-names "^0.5.0" + babel-plugin-minify-numeric-literals "^0.4.3" + babel-plugin-minify-replace "^0.5.0" + babel-plugin-minify-simplify "^0.5.0" + babel-plugin-minify-type-constructors "^0.4.3" + babel-plugin-transform-inline-consecutive-adds "^0.4.3" + babel-plugin-transform-member-expression-literals "^6.9.4" + babel-plugin-transform-merge-sibling-variables "^6.9.4" + babel-plugin-transform-minify-booleans "^6.9.4" + babel-plugin-transform-property-literals "^6.9.4" + babel-plugin-transform-regexp-constructors "^0.4.3" + babel-plugin-transform-remove-console "^6.9.4" + babel-plugin-transform-remove-debugger "^6.9.4" + babel-plugin-transform-remove-undefined "^0.5.0" + babel-plugin-transform-simplify-comparison-operators "^6.9.4" + babel-plugin-transform-undefined-to-void "^6.9.4" + lodash.isplainobject "^4.0.6" balanced-match@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" - dependencies: - balanced-match "^0.4.1" - concat-map "0.0.1" + resolved "http://npm.meitu-int.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" brace-expansion@^1.1.7: version "1.1.11" - resolved "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "http://npm.meitu-int.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" dependencies: balanced-match "^1.0.0" concat-map "0.0.1" braces@^1.8.2: version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + resolved "http://npm.meitu-int.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -670,468 +319,138 @@ braces@^1.8.2: browser-stdout@1.3.1: version "1.3.1" - resolved "http://registry.npm.taobao.org/browser-stdout/download/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - -browserslist@^3.2.6: - version "3.2.8" - resolved "http://registry.npm.taobao.org/browserslist/download/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" - dependencies: - caniuse-lite "^1.0.30000844" - electron-to-chromium "^1.3.47" - -buffer-shims@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + resolved "http://npm.meitu-int.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" builtin-modules@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/builtin-modules/download/builtin-modules-2.0.0.tgz#60b7ef5ae6546bd7deefa74b08b62a43a232648e" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -caniuse-lite@^1.0.30000844: - version "1.0.30000887" - resolved "http://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30000887.tgz#1769458c27bbdcf61b0cb6b5072bb6cd11fd9c23" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" + resolved "http://npm.meitu-int.com/builtin-modules/-/builtin-modules-2.0.0.tgz#60b7ef5ae6546bd7deefa74b08b62a43a232648e" chalk@^2.0.0: - version "2.4.1" - resolved "http://registry.npm.taobao.org/chalk/download/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + version "2.4.2" + resolved "http://npm.meitu-int.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" -circular-json@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" - -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - dependencies: - restore-cursor "^1.0.1" - -cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - color-convert@^1.9.0: version "1.9.3" - resolved "http://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + resolved "http://npm.meitu-int.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" - resolved "http://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + resolved "http://npm.meitu-int.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" commander@2.15.1: version "2.15.1" - resolved "http://registry.npm.taobao.org/commander/download/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + resolved "http://npm.meitu-int.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" concat-map@0.0.1: version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -concat-stream@^1.4.6: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" + resolved "http://npm.meitu-int.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" convert-source-map@^1.1.0: version "1.6.0" - resolved "http://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + resolved "http://npm.meitu-int.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" dependencies: safe-buffer "~5.1.1" -core-js@^2.4.0: - version "2.5.7" - resolved "http://registry.npm.taobao.org/core-js/download/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -d@^0.1.1, d@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" - dependencies: - es5-ext "~0.10.2" - debug@3.1.0: version "3.1.0" - resolved "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -debug@^2.1.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.1.tgz#79855090ba2c4e3115cc7d8769491d58f0491351" - dependencies: - ms "0.7.2" - -debug@^2.6.8: - version "2.6.9" - resolved "http://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + resolved "http://npm.meitu-int.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: ms "2.0.0" -debug@^3.1.0: - version "3.2.5" - resolved "http://registry.npm.taobao.org/debug/download/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407" +debug@^4.1.0: + version "4.1.1" + resolved "http://npm.meitu-int.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" dependencies: ms "^2.1.1" -decamelize@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - diff@3.5.0: version "3.5.0" - resolved "http://registry.npm.taobao.org/diff/download/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -electron-to-chromium@^1.3.47: - version "1.3.70" - resolved "http://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.70.tgz#ded377256d92d81b4257d36c65aa890274afcfd2" - -es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.12" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" - dependencies: - es6-iterator "2" - es6-symbol "~3.1" - -es6-iterator@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" - dependencies: - d "^0.1.1" - es5-ext "^0.10.7" - es6-symbol "3" - -es6-map@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-set "~0.1.3" - es6-symbol "~3.1.0" - event-emitter "~0.3.4" - -es6-set@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-symbol "3" - event-emitter "~0.3.4" - -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - -es6-weak-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" - dependencies: - d "^0.1.1" - es5-ext "^0.10.8" - es6-iterator "2" - es6-symbol "3" + resolved "http://npm.meitu-int.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + resolved "http://npm.meitu-int.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@3.7.1: - version "3.7.1" - resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - -eslint@^3.16.1: - version "3.16.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.16.1.tgz#9bc31fc7341692cf772e80607508f67d711c5609" - dependencies: - babel-code-frame "^6.16.0" - chalk "^1.1.3" - concat-stream "^1.4.6" - debug "^2.1.1" - doctrine "^1.2.2" - escope "^3.6.0" - espree "^3.4.0" - estraverse "^4.2.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" - imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" - is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" - levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" - strip-json-comments "~2.0.1" - table "^3.7.8" - text-table "~0.2.0" - user-home "^2.0.0" - -espree@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" - dependencies: - acorn "4.0.4" - acorn-jsx "^3.0.0" - -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - -esrecurse@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" - dependencies: - estraverse "~4.1.0" - object-assign "^4.0.1" - -estraverse@^4.1.1, estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -estraverse@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" - -estree-walker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" - -estree-walker@^0.5.1, estree-walker@^0.5.2: +estree-walker@^0.5.2: version "0.5.2" - resolved "http://registry.npm.taobao.org/estree-walker/download/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" + resolved "http://npm.meitu-int.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" esutils@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -event-emitter@~0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" - dependencies: - d "~0.1.1" - es5-ext "~0.10.7" - -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + resolved "http://npm.meitu-int.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" expand-brackets@^0.1.4: version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + resolved "http://npm.meitu-int.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" dependencies: is-posix-bracket "^0.1.0" expand-range@^1.8.1: version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + resolved "http://npm.meitu-int.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" dependencies: fill-range "^2.1.0" expect.js@^0.3.1: version "0.3.1" - resolved "http://registry.npm.taobao.org/expect.js/download/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" + resolved "http://npm.meitu-int.com/expect.js/-/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" extglob@^0.3.1: version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + resolved "http://npm.meitu-int.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" dependencies: is-extglob "^1.0.0" -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - filename-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + version "2.0.1" + resolved "http://npm.meitu-int.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" fill-range@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + version "2.2.4" + resolved "http://npm.meitu-int.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" dependencies: is-number "^2.1.0" isobject "^2.0.0" - randomatic "^1.1.3" + randomatic "^3.0.0" repeat-element "^1.1.2" repeat-string "^1.5.2" -flat-cache@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - for-in@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + resolved "http://npm.meitu-int.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" for-own@^0.1.4: version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + resolved "http://npm.meitu-int.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" dependencies: for-in "^1.0.1" fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" + resolved "http://npm.meitu-int.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" glob-base@^0.3.0: version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + resolved "http://npm.meitu-int.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" glob-parent@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + resolved "http://npm.meitu-int.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" dependencies: is-glob "^2.0.0" glob@7.1.2: version "7.1.2" - resolved "http://registry.npm.taobao.org/glob/download/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + resolved "http://npm.meitu-int.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1140,299 +459,136 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - globals@^11.1.0: - version "11.7.0" - resolved "http://registry.npm.taobao.org/globals/download/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" - -globals@^9.14.0: - version "9.16.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" - -globals@^9.18.0: - version "9.18.0" - resolved "http://registry.npm.taobao.org/globals/download/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + version "11.10.0" + resolved "http://npm.meitu-int.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" growl@1.10.5: version "1.10.5" - resolved "http://registry.npm.taobao.org/growl/download/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" + resolved "http://npm.meitu-int.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" has-flag@^3.0.0: version "3.0.0" - resolved "http://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + resolved "http://npm.meitu-int.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" he@1.1.1: version "1.1.1" - resolved "http://registry.npm.taobao.org/he/download/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - -ignore@^3.2.0: - version "3.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.4.tgz#4055e03596729a8fabe45a43c100ad5ed815c4e8" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + resolved "http://npm.meitu-int.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" inflight@^1.0.4: version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "http://npm.meitu-int.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" dependencies: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@~2.0.1: +inherits@2: version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + resolved "http://npm.meitu-int.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" - dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" - cli-width "^2.0.0" - figures "^1.3.5" - lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" - through "^2.3.6" - -interpret@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" - -invariant@^2.2.2: - version "2.2.4" - resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - dependencies: - loose-envify "^1.0.0" - -is-buffer@^1.0.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" +is-buffer@^1.1.5: + version "1.1.6" + resolved "http://npm.meitu-int.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" is-dotfile@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + version "1.0.3" + resolved "http://npm.meitu-int.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" is-equal-shallow@^0.1.3: version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + resolved "http://npm.meitu-int.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" dependencies: is-primitive "^2.0.0" is-extendable@^0.1.1: version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + resolved "http://npm.meitu-int.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" is-extglob@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + resolved "http://npm.meitu-int.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + resolved "http://npm.meitu-int.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" dependencies: is-extglob "^1.0.0" is-module@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/is-module/download/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + resolved "http://npm.meitu-int.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" -is-my-json-valid@^2.10.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - -is-number@^2.0.2, is-number@^2.1.0: +is-number@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + resolved "http://npm.meitu-int.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: kind-of "^3.0.2" -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" - dependencies: - path-is-inside "^1.0.1" +is-number@^4.0.0: + version "4.0.0" + resolved "http://npm.meitu-int.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" is-posix-bracket@^0.1.0: version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + resolved "http://npm.meitu-int.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" is-primitive@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - -is-resolvable@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" - dependencies: - tryit "^1.0.1" + resolved "http://npm.meitu-int.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + resolved "http://npm.meitu-int.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" isobject@^2.0.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + resolved "http://npm.meitu-int.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" dependencies: isarray "1.0.0" -js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: +js-tokens@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - -js-tokens@^3.0.2: - version "3.0.2" - resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - -js-yaml@^3.5.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628" - dependencies: - argparse "^1.0.7" - esprima "^3.1.1" + resolved "http://npm.meitu-int.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" jsesc@^2.5.1: - version "2.5.1" - resolved "http://registry.npm.taobao.org/jsesc/download/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" - -jsesc@~0.5.0: - version "0.5.0" - resolved "http://registry.npm.taobao.org/jsesc/download/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + version "2.5.2" + resolved "http://npm.meitu-int.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" +json5@^2.1.0: + version "2.1.0" + resolved "http://npm.meitu-int.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" dependencies: - jsonify "~0.0.0" - -json5@^0.5.0: - version "0.5.1" - resolved "http://registry.npm.taobao.org/json5/download/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + minimist "^1.2.0" kind-of@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" + version "3.2.2" + resolved "http://npm.meitu-int.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" dependencies: - is-buffer "^1.0.2" + is-buffer "^1.1.5" -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +kind-of@^6.0.0: + version "6.0.2" + resolved "http://npm.meitu-int.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "http://npm.meitu-int.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" -lodash@^4.0.0, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash.some@^4.6.0: + version "4.6.0" + resolved "http://npm.meitu-int.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" -lodash@^4.17.10, lodash@^4.17.4: +lodash@^4.17.10: version "4.17.11" - resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + resolved "http://npm.meitu-int.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" -longest@^1.0.1: +math-random@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -loose-envify@^1.0.0: - version "1.4.0" - resolved "http://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -magic-string@^0.22.4: - version "0.22.5" - resolved "http://registry.npm.taobao.org/magic-string/download/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" - dependencies: - vlq "^0.2.2" + resolved "http://npm.meitu-int.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" micromatch@^2.3.11: version "2.3.11" - resolved "http://registry.npm.taobao.org/micromatch/download/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + resolved "http://npm.meitu-int.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -1450,29 +606,27 @@ micromatch@^2.3.11: minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" - resolved "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + resolved "http://npm.meitu-int.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: brace-expansion "^1.1.7" -minimatch@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" - dependencies: - brace-expansion "^1.0.0" - minimist@0.0.8: version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + resolved "http://npm.meitu-int.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: +minimist@^1.2.0: + version "1.2.0" + resolved "http://npm.meitu-int.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +mkdirp@0.5.1: version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + resolved "http://npm.meitu-int.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" mocha@^5.2.0: version "5.2.0" - resolved "http://registry.npm.taobao.org/mocha/download/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + resolved "http://npm.meitu-int.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" dependencies: browser-stdout "1.3.1" commander "2.15.1" @@ -1486,73 +640,36 @@ mocha@^5.2.0: mkdirp "0.5.1" supports-color "5.4.0" -ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" - ms@2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + resolved "http://npm.meitu-int.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" ms@^2.1.1: version "2.1.1" - resolved "http://registry.npm.taobao.org/ms/download/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + resolved "http://npm.meitu-int.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" normalize-path@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + version "2.1.1" + resolved "http://npm.meitu-int.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" object.omit@^2.0.0: version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + resolved "http://npm.meitu-int.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" dependencies: for-own "^0.1.4" is-extendable "^0.1.1" once@^1.3.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "http://npm.meitu-int.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - parse-glob@^3.0.4: version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + resolved "http://npm.meitu-int.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -1561,454 +678,133 @@ parse-glob@^3.0.4: path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "http://npm.meitu-int.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +path-parse@^1.0.6: + version "1.0.6" + resolved "http://npm.meitu-int.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" preserve@^0.2.0: version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - -private@^0.1.6: - version "0.1.8" - resolved "http://registry.npm.taobao.org/private/download/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + resolved "http://npm.meitu-int.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -randomatic@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" - dependencies: - is-number "^2.0.2" - kind-of "^3.0.2" - -readable-stream@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729" +randomatic@^3.0.0: + version "3.1.1" + resolved "http://npm.meitu-int.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - -regenerate@^1.2.1: - version "1.4.0" - resolved "http://registry.npm.taobao.org/regenerate/download/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - -regenerator-transform@^0.10.0: - version "0.10.1" - resolved "http://registry.npm.taobao.org/regenerator-transform/download/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" - dependencies: - babel-runtime "^6.18.0" - babel-types "^6.19.0" - private "^0.1.6" + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" regex-cache@^0.4.2: - version "0.4.3" - resolved "http://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + version "0.4.4" + resolved "http://npm.meitu-int.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" dependencies: is-equal-shallow "^0.1.3" - is-primitive "^2.0.0" - -regexpu-core@^2.0.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/regexpu-core/download/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" - dependencies: - regenerate "^1.2.1" - regjsgen "^0.2.0" - regjsparser "^0.1.4" -regjsgen@^0.2.0: - version "0.2.0" - resolved "http://registry.npm.taobao.org/regjsgen/download/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" - -regjsparser@^0.1.4: - version "0.1.5" - resolved "http://registry.npm.taobao.org/regjsparser/download/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" - dependencies: - jsesc "~0.5.0" +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "http://npm.meitu-int.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + version "1.1.3" + resolved "http://npm.meitu-int.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" repeat-string@^1.5.2: version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -require-relative@0.8.7: - version "0.8.7" - resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" + resolved "http://npm.meitu-int.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" -require-uncached@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" +resolve@^1.1.6, resolve@^1.3.2, resolve@^1.8.1: + version "1.9.0" + resolved "http://npm.meitu-int.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + path-parse "^1.0.6" -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - -resolve@^1.1.6: - version "1.3.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" - dependencies: - path-parse "^1.0.5" - -resolve@^1.3.2, resolve@^1.5.0: - version "1.8.1" - resolved "http://registry.npm.taobao.org/resolve/download/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - dependencies: - path-parse "^1.0.5" - -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -rimraf@^2.2.8: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" - dependencies: - glob "^7.0.5" - -rollup-plugin-babel@^4.0.3: - version "4.0.3" - resolved "http://registry.npm.taobao.org/rollup-plugin-babel/download/rollup-plugin-babel-4.0.3.tgz#8282b0e22233160d679e9c7631342e848422fb02" +rollup-plugin-alias@^1.5.1: + version "1.5.1" + resolved "http://npm.meitu-int.com/rollup-plugin-alias/-/rollup-plugin-alias-1.5.1.tgz#80cce3a967befda5b09c86abc14a043a78035b46" dependencies: - "@babel/helper-module-imports" "^7.0.0" - rollup-pluginutils "^2.3.0" + slash "^2.0.0" -rollup-plugin-commonjs@^9.1.8: - version "9.1.8" - resolved "http://registry.npm.taobao.org/rollup-plugin-commonjs/download/rollup-plugin-commonjs-9.1.8.tgz#4113ed94e6054b5f8a3501d8811f934cadde3246" +rollup-plugin-babel-minify@^6.2.0: + version "6.2.0" + resolved "http://npm.meitu-int.com/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-6.2.0.tgz#d101fa6c1ff79c67b2af91632a87284bf1bd7f8b" dependencies: - estree-walker "^0.5.1" - magic-string "^0.22.4" - resolve "^1.5.0" - rollup-pluginutils "^2.0.1" + "@babel/core" "^7.0.0" + "@comandeer/babel-plugin-banner" "^4.0.0" + babel-preset-minify "^0.5.0" + sourcemap-codec "^1.4.3" -rollup-plugin-node-resolve@^3.4.0: +rollup-plugin-node-resolve@^3.0.0: version "3.4.0" - resolved "http://registry.npm.taobao.org/rollup-plugin-node-resolve/download/rollup-plugin-node-resolve-3.4.0.tgz#908585eda12e393caac7498715a01e08606abc89" + resolved "http://npm.meitu-int.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.4.0.tgz#908585eda12e393caac7498715a01e08606abc89" dependencies: builtin-modules "^2.0.0" is-module "^1.0.0" resolve "^1.1.6" -rollup-plugin-sourcemaps@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.4.1.tgz#fa7decbe012989e10d1aa6851d0c11e6d48812b7" - dependencies: - rollup-pluginutils "^1.5.0" - source-map-resolve "^0.5.0" - -rollup-plugin-uglify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-1.0.1.tgz#11d0b0c8bcd2d07e6908f74fd16b0152390b922a" - dependencies: - uglify-js "^2.6.1" - -rollup-pluginutils@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" +rollup-plugin-typescript@^1.0.0: + version "1.0.0" + resolved "http://npm.meitu-int.com/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.0.tgz#f7bcefe576011d9d2ebcc725b542ef35fb5005d4" dependencies: - estree-walker "^0.2.1" - minimatch "^3.0.2" + resolve "^1.8.1" + rollup-pluginutils "^2.3.1" -rollup-pluginutils@^2.0.1, rollup-pluginutils@^2.3.0: +rollup-pluginutils@^2.3.1: version "2.3.3" - resolved "http://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" + resolved "http://npm.meitu-int.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" dependencies: estree-walker "^0.5.2" micromatch "^2.3.11" -rollup-watch@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/rollup-watch/-/rollup-watch-3.2.2.tgz#5e574232e9ef36da9177f46946d8080cb267354b" - dependencies: - require-relative "0.8.7" - -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" - dependencies: - once "^1.3.0" - -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" - safe-buffer@~5.1.1: version "5.1.2" - resolved "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + resolved "http://npm.meitu-int.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" -semver@^5.3.0, semver@^5.4.1: - version "5.5.1" - resolved "http://registry.npm.taobao.org/semver/download/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" +semver@^5.4.1: + version "5.6.0" + resolved "http://npm.meitu-int.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" -shelljs@^0.7.5: - version "0.7.6" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - -source-map-resolve@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.0.tgz#fcad0b64b70afb27699e425950cb5ebcd410bc20" - dependencies: - atob "^2.0.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" +slash@^2.0.0: + version "2.0.0" + resolved "http://npm.meitu-int.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" source-map@^0.5.0: version "0.5.7" - resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -source-map@~0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + resolved "http://npm.meitu-int.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^3.0.0" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +sourcemap-codec@^1.4.3: + version "1.4.4" + resolved "http://npm.meitu-int.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f" supports-color@5.4.0: version "5.4.0" - resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + resolved "http://npm.meitu-int.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" dependencies: has-flag "^3.0.0" -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - supports-color@^5.3.0: version "5.5.0" - resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + resolved "http://npm.meitu-int.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" dependencies: has-flag "^3.0.0" -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" - dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" - -text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - to-fast-properties@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + resolved "http://npm.meitu-int.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" trim-right@^1.0.1: version "1.0.1" - resolved "http://registry.npm.taobao.org/trim-right/download/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - -tryit@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -uglify-js@^2.6.1: - version "2.8.3" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.3.tgz#1ed5037bc224904c43d36e7310177c02c4c76808" - dependencies: - async "~0.2.6" - source-map "~0.5.1" - uglify-to-browserify "~1.0.0" - yargs "~3.10.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -vlq@^0.2.2: - version "0.2.3" - resolved "http://registry.npm.taobao.org/vlq/download/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" + resolved "http://npm.meitu-int.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" +tslib@^1.9.3: + version "1.9.3" + resolved "http://npm.meitu-int.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +typescript@^3.2.2: + version "3.2.2" + resolved "http://npm.meitu-int.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" wrappy@1: version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" + resolved "http://npm.meitu-int.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From 64bda8ac72c415529cf90c09d52efe78d4d81c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= Date: Thu, 20 Aug 2020 09:46:26 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20build=20con?= =?UTF-8?q?figure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/blurify.es.js | 209 ++++---- dist/blurify.es.js.map | 2 +- dist/blurify.es.min.js | 2 +- dist/blurify.es.min.js.map | 2 +- dist/blurify.js | 215 ++++---- dist/blurify.js.map | 2 +- dist/blurify.min.js | 2 +- dist/blurify.min.js.map | 2 +- package.json | 17 +- rollup.config.js | 42 +- src/index.ts | 4 +- yarn.lock | 982 ++++++++++++++----------------------- 12 files changed, 623 insertions(+), 858 deletions(-) diff --git a/dist/blurify.es.js b/dist/blurify.es.js index 7ffa4b8..84dfc15 100644 --- a/dist/blurify.es.js +++ b/dist/blurify.es.js @@ -1,109 +1,110 @@ -function preload(images) { - var imageNodes = []; - var count = 0, doneAction = function (images) { }; - images = (typeof images != 'object') ? [images] : images; - images.length === 0 && doneAction(imageNodes); - images.map(function (image) { - var _image = new Image(); - _image.crossOrigin = '*'; - _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - _image.onload = imageLoad; - _image.onerror = imageLoad; - imageNodes.push(_image); - }); - function imageLoad() { - count++; - if (count == images.length) - doneAction(imageNodes); - } - return { - done: function (cb) { - doneAction = arguments[0] || doneAction; - } - }; -} -function cssSupport(key, value) { - var element = document.createElement('div'); - switch (arguments.length) { - case 1: - return key in element.style ? true : false; - case 2: - element.style[key] = value; - return element.style[key] ? true : false; - default: - return false; - } +function preload(images) { + var imageNodes = []; + var count = 0, doneAction = function (images) { }; + images = (typeof images != 'object') ? [images] : images; + images.length === 0 && doneAction(imageNodes); + images.map(function (image) { + var _image = new Image(); + _image.crossOrigin = '*'; + _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + _image.onload = imageLoad; + _image.onerror = imageLoad; + imageNodes.push(_image); + }); + function imageLoad() { + count++; + if (count == images.length) + doneAction(imageNodes); + } + return { + done: function (cb) { + doneAction = arguments[0] || doneAction; + }, + }; +} +function cssSupport(key, value) { + var element = document.createElement('div'); + switch (arguments.length) { + case 1: + return key in element.style ? true : false; + case 2: + element.style[key] = value; + return element.style[key] ? true : false; + default: + return false; + } } -function blurify(options) { - if (options === void 0) { options = { - blur: 6, - mode: 'auto', - images: [] - }; } - if (!(this instanceof blurify)) - return new blurify(options); - if (typeof options === 'number') { - options = { - blur: options, - images: arguments[1], - mode: 'auto' - }; - } - this.options = options; - this.blur = options.blur || 6; - this.mode = options.mode || 'css'; - console.log(); - this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); - if (this.mode == 'auto') { - cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); - } - else if (this.mode == 'css') { - this.blur = this.blur / 2; - this.useCSSMode(); - } - else { - this.useCanvasMode(); - } -} -blurify.prototype.useCSSMode = function () { - var _this = this; - console.log(this.$els); - this.$els.map(function (el) { - console.log('el', el); - el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); - el.style['filter'] = el.style['-webkit-filter'] = "blur(" + _this.blur + "px)"; - }); -}; -blurify.prototype.useCanvasMode = function () { - var _this = this; - this.imageType = this.options.imageType || "image/jpeg"; - preload(this.$els).done(function (images) { - images.map(function (image, index) { - _this.$els[index].src = _this.getDataURL(image); - }); - }); -}; -blurify.prototype.blurify = function (canvas, blur) { - var ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * +blur); - for (var y = -blur; y <= blur; y += 2) { - for (var x = -blur; x <= blur; x += 2) { - ctx.drawImage(canvas, x, y); - if (x >= 0 && y >= 0) - ctx.drawImage(canvas, -(x - 1), -(y - 1)); - } - } - ctx.globalAlpha = 1; -}; -blurify.prototype.getDataURL = function (image) { - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - canvas.width = image.width; - canvas.height = image.height; - ctx.drawImage(image, 0, 0); - this.blurify(canvas, this.blur); - return canvas.toDataURL(this.imageType); +function blurify(options) { + if (options === void 0) { options = { + blur: 6, + mode: 'auto', + images: [], + }; } + if (!(this instanceof blurify)) + return new blurify(options); + if (typeof options === 'number') { + options = { + blur: options, + images: arguments[1], + mode: 'auto', + }; + } + this.options = options; + this.blur = options.blur || 6; + this.mode = options.mode || 'css'; + console.log(); + // @ts-ignore + this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); + if (this.mode == 'auto') { + cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); + } + else if (this.mode == 'css') { + this.blur = this.blur / 2; + this.useCSSMode(); + } + else { + this.useCanvasMode(); + } +} +blurify.prototype.useCSSMode = function () { + var _this = this; + console.log(this.$els); + this.$els.map(function (el) { + console.log('el', el); + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); + el.style['filter'] = el.style['-webkit-filter'] = "blur(" + _this.blur + "px)"; + }); +}; +blurify.prototype.useCanvasMode = function () { + var _this = this; + this.imageType = this.options.imageType || "image/jpeg"; + preload(this.$els).done(function (images) { + images.map(function (image, index) { + _this.$els[index].src = _this.getDataURL(image); + }); + }); +}; +blurify.prototype.blurify = function (canvas, blur) { + var ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * +blur); + for (var y = -blur; y <= blur; y += 2) { + for (var x = -blur; x <= blur; x += 2) { + ctx.drawImage(canvas, x, y); + if (x >= 0 && y >= 0) + ctx.drawImage(canvas, -(x - 1), -(y - 1)); + } + } + ctx.globalAlpha = 1; +}; +blurify.prototype.getDataURL = function (image) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + canvas.width = image.width; + canvas.height = image.height; + ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); + return canvas.toDataURL(this.imageType); }; export default blurify; diff --git a/dist/blurify.es.js.map b/dist/blurify.es.js.map index 948d5f4..552e008 100644 --- a/dist/blurify.es.js.map +++ b/dist/blurify.es.js.map @@ -1 +1 @@ -{"version":3,"file":"blurify.es.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":[],"mappings":"SAAgB,OAAO,CAAC,MAA0B;IAC9C,IAAM,UAAU,GAAuB,EAAE,CAAC;IAC1C,IAAI,KAAK,GAAG,CAAC,EAAE,UAAU,GAAG,UAAC,MAAa,KAAO,CAAC;IAElD,MAAM,GAAG,CAAC,OAAO,MAAM,IAAI,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAEzD,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;IAE9C,MAAM,CAAC,GAAG,CAAC,UAAC,KAAuB;QAC/B,IAAM,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QAC3B,MAAM,CAAC,WAAW,GAAG,GAAG,CAAC;QACzB,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAChF,MAAM,CAAC,MAAM,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AAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAEpC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC3B,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC7B,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;CAC3C,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"blurify.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/blurify.es.min.js b/dist/blurify.es.min.js index 8186c54..2f7cf21 100644 --- a/dist/blurify.es.min.js +++ b/dist/blurify.es.min.js @@ -1,2 +1,2 @@ -function preload(a){function b(){d++,d==a.length&&e(c)}var c=[],d=0,e=function(){};return a="object"==typeof a?a:[a],0===a.length&&e(c),a.map(function(a){var d=new Image;d.crossOrigin="*",d.src=a.dataset?a.dataset.src:a.getAttribute("data-src"),d.onload=b,d.onerror=b,c.push(d)}),{done:function(){e=arguments[0]||e}}}function cssSupport(a,b){var c=document.createElement("div");switch(arguments.length){case 1:return!!(a in c.style);case 2:return c.style[a]=b,!!c.style[a];default:return!1;}}function blurify(a){return void 0===a&&(a={blur:6,mode:"auto",images:[]}),this instanceof blurify?void("number"==typeof a&&(a={blur:a,images:arguments[1],mode:"auto"}),this.options=a,this.blur=a.blur||6,this.mode=a.mode||"css",console.log(),this.$els=1==a.images.nodeType?[a.images]:[].slice.call(a.images),"auto"==this.mode?cssSupport("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur/=2,this.useCSSMode()):this.useCanvasMode()):new blurify(a)}blurify.prototype.useCSSMode=function(){var a=this;console.log(this.$els),this.$els.map(function(b){console.log("el",b),b.src=b.dataset?b.dataset.src:b.getAttribute("data-src"),b.style.filter=b.style["-webkit-filter"]="blur("+a.blur+"px)"})},blurify.prototype.useCanvasMode=function(){var a=this;this.imageType=this.options.imageType||"image/jpeg",preload(this.$els).done(function(b){b.map(function(b,c){a.$els[c].src=a.getDataURL(b)})})},blurify.prototype.blurify=function(a,b){var c=a.getContext("2d");c.globalAlpha=1/(2*+b);for(var d=-b;d<=b;d+=2)for(var e=-b;e<=b;e+=2)c.drawImage(a,e,d),0<=e&&0<=d&&c.drawImage(a,-(e-1),-(d-1));c.globalAlpha=1},blurify.prototype.getDataURL=function(a){var b=document.createElement("canvas"),c=b.getContext("2d");return b.width=a.width,b.height=a.height,c.drawImage(a,0,0),this.blurify(b,this.blur),b.toDataURL(this.imageType)};export default blurify; +function t(t,e){var s=document.createElement("div");switch(arguments.length){case 1:return t in s.style;case 2:return s.style[t]=e,!!s.style[t];default:return!1}}function e(s){if(void 0===s&&(s={blur:6,mode:"auto",images:[]}),!(this instanceof e))return new e(s);"number"==typeof s&&(s={blur:s,images:arguments[1],mode:"auto"}),this.options=s,this.blur=s.blur||6,this.mode=s.mode||"css",console.log(),this.$els=1==s.images.nodeType?[s.images]:[].slice.call(s.images),"auto"==this.mode?t("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur=this.blur/2,this.useCSSMode()):this.useCanvasMode()}e.prototype.useCSSMode=function(){var t=this;console.log(this.$els),this.$els.map((function(e){console.log("el",e),e.src=e.dataset?e.dataset.src:e.getAttribute("data-src"),e.style.filter=e.style["-webkit-filter"]="blur("+t.blur+"px)"}))},e.prototype.useCanvasMode=function(){var t=this;this.imageType=this.options.imageType||"image/jpeg",function(t){var e=[],s=0,o=function(t){};function a(){++s==t.length&&o(e)}return 0===(t="object"!=typeof t?[t]:t).length&&o(e),t.map((function(t){var s=new Image;s.crossOrigin="*",s.src=t.dataset?t.dataset.src:t.getAttribute("data-src"),s.onload=a,s.onerror=a,e.push(s)})),{done:function(t){o=arguments[0]||o}}}(this.$els).done((function(e){e.map((function(e,s){t.$els[s].src=t.getDataURL(e)}))}))},e.prototype.blurify=function(t,e){var s=t.getContext("2d");s.globalAlpha=1/(2*+e);for(var o=-e;o<=e;o+=2)for(var a=-e;a<=e;a+=2)s.drawImage(t,a,o),a>=0&&o>=0&&s.drawImage(t,-(a-1),-(o-1));s.globalAlpha=1},e.prototype.getDataURL=function(t){var e=document.createElement("canvas"),s=e.getContext("2d");return e.width=t.width,e.height=t.height,s.drawImage(t,0,0),this.blurify(e,this.blur),e.toDataURL(this.imageType)};export default e; //# sourceMappingURL=blurify.es.min.js.map diff --git a/dist/blurify.es.min.js.map b/dist/blurify.es.min.js.map index 5ff84d3..2a67b56 100644 --- a/dist/blurify.es.min.js.map +++ b/dist/blurify.es.min.js.map @@ -1 +1 @@ -{"version":3,"file":"blurify.es.min.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","images","imageLoad","count","length","doneAction","imageNodes","map","image","_image","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","push","done","arguments","cssSupport","key","value","element","document","createElement","style","blurify","options","blur","mode","console","log","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","el","_this","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":"QAAgBA,CAAAA,QAAQC,GAiBpB,QAASC,CAAAA,CAAT,GACIC,CAAK,GACDA,CAAK,EAAIF,CAAM,CAACG,QAAQC,CAAU,CAACC,CAAD,CACzC,IAnBKA,CAAAA,CAAU,CAAuB,GACnCH,CAAK,CAAG,EAAGE,CAAU,CAAG,WAAqB,EAoBjD,MAlBAJ,CAAAA,CAAM,CAAqB,QAAjB,QAAOA,CAAAA,CAAR,CAAyCA,CAAzC,CAA8B,CAACA,CAAD,CAkBvC,CAhBkB,CAAlB,GAAAA,CAAM,CAACG,MAAP,EAAuBC,CAAU,CAACC,CAAD,CAgBjC,CAdAL,CAAM,CAACM,GAAP,CAAW,SAACC,CAAD,EACP,GAAMC,CAAAA,CAAM,CAAG,GAAIC,CAAAA,KAAnB,CACAD,CAAM,CAACE,WAAP,CAAqB,IACrBF,CAAM,CAACG,GAAP,CAAaJ,CAAK,CAACK,OAAN,CAAgBL,CAAK,CAACK,OAAN,CAAcD,GAA9B,CAAoCJ,CAAK,CAACM,YAAN,CAAmB,UAAnB,EACjDL,CAAM,CAACM,MAAP,CAAgBb,EAChBO,CAAM,CAACO,OAAP,CAAiBd,EACjBI,CAAU,CAACW,IAAX,CAAgBR,CAAhB,CACH,CAPD,CAcA,CAAO,CACHS,IAAI,YACAb,CAAU,CAAGc,SAAS,CAAC,CAAD,CAAT,EAAgBd,CAChC,CAHE,CAKV,SAEee,CAAAA,WAAWC,EAAaC,GACpC,GA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K,SAAJ,CAAcN,CAAd,CAAsBK,CAAtB,CAAyBD,CAAzB,CADJ,CAEa,CAAL,EAAAC,CAAC,EAAc,CAAL,EAAAD,CAFlB,EAE0BH,CAAG,CAACK,SAAJ,CAAcN,CAAd,CAAsB,EAAEK,CAAC,CAAG,CAAN,CAAtB,CAAgC,EAAED,CAAC,CAAG,CAAN,CAAhC,CAF1B,CAKJH,CAAG,CAACE,WAAJ,CAAkB,CACrB,EAEDrB,OAAO,CAACY,SAAR,CAAkBK,UAAlB,CAA+B,SAASpC,CAAT,KACrBqC,CAAAA,CAAM,CAAGrB,QAAQ,CAACC,aAAT,CAAuB,QAAvB,EACTqB,CAAG,CAAGD,CAAM,CAACE,UAAP,CAAkB,IAAlB,EAQZ,MANAF,CAAAA,CAAM,CAACO,KAAP,CAAe5C,CAAK,CAAC4C,KAMrB,CALAP,CAAM,CAACQ,MAAP,CAAgB7C,CAAK,CAAC6C,MAKtB,CAJAP,CAAG,CAACK,SAAJ,CAAc3C,CAAd,CAAqB,CAArB,CAAwB,CAAxB,CAIA,CAFA,KAAKmB,OAAL,CAAakB,CAAb,CAAqB,KAAKhB,IAA1B,CAEA,CAAOgB,CAAM,CAACS,SAAP,CAAiB,KAAKZ,SAAtB,CACV"} \ No newline at end of file +{"version":3,"file":"blurify.es.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/blurify.js b/dist/blurify.js index 1314fbd..70e8b54 100644 --- a/dist/blurify.js +++ b/dist/blurify.js @@ -1,118 +1,119 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : - global.blurify = factory(); -}(typeof self !== 'undefined' ? self : this, function () { 'use strict'; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.blurify = factory()); +}(this, (function () { 'use strict'; - function preload(images) { - var imageNodes = []; - var count = 0, doneAction = function (images) { }; - images = (typeof images != 'object') ? [images] : images; - images.length === 0 && doneAction(imageNodes); - images.map(function (image) { - var _image = new Image(); - _image.crossOrigin = '*'; - _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); - _image.onload = imageLoad; - _image.onerror = imageLoad; - imageNodes.push(_image); - }); - function imageLoad() { - count++; - if (count == images.length) - doneAction(imageNodes); - } - return { - done: function (cb) { - doneAction = arguments[0] || doneAction; - } - }; - } - function cssSupport(key, value) { - var element = document.createElement('div'); - switch (arguments.length) { - case 1: - return key in element.style ? true : false; - case 2: - element.style[key] = value; - return element.style[key] ? true : false; - default: - return false; - } + function preload(images) { + var imageNodes = []; + var count = 0, doneAction = function (images) { }; + images = (typeof images != 'object') ? [images] : images; + images.length === 0 && doneAction(imageNodes); + images.map(function (image) { + var _image = new Image(); + _image.crossOrigin = '*'; + _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src'); + _image.onload = imageLoad; + _image.onerror = imageLoad; + imageNodes.push(_image); + }); + function imageLoad() { + count++; + if (count == images.length) + doneAction(imageNodes); + } + return { + done: function (cb) { + doneAction = arguments[0] || doneAction; + }, + }; + } + function cssSupport(key, value) { + var element = document.createElement('div'); + switch (arguments.length) { + case 1: + return key in element.style ? true : false; + case 2: + element.style[key] = value; + return element.style[key] ? true : false; + default: + return false; + } } - function blurify(options) { - if (options === void 0) { options = { - blur: 6, - mode: 'auto', - images: [] - }; } - if (!(this instanceof blurify)) - return new blurify(options); - if (typeof options === 'number') { - options = { - blur: options, - images: arguments[1], - mode: 'auto' - }; - } - this.options = options; - this.blur = options.blur || 6; - this.mode = options.mode || 'css'; - console.log(); - this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); - if (this.mode == 'auto') { - cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); - } - else if (this.mode == 'css') { - this.blur = this.blur / 2; - this.useCSSMode(); - } - else { - this.useCanvasMode(); - } - } - blurify.prototype.useCSSMode = function () { - var _this = this; - console.log(this.$els); - this.$els.map(function (el) { - console.log('el', el); - el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); - el.style['filter'] = el.style['-webkit-filter'] = "blur(" + _this.blur + "px)"; - }); - }; - blurify.prototype.useCanvasMode = function () { - var _this = this; - this.imageType = this.options.imageType || "image/jpeg"; - preload(this.$els).done(function (images) { - images.map(function (image, index) { - _this.$els[index].src = _this.getDataURL(image); - }); - }); - }; - blurify.prototype.blurify = function (canvas, blur) { - var ctx = canvas.getContext('2d'); - ctx.globalAlpha = 1 / (2 * +blur); - for (var y = -blur; y <= blur; y += 2) { - for (var x = -blur; x <= blur; x += 2) { - ctx.drawImage(canvas, x, y); - if (x >= 0 && y >= 0) - ctx.drawImage(canvas, -(x - 1), -(y - 1)); - } - } - ctx.globalAlpha = 1; - }; - blurify.prototype.getDataURL = function (image) { - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - canvas.width = image.width; - canvas.height = image.height; - ctx.drawImage(image, 0, 0); - this.blurify(canvas, this.blur); - return canvas.toDataURL(this.imageType); + function blurify(options) { + if (options === void 0) { options = { + blur: 6, + mode: 'auto', + images: [], + }; } + if (!(this instanceof blurify)) + return new blurify(options); + if (typeof options === 'number') { + options = { + blur: options, + images: arguments[1], + mode: 'auto', + }; + } + this.options = options; + this.blur = options.blur || 6; + this.mode = options.mode || 'css'; + console.log(); + // @ts-ignore + this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); + if (this.mode == 'auto') { + cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode(); + } + else if (this.mode == 'css') { + this.blur = this.blur / 2; + this.useCSSMode(); + } + else { + this.useCanvasMode(); + } + } + blurify.prototype.useCSSMode = function () { + var _this = this; + console.log(this.$els); + this.$els.map(function (el) { + console.log('el', el); + el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src'); + el.style['filter'] = el.style['-webkit-filter'] = "blur(" + _this.blur + "px)"; + }); + }; + blurify.prototype.useCanvasMode = function () { + var _this = this; + this.imageType = this.options.imageType || "image/jpeg"; + preload(this.$els).done(function (images) { + images.map(function (image, index) { + _this.$els[index].src = _this.getDataURL(image); + }); + }); + }; + blurify.prototype.blurify = function (canvas, blur) { + var ctx = canvas.getContext('2d'); + ctx.globalAlpha = 1 / (2 * +blur); + for (var y = -blur; y <= blur; y += 2) { + for (var x = -blur; x <= blur; x += 2) { + ctx.drawImage(canvas, x, y); + if (x >= 0 && y >= 0) + ctx.drawImage(canvas, -(x - 1), -(y - 1)); + } + } + ctx.globalAlpha = 1; + }; + blurify.prototype.getDataURL = function (image) { + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + canvas.width = image.width; + canvas.height = image.height; + ctx.drawImage(image, 0, 0); + this.blurify(canvas, this.blur); + return canvas.toDataURL(this.imageType); }; return blurify; -})); +}))); //# sourceMappingURL=blurify.js.map diff --git a/dist/blurify.js.map b/dist/blurify.js.map index 83f0779..da81fc7 100644 --- a/dist/blurify.js.map +++ b/dist/blurify.js.map @@ -1 +1 @@ -{"version":3,"file":"blurify.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":[],"mappings":";;;;;;aAAgB,OAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/blurify.min.js b/dist/blurify.min.js index 91429fc..a200deb 100644 --- a/dist/blurify.min.js +++ b/dist/blurify.min.js @@ -1,2 +1,2 @@ -(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.blurify=b()})("undefined"==typeof self?this:self,function(){"use strict";function a(a){function b(){d++,d==a.length&&e(c)}var c=[],d=0,e=function(){};return a="object"==typeof a?a:[a],0===a.length&&e(c),a.map(function(a){var d=new Image;d.crossOrigin="*",d.src=a.dataset?a.dataset.src:a.getAttribute("data-src"),d.onload=b,d.onerror=b,c.push(d)}),{done:function(){e=arguments[0]||e}}}function b(a,b){var c=document.createElement("div");switch(arguments.length){case 1:return!!(a in c.style);case 2:return c.style[a]=b,!!c.style[a];default:return!1;}}function c(a){return void 0===a&&(a={blur:6,mode:"auto",images:[]}),this instanceof c?void("number"==typeof a&&(a={blur:a,images:arguments[1],mode:"auto"}),this.options=a,this.blur=a.blur||6,this.mode=a.mode||"css",console.log(),this.$els=1==a.images.nodeType?[a.images]:[].slice.call(a.images),"auto"==this.mode?b("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur/=2,this.useCSSMode()):this.useCanvasMode()):new c(a)}return c.prototype.useCSSMode=function(){var a=this;console.log(this.$els),this.$els.map(function(b){console.log("el",b),b.src=b.dataset?b.dataset.src:b.getAttribute("data-src"),b.style.filter=b.style["-webkit-filter"]="blur("+a.blur+"px)"})},c.prototype.useCanvasMode=function(){var b=this;this.imageType=this.options.imageType||"image/jpeg",a(this.$els).done(function(a){a.map(function(a,c){b.$els[c].src=b.getDataURL(a)})})},c.prototype.blurify=function(a,b){var c=a.getContext("2d");c.globalAlpha=1/(2*+b);for(var d=-b;d<=b;d+=2)for(var e=-b;e<=b;e+=2)c.drawImage(a,e,d),0<=e&&0<=d&&c.drawImage(a,-(e-1),-(d-1));c.globalAlpha=1},c.prototype.getDataURL=function(a){var b=document.createElement("canvas"),c=b.getContext("2d");return b.width=a.width,b.height=a.height,c.drawImage(a,0,0),this.blurify(b,this.blur),b.toDataURL(this.imageType)},c}); +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).blurify=t()}(this,(function(){"use strict";function e(e,t){var o=document.createElement("div");switch(arguments.length){case 1:return e in o.style;case 2:return o.style[e]=t,!!o.style[e];default:return!1}}function t(o){if(void 0===o&&(o={blur:6,mode:"auto",images:[]}),!(this instanceof t))return new t(o);"number"==typeof o&&(o={blur:o,images:arguments[1],mode:"auto"}),this.options=o,this.blur=o.blur||6,this.mode=o.mode||"css",console.log(),this.$els=1==o.images.nodeType?[o.images]:[].slice.call(o.images),"auto"==this.mode?e("filter","blur(1px)")?this.useCSSMode():this.useCanvasMode():"css"==this.mode?(this.blur=this.blur/2,this.useCSSMode()):this.useCanvasMode()}return t.prototype.useCSSMode=function(){var e=this;console.log(this.$els),this.$els.map((function(t){console.log("el",t),t.src=t.dataset?t.dataset.src:t.getAttribute("data-src"),t.style.filter=t.style["-webkit-filter"]="blur("+e.blur+"px)"}))},t.prototype.useCanvasMode=function(){var e=this;this.imageType=this.options.imageType||"image/jpeg",function(e){var t=[],o=0,s=function(e){};function i(){++o==e.length&&s(t)}return 0===(e="object"!=typeof e?[e]:e).length&&s(t),e.map((function(e){var o=new Image;o.crossOrigin="*",o.src=e.dataset?e.dataset.src:e.getAttribute("data-src"),o.onload=i,o.onerror=i,t.push(o)})),{done:function(e){s=arguments[0]||s}}}(this.$els).done((function(t){t.map((function(t,o){e.$els[o].src=e.getDataURL(t)}))}))},t.prototype.blurify=function(e,t){var o=e.getContext("2d");o.globalAlpha=1/(2*+t);for(var s=-t;s<=t;s+=2)for(var i=-t;i<=t;i+=2)o.drawImage(e,i,s),i>=0&&s>=0&&o.drawImage(e,-(i-1),-(s-1));o.globalAlpha=1},t.prototype.getDataURL=function(e){var t=document.createElement("canvas"),o=t.getContext("2d");return t.width=e.width,t.height=e.height,o.drawImage(e,0,0),this.blurify(t,this.blur),t.toDataURL(this.imageType)},t})); //# sourceMappingURL=blurify.min.js.map diff --git a/dist/blurify.min.js.map b/dist/blurify.min.js.map index 2595e86..4ec9b13 100644 --- a/dist/blurify.min.js.map +++ b/dist/blurify.min.js.map @@ -1 +1 @@ -{"version":3,"file":"blurify.min.js","sources":["../src/common.ts","../src/index.ts"],"sourcesContent":["export function preload(images: HTMLImageElement[]) {\n const imageNodes: HTMLImageElement[] = [];\n let count = 0, doneAction = (images: any[]) => {};\n\n images = (typeof images != 'object') ? [images] : images;\n\n images.length === 0 && doneAction(imageNodes);\n\n images.map((image: HTMLImageElement) => {\n const _image = new Image();\n _image.crossOrigin = '*';\n _image.src = image.dataset ? image.dataset.src : image.getAttribute('data-src');\n _image.onload = imageLoad;\n _image.onerror = imageLoad;\n imageNodes.push(_image);\n });\n\n function imageLoad() {\n count++;\n if (count == images.length) doneAction(imageNodes);\n }\n\n return {\n done(cb: (images: []) => void) {\n doneAction = arguments[0] || doneAction;\n },\n };\n}\n\nexport function cssSupport(key: string, value: string) {\n const element: HTMLDivElement = document.createElement('div');\n\n switch (arguments.length) {\n case 1:\n return key in element.style ? true : false;\n case 2:\n element.style[key] = value;\n return element.style[key] ? true : false;\n default:\n return false;\n }\n}\n","import { preload, cssSupport } from './common';\n\nexport default function blurify(options: {\n blur: number\n mode: string\n images: HTMLImageElement | HTMLImageElement[]\n} = {\n blur: 6,\n mode: 'auto',\n images: [],\n}) {\n if (!(this instanceof blurify)) return new blurify(options);\n\n if (typeof options === 'number') {\n options = {\n blur: options,\n images: arguments[1],\n mode: 'auto',\n };\n }\n\n this.options = options;\n this.blur = options.blur || 6;\n this.mode = options.mode || 'css';\n console.log();\n \n this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images);\n\n if (this.mode == 'auto') {\n cssSupport('filter', 'blur(1px)') ? this.useCSSMode() : this.useCanvasMode();\n } else if (this.mode == 'css') {\n this.blur = this.blur / 2;\n this.useCSSMode();\n } else {\n this.useCanvasMode();\n }\n}\n\nblurify.prototype.useCSSMode = function (): void {\n console.log(this.$els);\n \n this.$els.map((el: HTMLImageElement) => {\n console.log('el', el);\n \n el.src = el.dataset ? el.dataset.src : el.getAttribute('data-src');\n el.style['filter'] = el.style['-webkit-filter'] = `blur(${this.blur}px)`;\n });\n};\n\nblurify.prototype.useCanvasMode = function (): void {\n this.imageType = this.options.imageType || `image/jpeg`;\n\n preload(this.$els).done((images: []) => {\n images.map((image, index) => {\n this.$els[index].src = this.getDataURL(image);\n });\n });\n};\n\nblurify.prototype.blurify = function (canvas: HTMLCanvasElement, blur: number | string): void {\n const ctx = canvas.getContext('2d');\n ctx.globalAlpha = 1 / (2 * +blur);\n for (let y = -blur; y <= blur; y += 2) {\n for (let x = -blur; x <= blur; x += 2) {\n ctx.drawImage(canvas, x, y);\n if (x >= 0 && y >= 0) ctx.drawImage(canvas, -(x - 1), -(y - 1));\n }\n }\n ctx.globalAlpha = 1;\n};\n\nblurify.prototype.getDataURL = function(image: HTMLImageElement) {\n const canvas = document.createElement('canvas');\n const ctx = canvas.getContext('2d');\n\n canvas.width = image.width;\n canvas.height = image.height;\n ctx.drawImage(image, 0, 0);\n\n this.blurify(canvas, this.blur);\n\n return canvas.toDataURL(this.imageType);\n};\n"],"names":["preload","images","imageLoad","count","length","doneAction","imageNodes","map","image","_image","Image","crossOrigin","src","dataset","getAttribute","onload","onerror","push","done","arguments","cssSupport","key","value","element","document","createElement","style","blurify","options","blur","mode","console","log","$els","nodeType","slice","call","useCSSMode","useCanvasMode","prototype","el","_this","imageType","index","getDataURL","canvas","ctx","getContext","globalAlpha","y","x","drawImage","width","height","toDataURL"],"mappings":"0NAAgBA,CAAAA,EAAQC,GAiBpB,QAASC,CAAAA,CAAT,GACIC,CAAK,GACDA,CAAK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B,EACTqB,CAAG,CAAGD,CAAM,CAACE,UAAP,CAAkB,IAAlB,EAQZ,MANAF,CAAAA,CAAM,CAACO,KAAP,CAAe5C,CAAK,CAAC4C,KAMrB,CALAP,CAAM,CAACQ,MAAP,CAAgB7C,CAAK,CAAC6C,MAKtB,CAJAP,CAAG,CAACK,SAAJ,CAAc3C,CAAd,CAAqB,CAArB,CAAwB,CAAxB,CAIA,CAFA,KAAKmB,OAAL,CAAakB,CAAb,CAAqB,KAAKhB,IAA1B,CAEA,CAAOgB,CAAM,CAACS,SAAP,CAAiB,KAAKZ,SAAtB,CACV"} \ No newline at end of file +{"version":3,"file":"blurify.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/package.json b/package.json index 83ec84c..aafb058 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "start": "NODE_ENV=development rollup -w -c rollup.config.js", "dev": "NODE_ENV=development rollup -c rollup.config.js", "prod": "NODE_ENV=production rollup -c rollup.config.js", - "publish": "rm -rf dist && npm run dev && npm run prod" + "build": "rm -rf dist && npm run dev && npm run prod" }, "repository": { "type": "git", @@ -26,13 +26,14 @@ }, "homepage": "https://github.com/JustClear/blurify#readme", "devDependencies": { - "tslib": "^1.9.3", - "mocha": "^5.2.0", "expect.js": "^0.3.1", - "typescript": "^3.2.2", - "rollup-plugin-alias": "^1.5.1", - "rollup-plugin-babel-minify": "^6.2.0", - "rollup-plugin-node-resolve": "^3.0.0", - "rollup-plugin-typescript": "^1.0.0" + "mocha": "^5.2.0", + "@rollup/plugin-commonjs": "^14.0.0", + "@rollup/plugin-node-resolve": "^8.4.0", + "rollup": "^2.26.4", + "rollup-plugin-terser": "^7.0.0", + "rollup-plugin-typescript2": "^0.27.1", + "tslib": "^2.0.0", + "typescript": "^3.9.3" } } diff --git a/rollup.config.js b/rollup.config.js index 819c798..0ce8b81 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,16 +1,20 @@ -import alias from 'rollup-plugin-alias'; -import minify from 'rollup-plugin-babel-minify'; -import resolve from 'rollup-plugin-node-resolve'; -import typescript from 'rollup-plugin-typescript'; +import { terser } from 'rollup-plugin-terser' +import { nodeResolve } from '@rollup/plugin-node-resolve' +import typescript from 'rollup-plugin-typescript2' +import commonjs from '@rollup/plugin-commonjs' -const isProd = process.env.NODE_ENV === 'production'; -const { moduleName } = require('./package.json'); -const getFilePath = (type = '') => `dist/${moduleName}${type == '' ? '' : '.'}${type}.js`; +const isProd = process.env.NODE_ENV === 'production' +const { moduleName, name } = require('./package.json') +const fileName = name +const getFilePath = (format = '') => `dist/${fileName}${format == '' ? '' : '.'}${format}.js` const output = options => ({ name: moduleName, sourcemap: true, ...options, -}); + globals: { + // + }, +}) const configure = { input: 'src/index.ts', @@ -22,24 +26,20 @@ const configure = { format: 'es', })], plugins: [ - alias({ - common: './common', - }), typescript(), - resolve({ - extensions: ['.js', '.ts'], - }), + commonjs(), + nodeResolve(), ], external: [], -}; +} if (isProd) { configure.output = configure.output.map(output => { - const format = output.format == 'umd' ? '' : `.${output.format}`; - output.file = `dist/${moduleName}${format}.min.js`; - return output; - }); - configure.plugins.push(minify()); + const format = output.format == 'umd' ? '' : `.${output.format}` + output.file = `dist/${fileName}${format}.min.js` + return output + }) + configure.plugins.push(terser()) } -module.exports = configure; +module.exports = configure diff --git a/src/index.ts b/src/index.ts index ef234c0..cfa249b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ export default function blurify(options: { mode: 'auto', images: [], }) { - if (!(this instanceof blurify)) return new blurify(options); + if (!(this instanceof blurify)) return new (blurify as any)(options); if (typeof options === 'number') { options = { @@ -23,7 +23,7 @@ export default function blurify(options: { this.blur = options.blur || 6; this.mode = options.mode || 'css'; console.log(); - + this.$els = options.images.nodeType == 1 ? [options.images] : [].slice.call(options.images); if (this.mode == 'auto') { diff --git a/yarn.lock b/yarn.lock index e5a6cf3..24e3be4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,332 +2,123 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "http://npm.meitu-int.com/@babel%2fcode-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/core@^7.0.0": - version "7.2.2" - resolved "http://npm.meitu-int.com/@babel%2fcore/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helpers" "^7.2.0" - "@babel/parser" "^7.2.2" - "@babel/template" "^7.2.2" - "@babel/traverse" "^7.2.2" - "@babel/types" "^7.2.2" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.10" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/generator@^7.2.2": - version "7.2.2" - resolved "http://npm.meitu-int.com/@babel%2fgenerator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" - dependencies: - "@babel/types" "^7.2.2" - jsesc "^2.5.1" - lodash "^4.17.10" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/helper-function-name@^7.1.0": - version "7.1.0" - resolved "http://npm.meitu-int.com/@babel%2fhelper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" - dependencies: - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-get-function-arity@^7.0.0": - version "7.0.0" - resolved "http://npm.meitu-int.com/@babel%2fhelper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" +"@babel/code-frame@^7.10.4": + version "7.10.4" + resolved "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" + integrity sha1-Fo2ho26Q2miujUnA8bSMfGJJITo= dependencies: - "@babel/types" "^7.0.0" + "@babel/highlight" "^7.10.4" -"@babel/helper-split-export-declaration@^7.0.0": - version "7.0.0" - resolved "http://npm.meitu-int.com/@babel%2fhelper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helpers@^7.2.0": - version "7.2.0" - resolved "http://npm.meitu-int.com/@babel%2fhelpers/-/helpers-7.2.0.tgz#8335f3140f3144270dc63c4732a4f8b0a50b7a21" - dependencies: - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.5" - "@babel/types" "^7.2.0" +"@babel/helper-validator-identifier@^7.10.4": + version "7.10.4" + resolved "https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" + integrity sha1-p4x6clHgH2FlEtMbEK3PUq2l4NI= -"@babel/highlight@^7.0.0": - version "7.0.0" - resolved "http://npm.meitu-int.com/@babel%2fhighlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" +"@babel/highlight@^7.10.4": + version "7.10.4" + resolved "https://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.10.4.tgz?cache=0&sync_timestamp=1593521087106&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhighlight%2Fdownload%2F%40babel%2Fhighlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" + integrity sha1-fRvf1ldTU4+r5sOFls23bZrGAUM= dependencies: + "@babel/helper-validator-identifier" "^7.10.4" chalk "^2.0.0" - esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.2.2", "@babel/parser@^7.2.3": - version "7.2.3" - resolved "http://npm.meitu-int.com/@babel%2fparser/-/parser-7.2.3.tgz#32f5df65744b70888d17872ec106b02434ba1489" - -"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": - version "7.2.2" - resolved "http://npm.meitu-int.com/@babel%2ftemplate/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.2.2" - "@babel/types" "^7.2.2" - -"@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2": - version "7.2.3" - resolved "http://npm.meitu-int.com/@babel%2ftraverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.2.3" - "@babel/types" "^7.2.2" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.10" - -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.2.2": - version "7.2.2" - resolved "http://npm.meitu-int.com/@babel%2ftypes/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" - dependencies: - esutils "^2.0.2" - lodash "^4.17.10" - to-fast-properties "^2.0.0" - -"@comandeer/babel-plugin-banner@^4.0.0": - version "4.1.0" - resolved "http://npm.meitu-int.com/@comandeer%2fbabel-plugin-banner/-/babel-plugin-banner-4.1.0.tgz#5f9f22f3ba5a4e87d0c972c402f039c6eeffc079" - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "http://npm.meitu-int.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - dependencies: - color-convert "^1.9.0" +"@rollup/plugin-commonjs@^14.0.0": + version "14.0.0" + resolved "https://registry.npm.taobao.org/@rollup/plugin-commonjs/download/@rollup/plugin-commonjs-14.0.0.tgz?cache=0&sync_timestamp=1597326192868&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40rollup%2Fplugin-commonjs%2Fdownload%2F%40rollup%2Fplugin-commonjs-14.0.0.tgz#4285f9ec2db686a31129e5a2b415c94aa1f836f0" + integrity sha1-QoX57C22hqMRKeWitBXJSqH4NvA= + dependencies: + "@rollup/pluginutils" "^3.0.8" + commondir "^1.0.1" + estree-walker "^1.0.1" + glob "^7.1.2" + is-reference "^1.1.2" + magic-string "^0.25.2" + resolve "^1.11.0" + +"@rollup/plugin-node-resolve@^8.4.0": + version "8.4.0" + resolved "https://registry.npm.taobao.org/@rollup/plugin-node-resolve/download/@rollup/plugin-node-resolve-8.4.0.tgz?cache=0&sync_timestamp=1597328884850&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40rollup%2Fplugin-node-resolve%2Fdownload%2F%40rollup%2Fplugin-node-resolve-8.4.0.tgz#261d79a680e9dc3d86761c14462f24126ba83575" + integrity sha1-Jh15poDp3D2GdhwURi8kEmuoNXU= + dependencies: + "@rollup/pluginutils" "^3.1.0" + "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" + deep-freeze "^0.0.1" + deepmerge "^4.2.2" + is-module "^1.0.0" + resolve "^1.17.0" -arr-diff@^2.0.0: - version "2.0.0" - resolved "http://npm.meitu-int.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" +"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": + version "3.1.0" + resolved "https://registry.npm.taobao.org/@rollup/pluginutils/download/@rollup/pluginutils-3.1.0.tgz?cache=0&sync_timestamp=1597328386643&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40rollup%2Fpluginutils%2Fdownload%2F%40rollup%2Fpluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" + integrity sha1-cGtFJO5tyLEDs8mVUz5a1oDAK5s= dependencies: - arr-flatten "^1.0.1" - -arr-flatten@^1.0.1: - version "1.1.0" - resolved "http://npm.meitu-int.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - -array-unique@^0.2.1: - version "0.2.1" - resolved "http://npm.meitu-int.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -babel-helper-evaluate-path@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz#a62fa9c4e64ff7ea5cea9353174ef023a900a67c" - -babel-helper-flip-expressions@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz#3696736a128ac18bc25254b5f40a22ceb3c1d3fd" - -babel-helper-is-nodes-equiv@^0.0.1: - version "0.0.1" - resolved "http://npm.meitu-int.com/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz#34e9b300b1479ddd98ec77ea0bbe9342dfe39684" - -babel-helper-is-void-0@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz#7d9c01b4561e7b95dbda0f6eee48f5b60e67313e" - -babel-helper-mark-eval-scopes@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz#d244a3bef9844872603ffb46e22ce8acdf551562" + "@types/estree" "0.0.39" + estree-walker "^1.0.1" + picomatch "^2.2.2" -babel-helper-remove-or-void@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz#a4f03b40077a0ffe88e45d07010dee241ff5ae60" +"@types/estree@*": + version "0.0.45" + resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884" + integrity sha1-6Th1cpmOXs2sIhlQ2rPow7Fq+IQ= -babel-helper-to-multiple-sequence-expressions@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz#a3f924e3561882d42fcf48907aa98f7979a4588d" +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8= -babel-plugin-minify-builtins@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz#31eb82ed1a0d0efdc31312f93b6e4741ce82c36b" +"@types/node@*": + version "14.6.0" + resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-14.6.0.tgz?cache=0&sync_timestamp=1597673176468&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.6.0.tgz#7d4411bf5157339337d7cff864d9ff45f177b499" + integrity sha1-fUQRv1FXM5M318/4ZNn/RfF3tJk= -babel-plugin-minify-constant-folding@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz#f84bc8dbf6a561e5e350ff95ae216b0ad5515b6e" +"@types/resolve@1.17.1": + version "1.17.1" + resolved "https://registry.npm.taobao.org/@types/resolve/download/@types/resolve-1.17.1.tgz?cache=0&sync_timestamp=1596840738717&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fresolve%2Fdownload%2F%40types%2Fresolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha1-Ov1q2JZ8d+Q3bFmKgt3Vj0bsRdY= dependencies: - babel-helper-evaluate-path "^0.5.0" + "@types/node" "*" -babel-plugin-minify-dead-code-elimination@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.0.tgz#d23ef5445238ad06e8addf5c1cf6aec835bcda87" - dependencies: - babel-helper-evaluate-path "^0.5.0" - babel-helper-mark-eval-scopes "^0.4.3" - babel-helper-remove-or-void "^0.4.3" - lodash.some "^4.6.0" - -babel-plugin-minify-flip-comparisons@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz#00ca870cb8f13b45c038b3c1ebc0f227293c965a" - dependencies: - babel-helper-is-void-0 "^0.4.3" - -babel-plugin-minify-guarded-expressions@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.3.tgz#cc709b4453fd21b1f302877444c89f88427ce397" +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0= dependencies: - babel-helper-flip-expressions "^0.4.3" - -babel-plugin-minify-infinity@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz#dfb876a1b08a06576384ef3f92e653ba607b39ca" - -babel-plugin-minify-mangle-names@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz#bcddb507c91d2c99e138bd6b17a19c3c271e3fd3" - dependencies: - babel-helper-mark-eval-scopes "^0.4.3" - -babel-plugin-minify-numeric-literals@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz#8e4fd561c79f7801286ff60e8c5fd9deee93c0bc" - -babel-plugin-minify-replace@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz#d3e2c9946c9096c070efc96761ce288ec5c3f71c" - -babel-plugin-minify-simplify@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.0.tgz#1f090018afb90d8b54d3d027fd8a4927f243da6f" - dependencies: - babel-helper-flip-expressions "^0.4.3" - babel-helper-is-nodes-equiv "^0.0.1" - babel-helper-to-multiple-sequence-expressions "^0.5.0" - -babel-plugin-minify-type-constructors@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz#1bc6f15b87f7ab1085d42b330b717657a2156500" - dependencies: - babel-helper-is-void-0 "^0.4.3" - -babel-plugin-transform-inline-consecutive-adds@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz#323d47a3ea63a83a7ac3c811ae8e6941faf2b0d1" - -babel-plugin-transform-member-expression-literals@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz#37039c9a0c3313a39495faac2ff3a6b5b9d038bf" - -babel-plugin-transform-merge-sibling-variables@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz#85b422fc3377b449c9d1cde44087203532401dae" - -babel-plugin-transform-minify-booleans@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz#acbb3e56a3555dd23928e4b582d285162dd2b198" - -babel-plugin-transform-property-literals@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz#98c1d21e255736573f93ece54459f6ce24985d39" - dependencies: - esutils "^2.0.2" - -babel-plugin-transform-regexp-constructors@^0.4.3: - version "0.4.3" - resolved "http://npm.meitu-int.com/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz#58b7775b63afcf33328fae9a5f88fbd4fb0b4965" - -babel-plugin-transform-remove-console@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz#b980360c067384e24b357a588d807d3c83527780" - -babel-plugin-transform-remove-debugger@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz#42b727631c97978e1eb2d199a7aec84a18339ef2" - -babel-plugin-transform-remove-undefined@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz#80208b31225766c630c97fa2d288952056ea22dd" - dependencies: - babel-helper-evaluate-path "^0.5.0" - -babel-plugin-transform-simplify-comparison-operators@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9" - -babel-plugin-transform-undefined-to-void@^6.9.4: - version "6.9.4" - resolved "http://npm.meitu-int.com/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz#be241ca81404030678b748717322b89d0c8fe280" - -babel-preset-minify@^0.5.0: - version "0.5.0" - resolved "http://npm.meitu-int.com/babel-preset-minify/-/babel-preset-minify-0.5.0.tgz#e25bb8d3590087af02b650967159a77c19bfb96b" - dependencies: - babel-plugin-minify-builtins "^0.5.0" - babel-plugin-minify-constant-folding "^0.5.0" - babel-plugin-minify-dead-code-elimination "^0.5.0" - babel-plugin-minify-flip-comparisons "^0.4.3" - babel-plugin-minify-guarded-expressions "^0.4.3" - babel-plugin-minify-infinity "^0.4.3" - babel-plugin-minify-mangle-names "^0.5.0" - babel-plugin-minify-numeric-literals "^0.4.3" - babel-plugin-minify-replace "^0.5.0" - babel-plugin-minify-simplify "^0.5.0" - babel-plugin-minify-type-constructors "^0.4.3" - babel-plugin-transform-inline-consecutive-adds "^0.4.3" - babel-plugin-transform-member-expression-literals "^6.9.4" - babel-plugin-transform-merge-sibling-variables "^6.9.4" - babel-plugin-transform-minify-booleans "^6.9.4" - babel-plugin-transform-property-literals "^6.9.4" - babel-plugin-transform-regexp-constructors "^0.4.3" - babel-plugin-transform-remove-console "^6.9.4" - babel-plugin-transform-remove-debugger "^6.9.4" - babel-plugin-transform-remove-undefined "^0.5.0" - babel-plugin-transform-simplify-comparison-operators "^6.9.4" - babel-plugin-transform-undefined-to-void "^6.9.4" - lodash.isplainobject "^4.0.6" + color-convert "^1.9.0" balanced-match@^1.0.0: version "1.0.0" - resolved "http://npm.meitu-int.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + resolved "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= brace-expansion@^1.1.7: version "1.1.11" - resolved "http://npm.meitu-int.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0= dependencies: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^1.8.2: - version "1.8.5" - resolved "http://npm.meitu-int.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - browser-stdout@1.3.1: version "1.3.1" - resolved "http://npm.meitu-int.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + resolved "https://registry.npm.taobao.org/browser-stdout/download/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA= -builtin-modules@^2.0.0: - version "2.0.0" - resolved "http://npm.meitu-int.com/builtin-modules/-/builtin-modules-2.0.0.tgz#60b7ef5ae6546bd7deefa74b08b62a43a232648e" +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8= + +builtin-modules@^3.1.0: + version "3.1.0" + resolved "https://registry.npm.taobao.org/builtin-modules/download/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" + integrity sha1-qtl8FRMet2tltQ7yCOdYTNdqdIQ= chalk@^2.0.0: version "2.4.2" - resolved "http://npm.meitu-int.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + resolved "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz?cache=0&sync_timestamp=1591687076871&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchalk%2Fdownload%2Fchalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ= dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -335,122 +126,125 @@ chalk@^2.0.0: color-convert@^1.9.0: version "1.9.3" - resolved "http://npm.meitu-int.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + resolved "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg= dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" - resolved "http://npm.meitu-int.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + resolved "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= commander@2.15.1: version "2.15.1" - resolved "http://npm.meitu-int.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + resolved "https://registry.npm.taobao.org/commander/download/commander-2.15.1.tgz?cache=0&sync_timestamp=1595168214577&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha1-30boZ9D8Kuxmo0ZitAapzK//Ww8= + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1595168214577&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha1-/UhehMA+tIgcIHIrpIA16FMa6zM= + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.npm.taobao.org/commondir/download/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= concat-map@0.0.1: version "0.0.1" - resolved "http://npm.meitu-int.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -convert-source-map@^1.1.0: - version "1.6.0" - resolved "http://npm.meitu-int.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - dependencies: - safe-buffer "~5.1.1" + resolved "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= debug@3.1.0: version "3.1.0" - resolved "http://npm.meitu-int.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + resolved "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE= dependencies: ms "2.0.0" -debug@^4.1.0: - version "4.1.1" - resolved "http://npm.meitu-int.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - dependencies: - ms "^2.1.1" +deep-freeze@^0.0.1: + version "0.0.1" + resolved "https://registry.npm.taobao.org/deep-freeze/download/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" + integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ= + +deepmerge@^4.2.2: + version "4.2.2" + resolved "https://registry.npm.taobao.org/deepmerge/download/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha1-RNLqNnm49NT/ujPwPYZfwee/SVU= diff@3.5.0: version "3.5.0" - resolved "http://npm.meitu-int.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + resolved "https://registry.npm.taobao.org/diff/download/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI= escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: version "1.0.5" - resolved "http://npm.meitu-int.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -estree-walker@^0.5.2: - version "0.5.2" - resolved "http://npm.meitu-int.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" + resolved "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -esutils@^2.0.2: - version "2.0.2" - resolved "http://npm.meitu-int.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "http://npm.meitu-int.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - -expand-range@^1.8.1: - version "1.8.2" - resolved "http://npm.meitu-int.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" +estree-walker@^1.0.1: + version "1.0.1" + resolved "https://registry.npm.taobao.org/estree-walker/download/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" + integrity sha1-MbxdYSyWtwQQa0d+bdXYqhOMtwA= expect.js@^0.3.1: version "0.3.1" - resolved "http://npm.meitu-int.com/expect.js/-/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" + resolved "https://registry.npm.taobao.org/expect.js/download/expect.js-0.3.1.tgz#b0a59a0d2eff5437544ebf0ceaa6015841d09b5b" + integrity sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s= -extglob@^0.3.1: - version "0.3.2" - resolved "http://npm.meitu-int.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" +find-cache-dir@^3.3.1: + version "3.3.1" + resolved "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha1-ibM/rUpGcNqpT4Vff74x1thP6IA= dependencies: - is-extglob "^1.0.0" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "http://npm.meitu-int.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" -fill-range@^2.1.0: - version "2.2.4" - resolved "http://npm.meitu-int.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz?cache=0&sync_timestamp=1597169795121&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-up%2Fdownload%2Ffind-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk= dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" + locate-path "^5.0.0" + path-exists "^4.0.0" -for-in@^1.0.1: - version "1.0.2" - resolved "http://npm.meitu-int.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^0.1.4: - version "0.1.5" - resolved "http://npm.meitu-int.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" +fs-extra@8.1.0: + version "8.1.0" + resolved "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA= dependencies: - for-in "^1.0.1" + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" fs.realpath@^1.0.0: version "1.0.0" - resolved "http://npm.meitu-int.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -glob-base@^0.3.0: - version "0.3.0" - resolved "http://npm.meitu-int.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" + resolved "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -glob-parent@^2.0.0: - version "2.0.0" - resolved "http://npm.meitu-int.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.npm.taobao.org/fsevents/download/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha1-+3OHA66NL5/pAMM4Nt3r7ouX8j4= glob@7.1.2: version "7.1.2" - resolved "http://npm.meitu-int.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + resolved "https://registry.npm.taobao.org/glob/download/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha1-wZyd+aAocC1nhhI4SmVSQExjbRU= + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2: + version "7.1.6" + resolved "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY= dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -459,174 +253,126 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.10.0" - resolved "http://npm.meitu-int.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" +graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.4" + resolved "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha1-Ila94U02MpWMRl68ltxGfKB6Kfs= growl@1.10.5: version "1.10.5" - resolved "http://npm.meitu-int.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + resolved "https://registry.npm.taobao.org/growl/download/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4= has-flag@^3.0.0: version "3.0.0" - resolved "http://npm.meitu-int.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + resolved "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s= he@1.1.1: version "1.1.1" - resolved "http://npm.meitu-int.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + resolved "https://registry.npm.taobao.org/he/download/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= inflight@^1.0.4: version "1.0.6" - resolved "http://npm.meitu-int.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" inherits@2: - version "2.0.3" - resolved "http://npm.meitu-int.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "http://npm.meitu-int.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "http://npm.meitu-int.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "http://npm.meitu-int.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.1: - version "0.1.1" - resolved "http://npm.meitu-int.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "http://npm.meitu-int.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "http://npm.meitu-int.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" + version "2.0.4" + resolved "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w= is-module@^1.0.0: version "1.0.0" - resolved "http://npm.meitu-int.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + resolved "https://registry.npm.taobao.org/is-module/download/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= -is-number@^2.1.0: - version "2.1.0" - resolved "http://npm.meitu-int.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" +is-reference@^1.1.2: + version "1.2.1" + resolved "https://registry.npm.taobao.org/is-reference/download/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" + integrity sha1-iy2sCzcfS8mU/eq6nrVC0DAC0Lc= dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "http://npm.meitu-int.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "http://npm.meitu-int.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "http://npm.meitu-int.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + "@types/estree" "*" -isarray@1.0.0: - version "1.0.0" - resolved "http://npm.meitu-int.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isobject@^2.0.0: - version "2.1.0" - resolved "http://npm.meitu-int.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" +jest-worker@^26.2.1: + version "26.3.0" + resolved "https://registry.npm.taobao.org/jest-worker/download/jest-worker-26.3.0.tgz?cache=0&sync_timestamp=1597059193924&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-worker%2Fdownload%2Fjest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f" + integrity sha1-fIqX5PQ2S08F7YvKjKDCTeCRhx8= dependencies: - isarray "1.0.0" + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" js-tokens@^4.0.0: version "4.0.0" - resolved "http://npm.meitu-int.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + resolved "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha1-GSA/tZmR35jjoocFDUZHzerzJJk= -jsesc@^2.5.1: - version "2.5.2" - resolved "http://npm.meitu-int.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" -json5@^2.1.0: - version "2.1.0" - resolved "http://npm.meitu-int.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha1-Gvujlq/WdqbUJQTQpno6frn2KqA= dependencies: - minimist "^1.2.0" + p-locate "^4.1.0" -kind-of@^3.0.2: - version "3.2.2" - resolved "http://npm.meitu-int.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" +magic-string@^0.25.2: + version "0.25.7" + resolved "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" + integrity sha1-P0l9b9NMZpxnmNy4IfLvMfVEUFE= dependencies: - is-buffer "^1.1.5" + sourcemap-codec "^1.4.4" -kind-of@^6.0.0: - version "6.0.2" - resolved "http://npm.meitu-int.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - -lodash.isplainobject@^4.0.6: - version "4.0.6" - resolved "http://npm.meitu-int.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - -lodash.some@^4.6.0: - version "4.6.0" - resolved "http://npm.meitu-int.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - -lodash@^4.17.10: - version "4.17.11" - resolved "http://npm.meitu-int.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" +make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8= + dependencies: + semver "^6.0.0" -math-random@^1.0.1: - version "1.0.1" - resolved "http://npm.meitu-int.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" - -micromatch@^2.3.11: - version "2.3.11" - resolved "http://npm.meitu-int.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A= minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" - resolved "http://npm.meitu-int.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + resolved "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM= dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" - resolved "http://npm.meitu-int.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "http://npm.meitu-int.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + resolved "https://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= mkdirp@0.5.1: version "0.5.1" - resolved "http://npm.meitu-int.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + resolved "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" mocha@^5.2.0: version "5.2.0" - resolved "http://npm.meitu-int.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + resolved "https://registry.npm.taobao.org/mocha/download/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha1-bYrlCPWRZ/lA8rWzxKYSrlDJCuY= dependencies: browser-stdout "1.3.1" commander "2.15.1" @@ -642,169 +388,185 @@ mocha@^5.2.0: ms@2.0.0: version "2.0.0" - resolved "http://npm.meitu-int.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -ms@^2.1.1: - version "2.1.1" - resolved "http://npm.meitu-int.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - -normalize-path@^2.0.1: - version "2.1.1" - resolved "http://npm.meitu-int.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -object.omit@^2.0.0: - version "2.0.1" - resolved "http://npm.meitu-int.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" + resolved "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= once@^1.3.0: version "1.4.0" - resolved "http://npm.meitu-int.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -parse-glob@^3.0.4: - version "3.0.4" - resolved "http://npm.meitu-int.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1594559711554&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE= + dependencies: + p-try "^2.0.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz?cache=0&sync_timestamp=1597081369770&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-locate%2Fdownload%2Fp-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha1-o0KLtwiLOmApL2aRkni3wpetTwc= dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" + p-limit "^2.2.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha1-yyhoVA4xPWHeWPr741zpAE1VQOY= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha1-UTvb4tO5XXdi6METfvoZXGxhtbM= path-is-absolute@^1.0.0: version "1.0.1" - resolved "http://npm.meitu-int.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= path-parse@^1.0.6: version "1.0.6" - resolved "http://npm.meitu-int.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + resolved "https://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha1-1i27VnlAXXLEc37FhgDp3c8G0kw= -preserve@^0.2.0: - version "0.2.0" - resolved "http://npm.meitu-int.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +picomatch@^2.2.2: + version "2.2.2" + resolved "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha1-IfMz6ba46v8CRo9RRupAbTRfTa0= -randomatic@^3.0.0: - version "3.1.1" - resolved "http://npm.meitu-int.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" +pkg-dir@^4.1.0: + version "4.2.0" + resolved "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM= dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" + find-up "^4.0.0" -regex-cache@^0.4.2: - version "0.4.4" - resolved "http://npm.meitu-int.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha1-32+ENy8CcNxlzfYpE0mrekc9Tyo= dependencies: - is-equal-shallow "^0.1.3" + safe-buffer "^5.1.0" -remove-trailing-separator@^1.0.1: - version "1.1.0" - resolved "http://npm.meitu-int.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - -repeat-element@^1.1.2: - version "1.1.3" - resolved "http://npm.meitu-int.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - -repeat-string@^1.5.2: - version "1.6.1" - resolved "http://npm.meitu-int.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -resolve@^1.1.6, resolve@^1.3.2, resolve@^1.8.1: - version "1.9.0" - resolved "http://npm.meitu-int.com/resolve/-/resolve-1.9.0.tgz#a14c6fdfa8f92a7df1d996cb7105fa744658ea06" +resolve@1.17.0, resolve@^1.11.0, resolve@^1.17.0: + version "1.17.0" + resolved "https://registry.npm.taobao.org/resolve/download/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha1-sllBtUloIxzC0bt2p5y38sC/hEQ= dependencies: path-parse "^1.0.6" -rollup-plugin-alias@^1.5.1: - version "1.5.1" - resolved "http://npm.meitu-int.com/rollup-plugin-alias/-/rollup-plugin-alias-1.5.1.tgz#80cce3a967befda5b09c86abc14a043a78035b46" - dependencies: - slash "^2.0.0" - -rollup-plugin-babel-minify@^6.2.0: - version "6.2.0" - resolved "http://npm.meitu-int.com/rollup-plugin-babel-minify/-/rollup-plugin-babel-minify-6.2.0.tgz#d101fa6c1ff79c67b2af91632a87284bf1bd7f8b" - dependencies: - "@babel/core" "^7.0.0" - "@comandeer/babel-plugin-banner" "^4.0.0" - babel-preset-minify "^0.5.0" - sourcemap-codec "^1.4.3" - -rollup-plugin-node-resolve@^3.0.0: - version "3.4.0" - resolved "http://npm.meitu-int.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.4.0.tgz#908585eda12e393caac7498715a01e08606abc89" - dependencies: - builtin-modules "^2.0.0" - is-module "^1.0.0" - resolve "^1.1.6" - -rollup-plugin-typescript@^1.0.0: - version "1.0.0" - resolved "http://npm.meitu-int.com/rollup-plugin-typescript/-/rollup-plugin-typescript-1.0.0.tgz#f7bcefe576011d9d2ebcc725b542ef35fb5005d4" +rollup-plugin-terser@^7.0.0: + version "7.0.0" + resolved "https://registry.npm.taobao.org/rollup-plugin-terser/download/rollup-plugin-terser-7.0.0.tgz#26b38ada4f0b351cd7cd872ca04c0f8532d4864f" + integrity sha1-JrOK2k8LNRzXzYcsoEwPhTLUhk8= + dependencies: + "@babel/code-frame" "^7.10.4" + jest-worker "^26.2.1" + serialize-javascript "^4.0.0" + terser "^5.0.0" + +rollup-plugin-typescript2@^0.27.1: + version "0.27.2" + resolved "https://registry.npm.taobao.org/rollup-plugin-typescript2/download/rollup-plugin-typescript2-0.27.2.tgz#871a7f5d2a774f9cef50d25da868eec72acc2ed8" + integrity sha1-hxp/XSp3T5zvUNJdqGjuxyrMLtg= + dependencies: + "@rollup/pluginutils" "^3.1.0" + find-cache-dir "^3.3.1" + fs-extra "8.1.0" + resolve "1.17.0" + tslib "2.0.1" + +rollup@^2.26.4: + version "2.26.4" + resolved "https://registry.npm.taobao.org/rollup/download/rollup-2.26.4.tgz?cache=0&sync_timestamp=1597843790185&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup%2Fdownload%2Frollup-2.26.4.tgz#a8350fd6bd56fce9873a7db2bd9547d40de3992b" + integrity sha1-qDUP1r1W/OmHOn2yvZVH1A3jmSs= + optionalDependencies: + fsevents "~2.1.2" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY= + +semver@^6.0.0: + version "6.3.0" + resolved "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0= + +serialize-javascript@^4.0.0: + version "4.0.0" + resolved "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-4.0.0.tgz?cache=0&sync_timestamp=1591623621018&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fserialize-javascript%2Fdownload%2Fserialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" + integrity sha1-tSXhI4SJpez8Qq+sw/6Z5mb0sao= dependencies: - resolve "^1.8.1" - rollup-pluginutils "^2.3.1" + randombytes "^2.1.0" -rollup-pluginutils@^2.3.1: - version "2.3.3" - resolved "http://npm.meitu-int.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794" +source-map-support@~0.5.12: + version "0.5.19" + resolved "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha1-qYti+G3K9PZzmWSMCFKRq56P7WE= dependencies: - estree-walker "^0.5.2" - micromatch "^2.3.11" - -safe-buffer@~5.1.1: - version "5.1.2" - resolved "http://npm.meitu-int.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - -semver@^5.4.1: - version "5.6.0" - resolved "http://npm.meitu-int.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - -slash@^2.0.0: - version "2.0.0" - resolved "http://npm.meitu-int.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + buffer-from "^1.0.0" + source-map "^0.6.0" -source-map@^0.5.0: - version "0.5.7" - resolved "http://npm.meitu-int.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +source-map@^0.6.0, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha1-dHIq8y6WFOnCh6jQu95IteLxomM= -sourcemap-codec@^1.4.3: - version "1.4.4" - resolved "http://npm.meitu-int.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f" +sourcemap-codec@^1.4.4: + version "1.4.8" + resolved "https://registry.npm.taobao.org/sourcemap-codec/download/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha1-6oBL2UhXQC5pktBaOO8a41qatMQ= supports-color@5.4.0: version "5.4.0" - resolved "http://npm.meitu-int.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + resolved "https://registry.npm.taobao.org/supports-color/download/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q= dependencies: has-flag "^3.0.0" supports-color@^5.3.0: version "5.5.0" - resolved "http://npm.meitu-int.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + resolved "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha1-4uaaRKyHcveKHsCzW2id9lMO/I8= dependencies: has-flag "^3.0.0" -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "http://npm.meitu-int.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" +supports-color@^7.0.0: + version "7.1.0" + resolved "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1" + integrity sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E= + dependencies: + has-flag "^4.0.0" -trim-right@^1.0.1: - version "1.0.1" - resolved "http://npm.meitu-int.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +terser@^5.0.0: + version "5.2.0" + resolved "https://registry.npm.taobao.org/terser/download/terser-5.2.0.tgz?cache=0&sync_timestamp=1597763310814&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser%2Fdownload%2Fterser-5.2.0.tgz#e547d0b20926b321d3e524bf9e5bc1b10ba2f360" + integrity sha1-5UfQsgkmsyHT5SS/nlvBsQui82A= + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" -tslib@^1.9.3: - version "1.9.3" - resolved "http://npm.meitu-int.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" +tslib@2.0.1, tslib@^2.0.0: + version "2.0.1" + resolved "https://registry.npm.taobao.org/tslib/download/tslib-2.0.1.tgz?cache=0&sync_timestamp=1596752024863&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e" + integrity sha1-QQ6w0RPltjVkkO7HSWA3JbAhtD4= + +typescript@^3.9.3: + version "3.9.7" + resolved "https://registry.npm.taobao.org/typescript/download/typescript-3.9.7.tgz?cache=0&sync_timestamp=1597819730396&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa" + integrity sha1-mNYApevcOPQMsndSLxLcgA6eJfo= -typescript@^3.2.2: - version "3.2.2" - resolved "http://npm.meitu-int.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY= wrappy@1: version "1.0.2" - resolved "http://npm.meitu-int.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= From 349950bfa6c8789b423b4759210a0c62302907f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= <576839360@qq.com> Date: Fri, 18 Sep 2020 14:42:44 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=F0=9F=93=9D=20=20Update=20`package.json`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index aafb058..f9d28af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blurify", - "version": "1.2.0", + "version": "1.2.1", "description": "Image blurify.", "main": "dist/blurify.js", "moduleName": "blurify", @@ -13,18 +13,18 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/JustClear/blurify.git" + "url": "git+https://github.com/dabanlee/blurify.git" }, "keywords": [ "blurify", "library" ], - "author": "JustClear", + "author": "大板栗", "license": "MIT", "bugs": { - "url": "https://github.com/JustClear/blurify/issues" + "url": "https://github.com/dabanlee/blurify/issues" }, - "homepage": "https://github.com/JustClear/blurify#readme", + "homepage": "https://github.com/dabanlee/blurify#readme", "devDependencies": { "expect.js": "^0.3.1", "mocha": "^5.2.0", From 2bd546d51f0fa53c9c8c92e7449933230ffcdf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= <576839360@qq.com> Date: Fri, 18 Sep 2020 14:42:57 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=F0=9F=94=A8=20Update=20build=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 0ce8b81..4bfbb72 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -42,4 +42,4 @@ if (isProd) { configure.plugins.push(terser()) } -module.exports = configure +export default configure From 31dcd8ecee500846229a25ec5c094c35184df20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= <576839360@qq.com> Date: Fri, 18 Sep 2020 14:47:17 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=F0=9F=93=9D=20=20Update=20`README.md`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 38ecb7a..05f8279 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # blurify -![travis](https://api.travis-ci.org/JustClear/blurify.svg?branch=master) -[![dependencies](https://david-dm.org/justclear/blurify.svg)](https://david-dm.org/justclear/blurify#info=dependencies&view=table) -[![devDependencies](https://david-dm.org/justclear/blurify/dev-status.svg)](https://david-dm.org/justclear/blurify#info=devDependencies&view=table) +![travis](https://api.travis-ci.org/dabanlee/blurify.svg?branch=master) +[![dependencies](https://david-dm.org/dabanlee/blurify.svg)](https://david-dm.org/dabanlee/blurify#info=dependencies&view=table) +[![devDependencies](https://david-dm.org/dabanlee/blurify/dev-status.svg)](https://david-dm.org/dabanlee/blurify#info=devDependencies&view=table) blurify.js is a tiny(~2kb) library to blur pictures, with graceful downgrade support from `css` mode to `canvas` mode. @@ -14,7 +14,7 @@ $ npm i blurify ## DEMO -[Demo](https://justclear.github.io/blurify/) +[Demo](https://dabanlee.github.io/blurify/) ## Usage @@ -45,4 +45,4 @@ blurify(6, document.querySelectorAll('.blurify')); ### License -Licensed under the [MIT License](https://github.com/JustClear/blurify/blob/master/LICENSE) +Licensed under the [MIT License](https://github.com/dabanlee/blurify/blob/master/LICENSE) From c7755c9d2bc16be8b1d5a6b5850dc587c0da11e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=9D=BF=E6=A0=97?= <576839360@qq.com> Date: Fri, 18 Sep 2020 14:55:50 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=F0=9F=93=9D=20=20Update=20`README.md`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 05f8279..00b76fa 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # blurify -![travis](https://api.travis-ci.org/dabanlee/blurify.svg?branch=master) -[![dependencies](https://david-dm.org/dabanlee/blurify.svg)](https://david-dm.org/dabanlee/blurify#info=dependencies&view=table) -[![devDependencies](https://david-dm.org/dabanlee/blurify/dev-status.svg)](https://david-dm.org/dabanlee/blurify#info=devDependencies&view=table) +![npmsize](https://img.shields.io/bundlephobia/min/blurify) blurify.js is a tiny(~2kb) library to blur pictures, with graceful downgrade support from `css` mode to `canvas` mode.