Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F9583028
url.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
937 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
;
}
// TODO: this should be maybe removed or change into receivedToParsed?
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
Sat, Oct 11, 08:32 (16 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
981357
Default Alt Text
url.ts (937 B)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment