persona-community-5/.pnpm-store/v3/files/48/8ea5e3b63033490fb51abdd4bc66f0af84ea118d7fb59b3ece57436b2c0e1a3351b0a85e19c7a43a12b12af7621b76865e8eddd8628cdc683038c665ec91ca
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

27 lines
1.1 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PathHttpVerbsOrder = void 0;
const defaultOrder = ['get', 'head', 'post', 'put', 'patch', 'delete', 'options', 'trace'];
const PathHttpVerbsOrder = (opts) => {
const order = (opts && opts.order) || defaultOrder;
if (!Array.isArray(order)) {
throw new Error('path-http-verbs-order `order` option must be an array');
}
return {
PathItem(path, { report, location }) {
const httpVerbs = Object.keys(path).filter((k) => order.includes(k));
for (let i = 0; i < httpVerbs.length - 1; i++) {
const aIdx = order.indexOf(httpVerbs[i]);
const bIdx = order.indexOf(httpVerbs[i + 1]);
if (bIdx < aIdx) {
report({
message: 'Operation http verbs must be ordered.',
location: { reportOnKey: true, ...location.child(httpVerbs[i + 1]) },
});
}
}
},
};
};
exports.PathHttpVerbsOrder = PathHttpVerbsOrder;