Created
August 15, 2021 08:34
-
-
Save izszzz/944434b3e66d52f1a11d4b90b7372703 to your computer and use it in GitHub Desktop.
getIDfromURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://example.com/:ID | |
const getIDfromURL = (url: string): string => | |
new URL(url).pathname.replace(/\//g, ""); | |
export default getIDfromURL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment