Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 4018f11

Browse files
committed
refactor(oas2): use push over concat
1 parent 4d7f429 commit 4018f11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/openapi2-parser/lib/schema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ class DataStructureGenerator {
9696
} else if (refs.length > 1) {
9797
const { Ref: RefElement } = this.minim.elements;
9898
const refElements = refs.map(ref => new RefElement(ref));
99-
element.content = element.content.concat(refElements);
99+
element.content.push(...refElements);
100100
}
101101
}
102102

103-
element.content = element.content.concat(_.map(properties, (subschema, property) => {
103+
element.content.push(..._.map(properties, (subschema, property) => {
104104
const member = this.generateMember(property, subschema);
105105

106106
const isRequired = required.includes(property);
@@ -118,7 +118,7 @@ class DataStructureGenerator {
118118
member.attributes.set('typeAttributes', ['required']);
119119
return member;
120120
});
121-
element.content = element.content.concat(requiredMembers);
121+
element.content.push(...requiredMembers);
122122

123123
return element;
124124
}

0 commit comments

Comments
 (0)