UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
generic
/
models
/
Id
/
getIdFromUrl.ts
15 lines
(13 loc)
•
292 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { fromStringToId }
from
'../Id'
import { Url }
from
'../Url'
/** *
@deprecated
*/
export
function
getIdFromUrl
(
url: Url
)
{
const
$url
=
new
URL
(url)
const
parts
= [ ...
$url
.hostname.
split
(
'.'
), ...
$url
.pathname.
split
(
'/'
), ]
return
fromStringToId
(parts.
join
(
'_'
)) }