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