Download wp-calypso/packages/domains-table/src/utils/is-expiring-soon.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 304 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/domains-table/src/utils/is-expiring-soon.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/domains-table/src/utils/is-expiring-soon.ts
-
curl -L -o is-expiring-soon.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/domains-table/src/utils/is-expiring-soon.ts
304 Bytes
| import moment from 'moment'; | |
| import { ResponseDomain } from './types'; | |
| export function isExpiringSoon( | |
| domain: ResponseDomain, | |
| expiresWithinDays: moment.DurationInputArg1 | |
| ) { | |
| return ( | |
| ! domain.expired && | |
| moment.utc( domain.expiry ).isBefore( moment.utc().add( expiresWithinDays, 'days' ) ) | |
| ); | |
| } | |