baseui
Version:
A React Component library implementing the Base design language
26 lines (24 loc) • 735 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isIndexSelected = isIndexSelected;
exports.shouldRenderHeaderContainer = shouldRenderHeaderContainer;
/*
Copyright (c) Uber Technologies, Inc.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
function shouldRenderHeaderContainer(leadingContent, trailingContent) {
if (leadingContent || trailingContent) return true;
return false;
}
function isIndexSelected(selected, index) {
if (!Array.isArray(selected) && typeof selected !== 'number') {
return false;
}
if (Array.isArray(selected)) {
return selected.includes(index);
}
return selected === index;
}