Skip to content

Commit

Permalink
更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
bplok20010 committed Oct 10, 2020
1 parent 65f2d6e commit e80a5f4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 140 deletions.
117 changes: 12 additions & 105 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transform-es",
"version": "5.0.5",
"version": "5.1.0",
"description": "",
"keywords": [
"compile",
Expand Down Expand Up @@ -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",
Expand All @@ -70,7 +70,7 @@
"through2": "^3.0.2"
},
"devDependencies": {
"@types/react": "^16.9.35",
"@types/react": "^16.9.51",
"react": "^16.13.1"
},
"browserslist": [
Expand Down
64 changes: 32 additions & 32 deletions test/src/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit e80a5f4

Please sign in to comment.