persona-community-5/.pnpm-store/v3/files/53/a0ddcd2266666cf97f967e150a2d736c38d7adc937c68ef51182633b3fbbf99477a31b857c2fce54aa9286772d5159cd2905a35274ca5105b4bbd186f53e80
rdev-worker a1d0d1bf1c
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
build: /implement-feature community-ui --requirements 'Build the React commu...
2026-02-24 08:22:30 +00:00

37 lines
1.6 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NoRequiredSchemaPropertiesUndefined = void 0;
const ref_utils_1 = require("../../ref-utils");
const NoRequiredSchemaPropertiesUndefined = () => {
return {
Schema: {
enter(schema, { location, report, resolve }) {
if (!schema.required)
return;
const visitedSchemas = new Set();
const elevateProperties = (schema) => {
// Check if the schema has been visited before processing it
if (visitedSchemas.has(schema)) {
return {};
}
visitedSchemas.add(schema);
if ((0, ref_utils_1.isRef)(schema)) {
return elevateProperties(resolve(schema).node);
}
return Object.assign({}, schema.properties, ...(schema.allOf?.map(elevateProperties) ?? []), ...(schema.anyOf?.map(elevateProperties) ?? []));
};
const allProperties = elevateProperties(schema);
for (const [i, requiredProperty] of schema.required.entries()) {
if (!allProperties || allProperties[requiredProperty] === undefined) {
report({
message: `Required property '${requiredProperty}' is undefined.`,
location: location.child(['required', i]),
});
}
}
},
},
};
};
exports.NoRequiredSchemaPropertiesUndefined = NoRequiredSchemaPropertiesUndefined;