@@ -36,8 +36,8 @@ export function escape(arg, options) {
3636 * Take an array of values, the arguments, and escape any dangerous characters
3737 * in every argument.
3838 *
39- * Non-array inputs will be converted to one-value arrays and non-string values
40- * will be converted to strings using a `toString()` method.
39+ * Non-array inputs are rejected. Non-string entries will be converted to
40+ * strings using a `toString()` method.
4141 *
4242 * @example
4343 * import { spawn } from "node:child_process";
@@ -51,6 +51,7 @@ export function escape(arg, options) {
5151 * @param {boolean } [options.flagProtection=true] Is flag protection enabled.
5252 * @param {boolean | string } [options.shell=true] The shell to escape for.
5353 * @returns {string[] } The escaped arguments.
54+ * @throws {TypeError } The arguments are not an array.
5455 * @throws {TypeError } One of the arguments is not stringable.
5556 * @throws {Error } The shell is not supported or could not be found.
5657 * @since 2.1.0
@@ -93,8 +94,8 @@ export function quote(arg, options) {
9394 * Take an array of values, the arguments, put shell-specific quotes around
9495 * every argument and escape any dangerous characters in every argument.
9596 *
96- * Non-array inputs will be converted to one-value arrays and non-string
97- * values will be converted to strings using a `toString()` method.
97+ * Non-array inputs are rejected. Non-string entries will be converted to
98+ * strings using a `toString()` method.
9899 *
99100 * @example
100101 * import { spawn } from "node:child_process";
@@ -109,6 +110,7 @@ export function quote(arg, options) {
109110 * @param {boolean } [options.flagProtection=true] Is flag protection enabled.
110111 * @param {boolean | string } [options.shell=true] The shell to escape for.
111112 * @returns {string[] } The quoted and escaped arguments.
113+ * @throws {TypeError } The arguments are not an array.
112114 * @throws {TypeError } One of the arguments is not stringable.
113115 * @throws {Error } The shell is not supported or could not be found.
114116 * @throws {Error } Quoting is not supported with `shell: false`.
0 commit comments