Page MenuHomeSealhub

structured-array.ts
No OneTemporary

structured-array.ts

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

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)

Event Timeline