Skip to content

Commit 81f4a33

Browse files
committed
fixup! refactor(@angular-devkit/core): simplify Set operations with ES2025 Set methods
1 parent bc5c066 commit 81f4a33

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/angular_devkit/core/src/json/schema

‎packages/angular_devkit/core/src/json/schema/utility.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function getTypesOfSchema(schema: JsonSchema): Set<string> {
5959
if (Array.isArray(schema.allOf)) {
6060
for (const sub of schema.allOf) {
6161
const types = getTypesOfSchema(sub as JsonObject);
62-
potentials = potentials.intersection(types);
62+
potentials = new Set([...types].filter((t) => potentials.has(t)));
6363
}
6464
}
6565

@@ -69,7 +69,7 @@ export function getTypesOfSchema(schema: JsonSchema): Set<string> {
6969
const types = getTypesOfSchema(sub as JsonObject);
7070
options = options.union(types);
7171
}
72-
potentials = potentials.intersection(options);
72+
potentials = new Set([...options].filter((o) => potentials.has(o)));
7373
}
7474

7575
if (Array.isArray(schema.anyOf)) {
@@ -78,7 +78,7 @@ export function getTypesOfSchema(schema: JsonSchema): Set<string> {
7878
const types = getTypesOfSchema(sub as JsonObject);
7979
options = options.union(types);
8080
}
81-
potentials = potentials.intersection(options);
81+
potentials = new Set([...options].filter((o) => potentials.has(o)));
8282
}
8383

8484
if (schema.properties) {

0 commit comments

Comments
 (0)