input.js
This file
Path
lib/stdio/input.js
21 lines · 561 bytes · JavaScript
Last changed by
Allow using the `input`, `inputFile` and `stdin` options together (#666)ehmickybefore adoptionbeabd25
History of this fileTake it
Refactor `stdio` options (#623)ehmickybefore adoption2d76897
lines 1–2why, one step back1import {isStream as isNodeStream} from 'is-stream';2Allow using the `input`, `inputFile` and `stdin` options together (#666)ehmickybefore adoptionbeabd25
lines 3–7why, one step back3// Append the `stdin` option with the `input` and `inputFile` options4export const handleInputOptions = ({input, inputFile}) => [5 handleInputOption(input),6 handleInputFileOption(inputFile),7].filter(Boolean);Refactor `stdio` options (#623)ehmickybefore adoption2d76897
line 8why, one step back8Allow using the `input`, `inputFile` and `stdin` options together (#666)ehmickybefore adoptionbeabd25
lines 9–13why, one step back9const handleInputOption = input => input && {10 type: isNodeStream(input) ? 'nodeStream' : 'stringOrBuffer',11 value: input,12 optionName: 'input',13 index: 0,Refactor `stdio` options (#623)ehmickybefore adoption2d76897
lines 14–15why, one step back14};15Allow using the `input`, `inputFile` and `stdin` options together (#666)ehmickybefore adoptionbeabd25
lines 16–20why, one step back16const handleInputFileOption = inputFile => inputFile && {17 type: 'filePath',18 value: inputFile,19 optionName: 'inputFile',20 index: 0,Refactor `stdio` options (#623)ehmickybefore adoption2d76897
line 21why, one step back21};