Skip to content

Commit a02903b

Browse files
committed
Use object spread in lieu of object-assign
1 parent bf72fb1 commit a02903b

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
],
99
"plugins": [
1010
"dynamic-import-webpack",
11-
"transform-class-properties"
11+
"transform-class-properties",
12+
"transform-object-rest-spread"
1213
]
1314
}

.eslintrc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ module.exports = {
1212
'parser': 'babel-eslint',
1313
'plugins': [
1414
'standard',
15-
'promise'
15+
'promise',
16+
'prefer-object-spread'
1617
],
1718
'rules': {
18-
'semi': ['error', 'always'],
19-
'no-var': 'error'
19+
'no-var': 'error',
20+
'prefer-object-spread/prefer-object-spread': 2,
21+
'semi': ['error', 'always']
2022
}
2123
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
"babel-loader": "^7.1.2",
1818
"babel-plugin-dynamic-import-webpack": "^1.0.1",
1919
"babel-plugin-transform-class-properties": "^6.24.1",
20+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
2021
"babel-preset-env": "^1.6.0",
2122
"css-loader": "^0.28.6",
2223
"debounce": "^1.0.2",
2324
"eslint": "^4.5.0",
2425
"eslint-config-standard": "^10.2.1",
2526
"eslint-plugin-import": "^2.7.0",
2627
"eslint-plugin-node": "^5.1.1",
28+
"eslint-plugin-prefer-object-spread": "^1.2.1",
2729
"eslint-plugin-promise": "^3.5.0",
2830
"eslint-plugin-standard": "^3.0.1",
2931
"extract-text-webpack-plugin": "^3.0.0",
@@ -37,7 +39,6 @@
3739
"html-webpack-plugin": "^2.30.1",
3840
"htmllint-loader": "^1.3.8",
3941
"node-sass": "^4.5.3",
40-
"object-assign": "^4.1.1",
4142
"postcss-loader": "^2.0.6",
4243
"sass-loader": "^6.0.6",
4344
"style-loader": "^0.18.2",

src/js/connector/polyline.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import objectAssign from 'object-assign'; // Object.assign is missing in e.g. IE11
2-
31
// TODO: just use ES6 class...
42
const AnimatedPolyline = function (options) {
53
options = options || {};
@@ -8,9 +6,9 @@ const AnimatedPolyline = function (options) {
86
strokeStyle: '#f1dbce',
97
lineWidth: 4,
108
animated: true,
11-
animateAmount: 4
9+
animateAmount: 4,
10+
...options
1211
};
13-
objectAssign(this.options, options);
1412

1513
this.finished = false;
1614
this.segments = options.segments;

0 commit comments

Comments
 (0)