@talend/react-faceted-search
Version:
18 lines (16 loc) • 586 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.controlled = void 0;
const isDefined = arg => typeof arg !== 'undefined';
// eslint-disable-next-line import/prefer-default-export
const controlled = (componentName, ...args) => {
const isControlled = args.every(isDefined);
if (!isControlled && args.some(isDefined)) {
throw new Error(`You are trying to control the ${componentName} but not all value are defined, refer to the api doc`);
}
return isControlled;
};
exports.controlled = controlled;
//# sourceMappingURL=controlled.js.map