rsshub
Version:
Make RSS Great Again!
12 lines (11 loc) • 297 B
JavaScript
//#region lib/utils/valid-host.ts
/**
* Check if a sub-domain is valid
* @param {String} hostname sub-domain
* @returns {Boolean} true if valid
*/
const isValidHost = (hostname) => {
return /^[\dA-Z](?:[\dA-Z-]{0,61}[\dA-Z])?$/i.test(hostname ?? "");
};
//#endregion
export { isValidHost as t };