swc/bundler/tests/.cache/deno/cbf633d8fb10f64d13c5969a7822ff777f8c4d3e.ts

16 lines
373 B
TypeScript
Raw Normal View History

// 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);
};