Skip to content

Instantly share code, notes, and snippets.

@jiyuujin
Last active January 31, 2020 00:05
Show Gist options
  • Save jiyuujin/27c37024561dcedd580af2cfd3e3c881 to your computer and use it in GitHub Desktop.
Save jiyuujin/27c37024561dcedd580af2cfd3e3c881 to your computer and use it in GitHub Desktop.
location.hrefからhtmlファイル名を取得する
export const getLinkUrlWithExtention = url => {
return url.match('.+/(.+?)([?#;].*)?$')[1]
}
export const getLinkUrlWithoutExtention = url => {
return url.match('.+/(.+?).[a-z]+([?#;].*)?$')[1]
}
export const getLinkUrlWithExtention = (url: string): string => {
return url.match('.+/(.+?)([?#;].*)?$')[1]
}
export const getLinkUrlWithoutExtention = (url: string): string => {
return url.match('.+/(.+?).[a-z]+([?#;].*)?$')[1]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment