UNPKG

@technobuddha/library

Version:
19 lines 859 B
import { domain } from "./regexp.js"; /** * Determines whether the given string is a valid domain name. * * @param text - The string to test as a domain name. * @returns `true` if the string is a valid domain name, otherwise `false`. * * @example * ```typescript * isDomain("example.com"); // true * isDomain("not a domain"); // false * ``` * @group RegExp * @category Validation */ export function isDomain(text) { return domain.test(text); } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtZG9tYWluLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2lzLWRvbWFpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBRXJDOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFDSCxNQUFNLFVBQVUsUUFBUSxDQUFDLElBQVk7SUFDbkMsT0FBTyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzNCLENBQUMifQ==