UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

16 lines (15 loc) 797 B
"use client"; import { isOptionsGroup } from "./is-options-group.mjs"; //#region packages/@mantine/core/src/components/Combobox/OptionsDropdown/validate-options.ts function validateOptions(options, valuesSet = /* @__PURE__ */ new Set()) { if (!Array.isArray(options)) return; for (const option of options) if (isOptionsGroup(option)) validateOptions(option.items, valuesSet); else { if (typeof option.value === "undefined") throw new Error("[@mantine/core] Each option must have value property"); if (valuesSet.has(option.value)) throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${option.value}" was provided more than once`); valuesSet.add(option.value); } } //#endregion export { validateOptions }; //# sourceMappingURL=validate-options.mjs.map