Skip to content

Commit dedfda6

Browse files
committed
Remove array destructuring to make transpiled code ES5 compatible
1 parent 81a1398 commit dedfda6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/transforms/boxShadow.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ export const boxShadowToShadowProps = value => {
33
const nums = pxs
44
? pxs.map(val => val.replace("px", "")).map(val => Number(val))
55
: [];
6-
const [offsetX, offsetY, blurRadius] = nums;
7-
const [color] = pxs
6+
const offsetX = nums[0];
7+
const offsetY = nums[1];
8+
const blurRadius = nums[2];
9+
const filtered = pxs
810
? value.split(" ").filter(val => pxs.indexOf(val) === -1)
911
: [];
12+
const color = filtered[0];
1013

1114
if (offsetX === undefined || offsetY === undefined) {
1215
throw new Error(`Failed to parse declaration "boxShadow: ${value}"`);

0 commit comments

Comments
 (0)