tmux-weblink 0.3.3 → 0.3.4
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/dist/lib/theme-store.js +2 -2
- package/package.json +1 -1
package/dist/lib/theme-store.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFile as
|
|
2
|
-
`)}async function
|
|
1
|
+
import{readFile as a,writeFile as o,mkdir as l}from"node:fs/promises";import m from"node:path";import{getThemePath as s}from"./state-paths.js";import{isThemeTemplateId as c,resolveTheme as n}from"./themes/index.js";const i=s();function f(e){if(!e||typeof e!="object")return!1;const t=e;return c(t.template)&&typeof t.shell=="object"&&t.shell!==null&&typeof t.shell.pageBg=="string"&&typeof t.terminal=="object"&&t.terminal!==null&&typeof t.terminal.background=="string"}function u(e,t){return JSON.stringify(e)===JSON.stringify(t)}async function r(e){await l(m.dirname(i),{recursive:!0}),await o(i,JSON.stringify(e,null,2)+`
|
|
2
|
+
`)}async function w(){const e=n("vscode");let t;try{t=JSON.parse(await a(i,"utf-8"))}catch{return await r(e),e}return f(t)?u(t,e)?t:(await r(e),e):(await r(e),e)}async function g(e){const t=n(e);return await r(t),t}export{w as readActiveTheme,g as setActiveThemeTemplate,r as writeActiveTheme};
|