MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / normalizeStdio

Function normalizeStdio

out/cli.cjs:66479–66498  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

66477 error.isCanceled = isCanceled;
66478 error.killed = killed && !timedOut;
66479 return error;
66480};
66481
66482// node_modules/execa/lib/stdio.js
66483var aliases = ["stdin", "stdout", "stderr"];
66484var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
66485var normalizeStdio = (options) => {
66486 if (!options) {
66487 return;
66488 }
66489 const { stdio } = options;
66490 if (stdio === void 0) {
66491 return aliases.map((alias) => options[alias]);
66492 }
66493 if (hasAlias(options)) {
66494 throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
66495 }
66496 if (typeof stdio === "string") {
66497 return stdio;
66498 }
66499 if (!Array.isArray(stdio)) {
66500 throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
66501 }

Callers 1

handleArgumentsFunction · 0.85

Calls 3

hasAliasFunction · 0.85
maxMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…