Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996254
short-text.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
818 B
Referenced Files
None
Subscribers
None
short-text.ts
View Options
import
{
is
,
predicates
}
from
"@sealcode/ts-predicates"
;
import
{
JDDContext
}
from
"../index.js"
;
import
{
MaybePromise
}
from
"../utils/util-types.js"
;
import
{
StringBasedArgument
}
from
"./string-based-argument.js"
;
export
class
ShortText
extends
StringBasedArgument
<
string
>
{
example_values
=
[
"Lorem ipsum set doloris"
,
"Main hippopotomonsti delos muertos"
,
"Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore"
,
"Ipsum"
,
];
getTypeName
()
{
return
"short-text"
;
}
getEmptyValue
()
{
return
""
;
}
countWords
(
value
:
string
)
:
number
{
return
value
.
toString
().
split
(
" "
).
length
;
}
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
Tue, Dec 24, 14:02 (1 d, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557135
Default Alt Text
short-text.ts (818 B)
Attached To
Mode
R130 jdd
Attached
Detach File
Event Timeline
Log In to Comment