@aegenet/belt-extract-domain
v2.3.0
Published
Extract domain informations
Downloads
80
Readme
@aegenet/belt-extract-domain
Extract domain informations
💾 Installation
yarn add @aegenet/belt-extract-domain@^2.0.0
# or
npm i @aegenet/belt-extract-domain@^2.0.0
📝 Usage
import { extractDomain } from '@aegenet/belt-extract-domain';
extractDomain(undefined)
// null
extractDomain(undefined)
// null
extractDomain('aaa.ooo.com')
// {
// domain: 'ooo.com',
// subdomains: [],
// }
extractDomain('aaa.ooo.com')
// {
// domain: 'ooo.com',
// subdomains: ['aaa'],
// }
extractDomain('deeper.aaa.ooo.com')
// {
// domain: 'ooo.com',
// subdomains: ['aaa', 'deeper'],
// }