Download wp-calypso/packages/domains-table/src/get-domain-id.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 491 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/domains-table/src/get-domain-id.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/domains-table/src/get-domain-id.ts
-
curl -L -o get-domain-id.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/domains-table/src/get-domain-id.ts
491 Bytes
| import type { DomainData, PartialDomainData } from '@automattic/data-stores'; | |
| /** | |
| * Returns a synthetic ID for a domain. | |
| * | |
| * Using the domain name isn't unique enough: redirect domains uses the redirect | |
| * destination as their `domain` field, meaning if the user owns the redirect | |
| * destination too, then both can appear in the domains table at the same time. | |
| */ | |
| export function getDomainId( domain: PartialDomainData | DomainData ): string { | |
| return domain.domain + domain.blog_id; | |
| } | |