Download wp-calypso/client/reader/lib/feed-display-helper/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 365 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/reader/lib/feed-display-helper/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/reader/lib/feed-display-helper/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/reader/lib/feed-display-helper/index.js
365 Bytes
| /** | |
| * Remove the starting https, www. and trailing slash from a URL string | |
| * @param {string} url URL to format | |
| * @returns {string|undefined} Formatted URL e.g. "https://www.wordpress.com/" --> "wordpress.com" | |
| */ | |
| export function formatUrlForDisplay( url ) { | |
| if ( ! url ) { | |
| return; | |
| } | |
| return url.replace( /^https?:\/\/(www\.)?/, '' ).replace( /\/$/, '' ); | |
| } | |