@sapphire/framework
Version:
Discord bot framework built for advanced and amazing bots.
39 lines (37 loc) • 1.61 kB
JavaScript
;
//#region src/lib/utils/application-commands/compute-differences/option/minMaxLength.ts
function* handleMinMaxLengthOptions({ currentIndex, existingOption, expectedOption, keyPath }) {
if (existingOption.min_length === void 0 && expectedOption.min_length !== void 0) yield {
key: `${keyPath(currentIndex)}.min_length`,
expected: "min_length present",
original: "no min_length present"
};
else if (existingOption.min_length !== void 0 && expectedOption.min_length === void 0) yield {
key: `${keyPath(currentIndex)}.min_length`,
expected: "no min_length present",
original: "min_length present"
};
else if (existingOption.min_length !== expectedOption.min_length) yield {
key: `${keyPath(currentIndex)}.min_length`,
original: String(existingOption.min_length),
expected: String(expectedOption.min_length)
};
if (existingOption.max_length === void 0 && expectedOption.max_length !== void 0) yield {
key: `${keyPath(currentIndex)}.max_length`,
expected: "max_length present",
original: "no max_length present"
};
else if (existingOption.max_length !== void 0 && expectedOption.max_length === void 0) yield {
key: `${keyPath(currentIndex)}.max_length`,
expected: "no max_length present",
original: "max_length present"
};
else if (existingOption.max_length !== expectedOption.max_length) yield {
key: `${keyPath(currentIndex)}.max_length`,
original: String(existingOption.max_length),
expected: String(expectedOption.max_length)
};
}
//#endregion
exports.handleMinMaxLengthOptions = handleMinMaxLengthOptions;
//# sourceMappingURL=minMaxLength.cjs.map