mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 05:01:42 +03:00
16 lines
373 B
TypeScript
16 lines
373 B
TypeScript
// Loaded from https://deno.land/x/segno@v1.1.0/lib/validations/isHexColor.ts
|
|
|
|
|
|
// @ts-ignore allowing typedoc to build
|
|
import { assertString } from '../helpers/assertString.ts';
|
|
|
|
/**
|
|
* @ignore
|
|
*/
|
|
const hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;
|
|
|
|
export const isHexColor = (str: string) => {
|
|
assertString(str);
|
|
return hexcolor.test(str);
|
|
};
|