mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
18 lines
363 B
JavaScript
18 lines
363 B
JavaScript
function stringifyOptionsForTitle(options) {
|
|
const string = JSON.stringify(options || {}, (key, value) => {
|
|
if (key === "plugins" || key === "errors") {
|
|
return;
|
|
}
|
|
|
|
if (value === Number.POSITIVE_INFINITY) {
|
|
return "Infinity";
|
|
}
|
|
|
|
return value;
|
|
});
|
|
|
|
return string === "{}" ? "" : string;
|
|
}
|
|
|
|
export { stringifyOptionsForTitle };
|