Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const {
minValue = DEFAULT_VALUES.MIN,
maxValue = DEFAULT_VALUES.MAX,
histogramData,
histogramLoading = false,
histogramLoadingText,
dataTest,
step = DEFAULT_VALUES.STEP,
} = this.props;
if (histogramData) {
const properHistogramLength = (maxValue - minValue + step) / step;
warning(
histogramData.length === properHistogramLength,
`Warning: Length of histogramData array is ${
histogramData.length
}, but should be ${properHistogramLength}. This will cause broken visuals of the whole Histogram.`,
);
}
const { value, focused } = this.state;
const sortedValue = this.sortArray(value);
const hasHistogram = histogramLoading || !!histogramData;
return (
{this.renderHeading(hasHistogram)}
{hasHistogram && (
{this.renderSliderTexts(false)}
ariaExpanded,
ariaControls,
spaceAfter,
dataTest,
tabIndex,
title,
block,
className,
} = props;
const iconLeft = props.iconLeft || icon;
const sizeIcon = size === ICON_SIZES.SMALL ? ICON_SIZES.SMALL : ICON_SIZES.MEDIUM;
const onlyIcon = iconLeft && !children;
warning(
!(!children && !title),
"Warning: children or title property is missing on ButtonLink. Use title property to add aria-label to be accessible for screen readers. More information https://orbit.kiwi/components/buttonlink/#accessibility",
);
return (
getSourceRoots(): Set {
const roots = new Set();
for (const root of this.directoryMapping.keys()) {
warning(fs.existsSync(root) === true, `Directory mapping uses non-existent root: ${root}`);
roots.add(root);
}
return roots;
}
const NavigationListItem = ({
icon,
children,
ariaLabel,
selectable = false,
selected,
href,
external,
onClick,
asComponent = DefaultComponent,
dataTest,
tabIndex,
}: Props) => {
warning(
!(!children && !ariaLabel),
"Warning: children or ariaLabel property is missing on NavigationListItem. Use ariaLabel property to add aria-label to be accessible for screen readers. More information https://orbit.kiwi/components/NavigationListItem/",
);
return (
circled,
submit,
tabIndex,
ariaExpanded,
className,
ariaControls,
spaceAfter,
dataTest,
title,
} = props;
const iconLeft = props.iconLeft || icon;
const sizeIcon = size === ICON_SIZES.SMALL ? ICON_SIZES.SMALL : ICON_SIZES.MEDIUM;
const onlyIcon = iconLeft && !children;
const isDisabled = loading || disabled;
warning(
!(!children && !title),
"Warning: children or title property is missing on Button. Use title property to add aria-label to be accessible for screen readers. More information https://orbit.kiwi/components/button/api/#accessibility",
);
return (
export function getCountryProps(code: ?string, name: ?string): { code: string, name: ?string } {
const codeNormalized = code ? code.toUpperCase().replace("-", "_") : "ANYWHERE";
const countryCodeExists = codeNormalized in CODES;
warning(countryCodeExists, "Country code not supported: %s", code);
const countryCode = countryCodeExists ? CODES[codeNormalized] : CODES.ANYWHERE;
const countryName = countryCode === CODES.ANYWHERE && !name ? "Anywhere" : name;
return { code: countryCode, name: countryName };
}