[Improvement] optimize babel plugin (#1117)

This commit is contained in:
neverland 2018-05-20 20:40:33 +08:00 committed by GitHub
parent b5139b18eb
commit e95107f14c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 6 deletions

View File

@ -1,14 +1,30 @@
{ {
"presets": [["env", { "modules": false, "loose": true }]], "presets": [
[
"env",
{
"modules": false,
"loose": true,
"exclude": ["transform-es2015-typeof-symbol"]
}
]
],
"plugins": ["transform-runtime", "transform-object-rest-spread"], "plugins": ["transform-runtime", "transform-object-rest-spread"],
"env": { "env": {
"commonjs": { "commonjs": {
"presets": [["env", { "modules": "commonjs", "loose": true }]] "presets": [
[
"env",
{
"modules": "commonjs",
"loose": true,
"exclude": ["transform-es2015-typeof-symbol"]
}
]
]
}, },
"test": { "test": {
"presets": [ "presets": [["env", { "targets": { "node": 8 } }]]
["env", { "targets": { "node": 8 }}]
]
} }
} }
} }

View File

@ -90,7 +90,7 @@ export default create({
methods: { methods: {
correctValue(value) { correctValue(value) {
return Number.isNaN(value) return isNaN(value)
? this.min ? this.min
: Math.max(this.min, Math.min(this.max, value)); : Math.max(this.min, Math.min(this.max, value));
}, },