lupine.web 1.0.27 → 1.0.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.web",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://github.com/uuware/lupine.js",
package/src/lib/cookie.ts CHANGED
@@ -39,3 +39,6 @@ export const clearCookie = (name: string, path?: string, domain?: string, secure
39
39
  (domain ? ';domain=' + domain : '') +
40
40
  (secure ? ';secure' : '');
41
41
  };
42
+
43
+ // convinent but not good for tree-shaking
44
+ export const cookie = { set: setCookie, get: getCookie, clear: clearCookie };
@@ -1,7 +1,8 @@
1
1
  let flag = 0;
2
2
  export const debugWatch = (port: number) => {
3
3
  console.log('Creating debug-watch socket');
4
- const socket = new WebSocket('ws://localhost:' + port + '/debug/client');
4
+ const protocol = location.protocol === "https:" ? "wss:" : "ws:";
5
+ const socket = new WebSocket(`${protocol}//${location.host}/debug/client`);
5
6
  window.addEventListener('beforeunload', () => {
6
7
  socket.close();
7
8
  });