MCPcopy Index your code
hub / github.com/darkreader/darkreader / humanizeNumber

Function humanizeNumber

src/utils/colorscheme-parser.ts:18–32  ·  view source on GitHub ↗
(number: number)

Source from the content-addressed store, hash-verified

16// eslint-disable-next-line
17// @ts-ignore
18const humanizeNumber = (number: number): string => {
19 if (number > 3) {
20 return `${number}th`;
21 }
22 switch (number) {
23 case 0:
24 return '0';
25 case 1:
26 return '1st';
27 case 2:
28 return '2nd';
29 case 3:
30 return '3rd';
31 }
32};
33
34// Should return if the given string is a valid 3 or 6 digit hex color.
35const isValidHexColor = (color: string): boolean => {

Callers 1

checkVariantFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected