(name?: string)
| 196 | |
| 197 | /** @internal */ |
| 198 | export const port = (name?: string): Config.Config<number> => { |
| 199 | const config = primitive( |
| 200 | "a network port property", |
| 201 | (text) => { |
| 202 | const result = Number(text) |
| 203 | |
| 204 | if ( |
| 205 | Number.isNaN(result) || |
| 206 | result.toString() !== text.toString() || |
| 207 | !Number.isInteger(result) || |
| 208 | result < 1 || |
| 209 | result > 65535 |
| 210 | ) { |
| 211 | return Either.left( |
| 212 | configError.InvalidData( |
| 213 | [], |
| 214 | `Expected a network port value but received ${formatUnknown(text)}` |
| 215 | ) |
| 216 | ) |
| 217 | } |
| 218 | return Either.right(result) |
| 219 | } |
| 220 | ) |
| 221 | return name === undefined ? config : nested(config, name) |
| 222 | } |
| 223 | |
| 224 | /** @internal */ |
| 225 | export const array = <A>(config: Config.Config<A>, name?: string): Config.Config<Array<A>> => { |
nothing calls this directly
no test coverage detected