Download wp-calypso/client/reader/route/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 900 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/reader/route/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/reader/route/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/reader/route/index.js
900 Bytes
| const FEED_URL_BASE = '/reader/feeds/'; | |
| const SITE_URL_BASE = '/reader/blogs/'; | |
| export function getSiteUrl( siteID ) { | |
| return SITE_URL_BASE + siteID; | |
| } | |
| export function getFeedUrl( feedID ) { | |
| return FEED_URL_BASE + feedID; | |
| } | |
| export function getStreamUrl( feedID, siteID ) { | |
| if ( feedID ) { | |
| return getFeedUrl( feedID ); | |
| } | |
| return getSiteUrl( siteID ); | |
| } | |
| export function getStreamUrlFromPost( post ) { | |
| if ( post.feed_ID ) { | |
| return getFeedUrl( post.feed_ID ); | |
| } | |
| return getSiteUrl( post.site_ID ); | |
| } | |
| export function getTagStreamUrl( tag ) { | |
| return `/tag/${ tag }`; | |
| } | |
| export function getPostUrl( post ) { | |
| if ( post.feed_ID && post.feed_item_ID ) { | |
| return `/reader/feeds/${ post.feed_ID }/posts/${ post.feed_item_ID }`; | |
| } else if ( post.is_external ) { | |
| return `/reader/feeds/${ post.feed_ID }/posts/${ post.ID }`; | |
| } | |
| return `/reader/blogs/${ post.site_ID }/posts/${ post.ID }`; | |
| } | |