Skip to content

Commit dfad86b

Browse files
committed
perf(util-endpoints): mutate accumulator in getEndpointProperties reduce
1 parent 6a00f07 commit dfad86b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/util-endpoints/src/utils/getEndpointProperties.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ import { EndpointError } from "../types";
55
import { evaluateTemplate } from "./evaluateTemplate";
66

77
export const getEndpointProperties = (properties: EndpointObjectProperties, options: EvaluateOptions) =>
8-
Object.entries(properties).reduce(
9-
(acc, [propertyKey, propertyVal]) => ({
10-
...acc,
11-
[propertyKey]: group.getEndpointProperty(propertyVal, options),
12-
}),
13-
{}
14-
);
8+
Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => {
9+
acc[propertyKey] = group.getEndpointProperty(propertyVal, options);
10+
return acc;
11+
}, {});
1512

1613
export const getEndpointProperty = (
1714
property: EndpointObjectProperty,

0 commit comments

Comments
 (0)