We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a71246 commit 5babba2Copy full SHA for 5babba2
1 file changed
packages/color-convert/src/index.ts
@@ -336,4 +336,4 @@ export const equalHex = (first: string, second: string): boolean => {
336
return equalColorObjects(hexToRgba(first), hexToRgba(second));
337
};
338
339
-export const validHex = (hex: string): boolean => /^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
+export const validHex = (hex: string): hex is HexColor => /^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
0 commit comments