@redocly/openapi-core
Version:
See https://github.com/Redocly/redocly-cli
19 lines (18 loc) • 667 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NoServerExample = void 0;
const NoServerExample = () => {
return {
Server(server, { report, location }) {
// eslint-disable-next-line no-useless-escape
const pattern = /^(.*[\/.])?(example\.com|localhost)([\/:?].*|$)/;
if (server.url && pattern.test(server.url)) {
report({
message: 'Server `url` should not point to example.com or localhost.',
location: location.child(['url']),
});
}
},
};
};
exports.NoServerExample = NoServerExample;