Download wp-calypso/desktop/app/lib/login/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/desktop/app/lib/login/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/desktop/app/lib/login/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/desktop/app/lib/login/index.js
524 Bytes
| /** | |
| * Tells whether a URL points to the regular login page. | |
| * This is useful in places where we need to send the user to the desktop app's | |
| * login page (/log-in/desktop), instead of the regular login page. | |
| * @param url string | |
| * @returns {boolean} | |
| */ | |
| function isNonDesktopLoginUrl( url ) { | |
| let path = ''; | |
| try { | |
| const u = new URL( url ); | |
| path = u.pathname.replace( u.search, '' ); | |
| } catch ( e ) { | |
| return false; | |
| } | |
| return path === '/log-in' || path === '/log-in/'; | |
| } | |
| module.exports = { isNonDesktopLoginUrl }; | |