@redocly/config 0.44.0 → 0.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/asyncapi-config-schema.d.ts +300 -0
- package/lib/asyncapi-config-schema.js +53 -0
- package/lib/default-theme-config-schema.d.ts +300 -0
- package/lib/default-theme-config-schema.js +2 -0
- package/lib/ex-theme-config-schemas.d.ts +1807 -0
- package/lib/ex-theme-config-schemas.js +2 -1
- package/lib/remove-property-recursively.d.ts +1 -1
- package/lib/remove-property-recursively.js +7 -4
- package/lib/root-config-schema.d.ts +776 -0
- package/lib/root-config-schema.js +22 -2
- package/lib/types/asyncapi-types.d.ts +14 -0
- package/lib/types/asyncapi-types.js +3 -0
- package/lib/types/config-types.d.ts +24 -1
- package/lib/types/portal-shared-types.d.ts +6 -2
- package/lib-esm/asyncapi-config-schema.d.ts +300 -0
- package/lib-esm/asyncapi-config-schema.js +50 -0
- package/lib-esm/default-theme-config-schema.d.ts +300 -0
- package/lib-esm/default-theme-config-schema.js +2 -0
- package/lib-esm/ex-theme-config-schemas.d.ts +1807 -0
- package/lib-esm/ex-theme-config-schemas.js +1 -0
- package/lib-esm/remove-property-recursively.d.ts +1 -1
- package/lib-esm/remove-property-recursively.js +7 -4
- package/lib-esm/root-config-schema.d.ts +776 -0
- package/lib-esm/root-config-schema.js +22 -2
- package/lib-esm/types/asyncapi-types.d.ts +14 -0
- package/lib-esm/types/asyncapi-types.js +2 -0
- package/lib-esm/types/config-types.d.ts +24 -1
- package/lib-esm/types/portal-shared-types.d.ts +6 -2
- package/package.json +2 -2
|
@@ -374,6 +374,7 @@ export const markdownConfigSchema = {
|
|
|
374
374
|
default: {},
|
|
375
375
|
};
|
|
376
376
|
export const openapiConfigSchema = Object.assign(Object.assign({}, redocConfigSchema), { properties: Object.assign(Object.assign({}, redocConfigSchema.properties), deprecatedRefDocsSchema.properties) });
|
|
377
|
+
export const asyncapiConfigSchema = Object.assign(Object.assign({}, redocConfigSchema), { properties: Object.assign(Object.assign({}, redocConfigSchema.properties), deprecatedRefDocsSchema.properties) });
|
|
377
378
|
const adobeAnalyticsConfigSchema = {
|
|
378
379
|
type: 'object',
|
|
379
380
|
properties: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type Removed<T, Drop> = T extends Record<string, any> ? T extends ArrayLike<any> ? Array<Removed<T[number], Drop>> : {
|
|
2
2
|
[K in Exclude<keyof T, Drop>]: Removed<T[K], Drop>;
|
|
3
3
|
} : T;
|
|
4
|
-
export declare function removePropertyRecursively<TObject extends object, TProp extends string>(object: TObject, propToRemove: TProp): Removed<TObject, TProp>;
|
|
4
|
+
export declare function removePropertyRecursively<TObject extends object, TProp extends string>(object: TObject, propToRemove: TProp, parentKey?: string): Removed<TObject, TProp>;
|
|
5
5
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function removePropertyRecursively(object, propToRemove) {
|
|
1
|
+
export function removePropertyRecursively(object, propToRemove, parentKey) {
|
|
2
2
|
return Object.fromEntries(Object.entries(object)
|
|
3
3
|
.map(([key, value]) => {
|
|
4
|
-
if (key === propToRemove) {
|
|
4
|
+
if (key === propToRemove && parentKey !== 'properties') {
|
|
5
5
|
return undefined;
|
|
6
6
|
}
|
|
7
7
|
if (typeof value !== 'object' || !value) {
|
|
@@ -11,11 +11,14 @@ export function removePropertyRecursively(object, propToRemove) {
|
|
|
11
11
|
return [
|
|
12
12
|
key,
|
|
13
13
|
value.map((arrayItem) => typeof arrayItem === 'object'
|
|
14
|
-
? removePropertyRecursively(arrayItem, propToRemove)
|
|
14
|
+
? removePropertyRecursively(arrayItem, propToRemove, key)
|
|
15
15
|
: arrayItem),
|
|
16
16
|
];
|
|
17
17
|
}
|
|
18
|
-
return [
|
|
18
|
+
return [
|
|
19
|
+
key,
|
|
20
|
+
removePropertyRecursively(value, propToRemove, key),
|
|
21
|
+
];
|
|
19
22
|
})
|
|
20
23
|
.filter(Boolean));
|
|
21
24
|
}
|