Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1262869
make-hidden-inputs.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
726 B
Referenced Files
None
Subscribers
None
make-hidden-inputs.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
FlatTemplatable
,
tempstream
}
from
"tempstream"
;
import
{
FormField
}
from
"./forms/fields/field.js"
;
import
{
FormDataValue
}
from
"./forms/form-types.js"
;
import
{
attribute
}
from
"./sanitize.js"
;
export
function
makeHiddenInputs
(
ctx
:
Context
,
fields
:
Record
<
string
,
FormField
>
,
values
:
Record
<
string
,
FormDataValue
>
,
fields_to_skip
:
string
[]
)
:
FlatTemplatable
{
return
tempstream
`
${
Object
.
entries
(
fields
)
.
filter
(([
key
])
=>
!
fields_to_skip
.
includes
(
key
))
.
map
(
([
key
,
field
])
=>
tempstream
/* HTML */
`<input
type="hidden"
name="
${
key
}
"
value="
${
field
.
getValue
(
ctx
,
values
)
.
then
((
r
)
=>
attribute
(
JSON
.
stringify
(
r
.
raw
)
||
""
))
}
"
/>`
)
}
`
;
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jan 24, 15:16 (17 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
598889
Default Alt Text
make-hidden-inputs.ts (726 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment