bigbuffet-rw/app/soapbox/features/placeholder/utils.ts
marcin mikołajczak c76639c42e JS -> TS, FC
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-11-12 15:18:24 +01:00

16 lines
378 B
TypeScript

export const PLACEHOLDER_CHAR = '█';
export const generateText = (length: number) => {
let text = '';
for (let i = 0; i < length; i++) {
text += PLACEHOLDER_CHAR;
}
return text;
};
// https://stackoverflow.com/a/7228322/8811886
export const randomIntFromInterval = (min: number, max: number) => {
return Math.floor(Math.random() * (max - min + 1) + min);
};