From e80a5f41341e33f261884fdaf3d415f57959143e Mon Sep 17 00:00:00 2001 From: bplok20010 Date: Sat, 10 Oct 2020 23:24:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 117 +++++----------------------------------------- package.json | 6 +-- test/src/babel.js | 64 ++++++++++++------------- 3 files changed, 47 insertions(+), 140 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4144481..a1a5e2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "transform-es", - "version": "5.0.5", + "version": "5.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -211,11 +211,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -237,11 +232,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -263,11 +253,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -290,11 +275,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -419,11 +399,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -507,11 +482,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -532,11 +502,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -575,11 +540,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -741,13 +701,6 @@ "integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==", "requires": { "lodash": "^4.17.19" - }, - "dependencies": { - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - } } }, "@babel/helper-remap-async-to-generator": { @@ -803,11 +756,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -1000,11 +948,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -1126,11 +1069,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -1697,11 +1635,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -1824,11 +1757,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -1940,11 +1868,6 @@ "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } - }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" } } }, @@ -1963,13 +1886,6 @@ "requires": { "@babel/helper-plugin-utils": "^7.10.4", "lodash": "^4.17.19" - }, - "dependencies": { - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - } } }, "@babel/plugin-transform-react-display-name": { @@ -2231,11 +2147,6 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.578.tgz", "integrity": "sha512-z4gU6dA1CbBJsAErW5swTGAaU2TBzc2mPAonJb00zqW1rOraDo2zfBMDRvaz9cVic+0JEZiYbHWPw/fTaZlG2Q==" }, - "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" - }, "node-releases": { "version": "1.1.61", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.61.tgz", @@ -2400,13 +2311,13 @@ "dev": true }, "@types/react": { - "version": "16.9.35", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.35.tgz", - "integrity": "sha512-q0n0SsWcGc8nDqH2GJfWQWUOmZSJhXV64CjVN5SvcNti3TdEaA3AH0D8DwNmMdzjMAC/78tB8nAZIlV8yTz+zQ==", + "version": "16.9.51", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.51.tgz", + "integrity": "sha512-lQa12IyO+DMlnSZ3+AGHRUiUcpK47aakMMoBG8f7HGxJT8Yfe+WE128HIXaHOHVPReAW0oDS3KAI0JI2DDe1PQ==", "dev": true, "requires": { "@types/prop-types": "*", - "csstype": "^2.2.0" + "csstype": "^3.0.2" } }, "accord": { @@ -2812,9 +2723,9 @@ } }, "babel-preset-packez": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/babel-preset-packez/-/babel-preset-packez-1.1.0.tgz", - "integrity": "sha512-ohD+rbrbPlugZB69RrnVAkZWtarYWIrk5gDEFfuiP/zgQKOQ80WMlApm07bOVL4GgaDeD17WynHnFkI+Zx/VEA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-packez/-/babel-preset-packez-1.2.0.tgz", + "integrity": "sha512-Ku+MEYxkYTtPLnRoG6LiyWCywJTw+EPnvLIk/YzCqd9FJHIry3yIgcD0bSH1mBUGzAZV8mC+3MACX+poByHq+g==", "requires": { "@babel/core": "^7.10.2", "@babel/plugin-proposal-async-generator-functions": "^7.10.1", @@ -2834,10 +2745,6 @@ "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-top-level-await": "^7.10.1", "@babel/plugin-transform-destructuring": "^7.10.1", - "@babel/plugin-transform-modules-amd": "^7.10.1", - "@babel/plugin-transform-modules-commonjs": "^7.10.1", - "@babel/plugin-transform-modules-systemjs": "^7.10.1", - "@babel/plugin-transform-modules-umd": "^7.10.1", "@babel/plugin-transform-proto-to-assign": "^7.10.1", "@babel/plugin-transform-runtime": "^7.10.1", "@babel/preset-env": "^7.10.2", @@ -2846,7 +2753,7 @@ "@babel/runtime": "^7.10.2", "babel-plugin-dev-expression": "^0.2.2", "babel-plugin-macros": "^2.8.0", - "lodash": "^4.17.15" + "lodash": "^4.17.20" } }, "bach": { @@ -3341,9 +3248,9 @@ "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" }, "csstype": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.10.tgz", - "integrity": "sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.3.tgz", + "integrity": "sha512-jPl+wbWPOWJ7SXsWyqGRk3lGecbar0Cb0OvZF/r/ZU011R4YqiRehgkQ9p4eQfo9DSDLqLL3wHwfxeJiuIsNag==", "dev": true }, "d": { diff --git a/package.json b/package.json index 50c1e21..c0b03e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "transform-es", - "version": "5.0.5", + "version": "5.1.0", "description": "", "keywords": [ "compile", @@ -45,7 +45,7 @@ "@babel/core": "^7.10.2", "@babel/runtime": "^7.10.2", "babel-eslint": "^10.1.0", - "babel-preset-packez": "^1.1.0", + "babel-preset-packez": "^1.2.0", "chalk": "^2.4.2", "commander": "^3.0.0", "eslint": "^6.8.0", @@ -70,7 +70,7 @@ "through2": "^3.0.2" }, "devDependencies": { - "@types/react": "^16.9.35", + "@types/react": "^16.9.51", "react": "^16.13.1" }, "browserslist": [ diff --git a/test/src/babel.js b/test/src/babel.js index 3d91832..30a3585 100644 --- a/test/src/babel.js +++ b/test/src/babel.js @@ -357,39 +357,39 @@ Array.isArray(vxx); // `bar` exists } //pipeline-operator -{ - const sum = nos => nos.reduce((p, c) => p + +c, 0); - const avg = nos => sum(nos) / nos.length; - const tail = ([_, ...tail]) => tail; - const tailAndAverage = tail |> avg; // valid? - - function double(x) { - return x + x; - } - function add(x, y) { - return x + y; - } - - function boundScore(min, max, score) { - return Math.max(min, Math.min(max, score)); - } - - let person = { score: 25 }; - - let newScore = - person.score - |> double - |> (_ => add(7, _)) - |> (_ => boundScore(0, 100, _)); - - newScore; //=> 57 -} +// { +// const sum = nos => nos.reduce((p, c) => p + +c, 0); +// const avg = nos => sum(nos) / nos.length; +// const tail = ([_, ...tail]) => tail; +// const tailAndAverage = tail |> avg; // valid? + +// function double(x) { +// return x + x; +// } +// function add(x, y) { +// return x + y; +// } + +// function boundScore(min, max, score) { +// return Math.max(min, Math.min(max, score)); +// } + +// let person = { score: 25 }; + +// let newScore = +// person.score +// |> double +// |> (_ => add(7, _)) +// |> (_ => boundScore(0, 100, _)); + +// newScore; //=> 57 +// } //throw-expressions -{ - function test(param = throw new Error("required!")) { - const test = param === true || throw new Error("Falsey!"); - } -} +// { +// function test(param = throw new Error("required!")) { +// const test = param === true || throw new Error("Falsey!"); +// } +// } //react-jsx { const Hr = () => {