Skip to content

Commit 9ca8691

Browse files
committed
Include object.assign polyfill to work on all Node versions.
1 parent 931c012 commit 9ca8691

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@
3838
"engines": {
3939
"node": ">=0.10.0"
4040
},
41-
"license": "MIT"
41+
"license": "MIT",
42+
"dependencies": {
43+
"object-assign": "^4.0.1"
44+
}
4245
}

src/util/values/expressions/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import assign from 'object-assign';
12
import Literal from '../Literal';
23
import Identifier from './Identifier';
34
import TemplateLiteral from './TemplateLiteral';
@@ -22,7 +23,7 @@ const TYPES = {
2223

2324
const noop = () => null;
2425

25-
const LITERAL_TYPES = Object.assign({}, TYPES, {
26+
const LITERAL_TYPES = assign({}, TYPES, {
2627
Identifier: value => {
2728
const isUndefined = TYPES.Identifier(value) === undefined;
2829
return isUndefined ? undefined : null;

src/util/values/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import assign from 'object-assign';
12
import Literal from './Literal';
23
import JSXElement from './JSXElement';
34
import JSXExpressionContainer from './expressions';
@@ -9,7 +10,7 @@ const TYPES = {
910
JSXExpressionContainer
1011
};
1112

12-
const LITERAL_TYPES = Object.assign({}, TYPES, {
13+
const LITERAL_TYPES = assign({}, TYPES, {
1314
JSXElement: () => null,
1415
JSXExpressionContainer: extractLiteral
1516
});

0 commit comments

Comments
 (0)