Sha256: b9d4b43460d9f3f3e3d0a78a8f27fe95dc9442fefb4264107f7e66dab1a723c0
Contents?: true
Size: 322 Bytes
Versions: 26
Compression:
Stored size: 322 Bytes
Contents
/** * Returns the subdomain of a hostname string */ export default function getSubdomain(hostname: string, domain: string): string { // If `hostname` and `domain` are the same, then there is no sub-domain if (domain.length === hostname.length) { return ''; } return hostname.slice(0, -domain.length - 1); }
Version data entries
26 entries across 26 versions & 1 rubygems