(opts: ChildProcess.CommandOptions)
| 116 | Sink.isSink(x) ? "pipe" : x |
| 117 | |
| 118 | const stdin = (opts: ChildProcess.CommandOptions): ChildProcess.StdinConfig => { |
| 119 | const cfg: ChildProcess.StdinConfig = { stream: "pipe", encoding: "utf-8", endOnDone: true } |
| 120 | if (Predicate.isUndefined(opts.stdin)) return cfg |
| 121 | if (typeof opts.stdin === "string") return { ...cfg, stream: opts.stdin } |
| 122 | if (Stream.isStream(opts.stdin)) return { ...cfg, stream: opts.stdin } |
| 123 | return { |
| 124 | stream: opts.stdin.stream, |
| 125 | encoding: opts.stdin.encoding ?? cfg.encoding, |
| 126 | endOnDone: opts.stdin.endOnDone ?? cfg.endOnDone, |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | const stdio = (opts: ChildProcess.CommandOptions, key: "stdout" | "stderr"): ChildProcess.StdoutConfig => { |
| 131 | const cfg = opts[key] |
no outgoing calls
no test coverage detected