persona-community-5/.pnpm-store/v3/files/c2/53711f29831a397d3e4c848ece57c010831fb30edaa6eeefd18a15424f37b7ea281ab3850d84f09f2aa55d77d8a935d5fa8773101594da55bc12b0cd34d2b1
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

23 lines
970 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BooleanParameterPrefixes = void 0;
const BooleanParameterPrefixes = (options) => {
const prefixes = options.prefixes || ['is', 'has'];
const regexp = new RegExp(`^(${prefixes.join('|')})[A-Z-_]`);
const wrappedPrefixes = prefixes.map((p) => `\`${p}\``);
const prefixesString = wrappedPrefixes.length === 1
? wrappedPrefixes[0]
: wrappedPrefixes.slice(0, -1).join(', ') + ' or ' + wrappedPrefixes[prefixes.length - 1];
return {
Parameter(param, { report, location }) {
if (param.type === 'boolean' && !regexp.test(param.name)) {
report({
message: `Boolean parameter \`${param.name}\` should have ${prefixesString} prefix.`,
location: location.child('name'),
});
}
},
};
};
exports.BooleanParameterPrefixes = BooleanParameterPrefixes;