Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010161
url.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
865 B
Referenced Files
None
Subscribers
None
url.ts
View Options
import
{
JDDContext
}
from
"../jdd-context.js"
;
import
{
is
,
predicates
}
from
"@sealcode/ts-predicates"
;
import
{
MaybePromise
}
from
"../utils/util-types.js"
;
import
{
StringBasedArgument
}
from
"./string-based-argument.js"
;
export
class
URL
extends
StringBasedArgument
<
string
>
{
public
readonly
urlType
:
Readonly
<
"relative"
|
"absolute"
>
;
constructor
(
urlType
:
Readonly
<
"relative"
|
"absolute"
>
)
{
super
();
this
.
urlType
=
urlType
;
}
getTypeName
()
{
return
`url`
;
}
getEmptyValue
()
{
return
""
;
}
getExampleValue
()
{
if
(
this
.
urlType
===
"relative"
)
{
return
"/example"
;
}
return
"https://example.com"
;
}
countWords
()
:
number
{
return
0
;
}
parseFormInput
(
_
:
JDDContext
,
input
:
unknown
)
:
MaybePromise
<
string
|
string
[]
|
null
>
{
if
(
is
(
input
,
predicates
.
string
))
{
return
input
;
}
else
{
return
null
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-Algol68
Expires
Wed, May 7, 19:37 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625731
Default Alt Text
url.ts (865 B)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment