Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996358
structured-array.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
705 B
Referenced Files
None
Subscribers
None
structured-array.ts
View Options
import
{
Context
}
from
"koa"
;
import
{
Field
,
FieldsetOutput
,
FieldTypes
}
from
"sealious"
;
import
{
FormDataValue
}
from
"../form-types.js"
;
import
{
FormField
}
from
"./field.js"
;
export
class
StructuredArrayField
<
Fields
extends
Record
<
string
,
Field
>
>
extends
FormField
<
true
,
FieldTypes
.
ArrayStorageInput
<
FieldsetOutput
<
Fields
>>
>
{
constructor
(
public
sealious_field
:
FieldTypes
.
StructuredArray
<
Fields
>
)
{
super
(
true
);
}
async
parse
(
_context
:
Context
,
value
:
FormDataValue
)
{
return
{
parsable
:
<
const
>
true
,
error
:
null
,
parsed_value
:
(
value
as
FieldsetOutput
<
Fields
>
)
||
[],
};
}
getEmptyValue
()
{
return
[]
as
FieldTypes
.
ArrayStorageInput
<
FieldsetOutput
<
Fields
>>
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Dec 24, 14:02 (17 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557206
Default Alt Text
structured-array.ts (705 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment