diff --git a/web/utils/typeahead-utils.js b/web/utils/typeahead-utils.js --- a/web/utils/typeahead-utils.js +++ b/web/utils/typeahead-utils.js @@ -149,9 +149,15 @@ return { top, left }; } +function positiveModulo(number: number, base: number): number { + // Getting positive modulo of number mod base + return number - Math.floor(number / base) * base; +} + export { webTypeaheadRegex, getCaretOffsets, getTypeaheadTooltipActions, getTypeaheadTooltipPosition, + positiveModulo, };