Skip to content

Commit 88a7203

Browse files
committed
optimize build
1 parent 1f6c2d6 commit 88a7203

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/transforms/util.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import {
77
NONE,
88
} from '../tokenTypes'
99

10+
// This is the only (current) file where it would make sense to spread an array
11+
// as function call arguments. We use .apply instead to reduce filesize
12+
/* eslint-disable prefer-spread */
13+
1014
export const directionFactory = ({
1115
types = [LENGTH, UNSUPPORTED_LENGTH_UNIT, PERCENT],
1216
directions = ['Top', 'Right', 'Bottom', 'Left'],
@@ -16,11 +20,11 @@ export const directionFactory = ({
1620
const values = []
1721

1822
// borderWidth doesn't currently allow a percent value, but may do in the future
19-
values.push(tokenStream.expect(...types))
23+
values.push(tokenStream.expect.apply(tokenStream, types))
2024

2125
while (values.length < 4 && tokenStream.hasTokens()) {
2226
tokenStream.expect(SPACE)
23-
values.push(tokenStream.expect(...types))
27+
values.push(tokenStream.expect.apply(tokenStream, types))
2428
}
2529

2630
tokenStream.expectEmpty()

0 commit comments

Comments
 (0)