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