refactor: Still trying to reorganize edit mode to be more robust
Some checks failed
Test Suite / code-quality (push) Has been cancelled
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
Some checks failed
Test Suite / code-quality (push) Has been cancelled
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
This commit is contained in:
11
node_modules/tldts-core/src/subdomain.ts
generated
vendored
Normal file
11
node_modules/tldts-core/src/subdomain.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
Reference in New Issue
Block a user