Skip to content

Commit e7a49da

Browse files
committed
When bundling remove empty $defs if nothing was bundled
1 parent 47f8b10 commit e7a49da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bundle/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ const doBundling = async (schemaUri, bundled, fullOptions, contextSchema, visite
6161
bundled = await doBundling(uri, bundled, fullOptions, schema, visited);
6262
}
6363

64+
if (Object.keys(JsonPointer.get(fullOptions.bundlingLocation, bundled)).length === 0) {
65+
JsonPointer.remove(fullOptions.bundlingLocation, bundled);
66+
}
67+
6468
return bundled;
6569
};
6670

0 commit comments

Comments
 (0)