Comparing version 1.1.1 to 1.1.2-next.1
@@ -224,3 +224,4 @@ "use strict"; | ||
const WebSocketApi = await (globalThis.WebSocket ?? | ||
Promise.resolve().then(() => __importStar(require('ws'))).catch(() => { | ||
Promise.resolve().then(() => __importStar(require('ws'))).then((ws) => ws.default) | ||
.catch(() => { | ||
throw new Error("The dependency 'ws' is required for environments without a built-in" + | ||
@@ -237,3 +238,3 @@ ' WebSocket API. \nRun `npm i ws` to resolve this error.'); | ||
async _waitForConnection() { | ||
if (this._socket?.readyState === WebSocket.OPEN) { | ||
if (this._socket && this._socket.readyState === this._socket.OPEN) { | ||
return this._socket; | ||
@@ -240,0 +241,0 @@ } |
{ | ||
"name": "glazewm", | ||
"version": "1.1.1", | ||
"version": "1.1.2-next.1", | ||
"license": "GPL-3.0", | ||
"description": "Library for inter-process communication (IPC) with GlazeWM.", | ||
"repository": "github:lars-berger/glazewm-js", | ||
"repository": "github:glazerdesktop/GlazeWM-js", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "glazewm", |
@@ -1,4 +0,4 @@ | ||
# GlazeWM-js · [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/lars-berger/GlazeWM-js/pulls) [![License](https://img.shields.io/github/license/lars-berger/GlazeWM-js)](https://github.com/lars-berger/GlazeWM-js/blob/master/LICENSE.md) [![Discord invite](https://img.shields.io/discord/1041662798196908052)](https://discord.gg/ud6z3qjRvM) | ||
# GlazeWM-js · [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/glazerdesktop/GlazeWM-js/pulls) [![License](https://img.shields.io/github/license/glazerdesktop/GlazeWM-js)](https://github.com/glazerdesktop/GlazeWM-js/blob/master/LICENSE.md) [![Discord invite](https://img.shields.io/discord/1041662798196908052.svg?logo=discord&colorB=7289DA)](https://discord.gg/ud6z3qjRvM) | ||
JS library for inter-process communication (IPC) with [GlazeWM](https://github.com/lars-berger/GlazeWM). Programmatically query GlazeWM's state, subscribe to events, and run WM commands with a simple and type-safe API. | ||
JS library for inter-process communication (IPC) with [GlazeWM](https://github.com/glazerdesktop/GlazeWM). Programmatically query GlazeWM's state, subscribe to events, and run WM commands with a simple and type-safe API. | ||
@@ -5,0 +5,0 @@ The library is packaged for CommonJS and ESM. Can be used from both NodeJS and the browser (eg. in an Electron or Tauri application). |
@@ -279,8 +279,10 @@ import { | ||
const WebSocketApi = await (globalThis.WebSocket ?? | ||
import('ws').catch(() => { | ||
throw new Error( | ||
"The dependency 'ws' is required for environments without a built-in" + | ||
' WebSocket API. \nRun `npm i ws` to resolve this error.', | ||
); | ||
})); | ||
import('ws') | ||
.then((ws) => ws.default) | ||
.catch(() => { | ||
throw new Error( | ||
"The dependency 'ws' is required for environments without a built-in" + | ||
' WebSocket API. \nRun `npm i ws` to resolve this error.', | ||
); | ||
})); | ||
@@ -307,3 +309,3 @@ const socket = new WebSocketApi( | ||
async _waitForConnection(): Promise<WebSocket> { | ||
if (this._socket?.readyState === WebSocket.OPEN) { | ||
if (this._socket && this._socket.readyState === this._socket.OPEN) { | ||
return this._socket; | ||
@@ -310,0 +312,0 @@ } |
Sorry, the diff of this file is not supported yet
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
108875
1437
2