MCPcopy Create free account
hub / github.com/csskit/csskit / formatOptions

Method formatOptions

website/script/index.js:350–367  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

348 }
349
350 get formatOptions() {
351 const form = new FormData(
352 document.getElementById(this.getAttribute("for-format")),
353 );
354 const options = {};
355 for (const [key, value] of form.entries()) {
356 if (key === "format" || value === "") continue;
357 if (key === "indent_width") {
358 const width = Number(value);
359 if (Number.isFinite(width)) {
360 options[key] = width;
361 }
362 continue;
363 }
364 options[key] = value;
365 }
366 return options;
367 }
368
369 get code() {
370 return document.getElementById(this.getAttribute("for-editor")).code;

Callers

nothing calls this directly

Calls 1

NumberClass · 0.85

Tested by

no test coverage detected