UNPKG

@sapphire/framework

Version:

Discord bot framework built for advanced and amazing bots.

56 lines (53 loc) 1.98 kB
'use strict'; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); // 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) }; } } __name(handleMinMaxLengthOptions, "handleMinMaxLengthOptions"); exports.handleMinMaxLengthOptions = handleMinMaxLengthOptions; //# sourceMappingURL=minMaxLength.cjs.map //# sourceMappingURL=minMaxLength.cjs.map