MCPcopy Index your code
hub / github.com/codeaashu/claude-code / _sanitizeAndValidateOption

Method _sanitizeAndValidateOption

src/server/web/public/terminal.js:5753–5792  ·  view source on GitHub ↗
(e3, i3)

Source from the content-addressed store, hash-verified

5751 for (const t3 in this.rawOptions) {
5752 const s3 = { get: e3.bind(this, t3), set: i3.bind(this, t3) };
5753 Object.defineProperty(this.options, t3, s3);
5754 }
5755 }
5756 _sanitizeAndValidateOption(e3, i3) {
5757 switch (e3) {
5758 case "cursorStyle":
5759 if (i3 || (i3 = t2.DEFAULT_OPTIONS[e3]), !/* @__PURE__ */ (function(e4) {
5760 return "block" === e4 || "underline" === e4 || "bar" === e4;
5761 })(i3)) throw new Error(`"${i3}" is not a valid value for ${e3}`);
5762 break;
5763 case "wordSeparator":
5764 i3 || (i3 = t2.DEFAULT_OPTIONS[e3]);
5765 break;
5766 case "fontWeight":
5767 case "fontWeightBold":
5768 if ("number" == typeof i3 && 1 <= i3 && i3 <= 1e3) break;
5769 i3 = o.includes(i3) ? i3 : t2.DEFAULT_OPTIONS[e3];
5770 break;
5771 case "cursorWidth":
5772 i3 = Math.floor(i3);
5773 case "lineHeight":
5774 case "tabStopWidth":
5775 if (i3 < 1) throw new Error(`${e3} cannot be less than 1, value: ${i3}`);
5776 break;
5777 case "minimumContrastRatio":
5778 i3 = Math.max(1, Math.min(21, Math.round(10 * i3) / 10));
5779 break;
5780 case "scrollback":
5781 if ((i3 = Math.min(i3, 4294967295)) < 0) throw new Error(`${e3} cannot be less than 0, value: ${i3}`);
5782 break;
5783 case "fastScrollSensitivity":
5784 case "scrollSensitivity":
5785 if (i3 <= 0) throw new Error(`${e3} cannot be less than or equal to 0, value: ${i3}`);
5786 break;
5787 case "rows":
5788 case "cols":
5789 if (!i3 && 0 !== i3) throw new Error(`${e3} must be numeric, value: ${i3}`);
5790 break;
5791 case "windowsPty":
5792 i3 = i3 ?? {};
5793 }
5794 return i3;
5795 }

Callers 2

constructorMethod · 0.95
i3Method · 0.95

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected