terminalhire 0.40.6 → 0.40.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/statusline-install.js +8 -4
package/package.json
CHANGED
package/statusline-install.js
CHANGED
|
@@ -318,10 +318,14 @@ async function install({ ask: injectedAsk } = {}) {
|
|
|
318
318
|
// The `th://` prompt eight steps below in the same flow (jpi-init.js) already
|
|
319
319
|
// allowlists `'' | y | yes`. Two consecutive consent prompts disagreeing about
|
|
320
320
|
// which way an unrecognised answer falls is how a regression gets waved through.
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
// Narrow by TYPE, not by listing the non-strings that must not consent. Excluding
|
|
322
|
+
// `null` by value left `undefined` consenting — `String(undefined ?? '')` is also
|
|
323
|
+
// the empty string — so the guard only closed the hole it had already been shown.
|
|
324
|
+
// Both real askers resolve `string | null` today, which is exactly why this must
|
|
325
|
+
// not depend on that: a third `ask` is one refactor away, and it would arrive as
|
|
326
|
+
// the same EOF bug wearing a different value.
|
|
327
|
+
const a = typeof answer === 'string' ? answer.trim().toLowerCase() : null;
|
|
328
|
+
const consented = a === '' || a === 'y' || a === 'yes';
|
|
325
329
|
if (!consented) {
|
|
326
330
|
console.log('\nAborted — nothing was changed.');
|
|
327
331
|
asker.close();
|