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.
@@ -1,2 +1,2 @@
1
- import{readFile as o,writeFile as a,mkdir as m}from"node:fs/promises";import l from"node:path";import{getThemePath as c}from"./state-paths.js";import{isThemeTemplateId as s,resolveTheme as i}from"./themes/index.js";const r=c();function f(t){if(!t||typeof t!="object")return!1;const e=t;return s(e.template)&&typeof e.shell=="object"&&e.shell!==null&&typeof e.shell.pageBg=="string"&&typeof e.terminal=="object"&&e.terminal!==null&&typeof e.terminal.background=="string"}async function n(t){await m(l.dirname(r),{recursive:!0}),await a(r,JSON.stringify(t,null,2)+`
2
- `)}async function y(){try{const e=JSON.parse(await o(r,"utf-8"));if(f(e))return e}catch{}const t=i("vscode");return await n(t),t}async function w(t){const e=i(t);return await n(e),e}export{y as readActiveTheme,w as setActiveThemeTemplate,n as writeActiveTheme};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmux-weblink",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Access your tmux sessions from the browser. A continuation of tmux-web and persalink.",
5
5
  "type": "module",
6
6
  "bin": {