docs: fence examples in codeblocks

This commit is contained in:
iCrawl
2022-08-14 19:25:25 +02:00
parent bc06cc638d
commit 193b252672
3 changed files with 49 additions and 0 deletions

View File

@@ -5,7 +5,9 @@ export type Awaitable<T> = T | Promise<T>;
/**
* Yields the numbers in the given range as an array
* @example
* ```
* range({ start: 3, end: 5 }); // [3, 4, 5]
* ```
*/
export function range({ start, end }: ShardRange): number[] {
return Array.from({ length: end - start + 1 }, (_, i) => i + start);