| 107 | } |
| 108 | |
| 109 | class FieldImpl extends PartBase implements Multipart.Field { |
| 110 | readonly _tag = "Field" |
| 111 | readonly key: string |
| 112 | readonly contentType: string |
| 113 | readonly value: string |
| 114 | |
| 115 | constructor( |
| 116 | info: MultipartParser.PartInfo, |
| 117 | value: Uint8Array |
| 118 | ) { |
| 119 | super() |
| 120 | this.key = info.name |
| 121 | this.contentType = info.contentType |
| 122 | this.value = MultipartParser.decodeField(info, value) |
| 123 | } |
| 124 | |
| 125 | toJSON(): unknown { |
| 126 | return { |
| 127 | _id: "@effect/platform/Multipart/Part", |
| 128 | _tag: "Field", |
| 129 | key: this.key, |
| 130 | value: this.value, |
| 131 | contentType: this.contentType |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | class FileImpl extends PartBase implements Multipart.File { |
| 137 | readonly _tag = "File" |
nothing calls this directly
no outgoing calls
no test coverage detected