🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@nextcloud/notify_push

Package Overview
Dependencies
Maintainers
6
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextcloud/notify_push - npm Package Compare versions

Comparing version
1.1.0
to
1.1.1
+2
-2
dist/index.d.ts
declare global {
interface Window {
_notify_push_listeners: {
[event: string]: ((string: any) => void)[];
[event: string]: ((string: any, any: any) => void)[];
};

@@ -24,2 +24,2 @@ _notify_push_ws: WebSocket | null | true;

*/
export declare function listen(name: string, handler: (string: any) => void): boolean;
export declare function listen(name: string, handler: (string: any, any: any) => void): boolean;

@@ -127,7 +127,11 @@ "use strict";

window._notify_push_ws.onmessage = function (message) {
var event = message.data;
var i = message.data.indexOf(' ');
var _a = i > 0 ? [message.data.slice(0, i), message.data.slice(i + 1)] : [message.data, null], event = _a[0], body = _a[1];
if (body) {
body = JSON.parse(body);
}
if (window._notify_push_listeners[event]) {
for (var _i = 0, _a = window._notify_push_listeners[event]; _i < _a.length; _i++) {
var cb = _a[_i];
cb(event);
for (var _i = 0, _b = window._notify_push_listeners[event]; _i < _b.length; _i++) {
var cb = _b[_i];
cb(event, body);
}

@@ -134,0 +138,0 @@ }

@@ -1,8 +0,8 @@

import { getCapabilities } from '@nextcloud/capabilities';
import {getCapabilities} from '@nextcloud/capabilities';
import axios from '@nextcloud/axios'
import { subscribe } from '@nextcloud/event-bus'
import {subscribe} from '@nextcloud/event-bus'
declare global {
interface Window {
_notify_push_listeners: { [event: string] : ((string) => void)[] },
_notify_push_listeners: { [event: string]: ((string, any) => void)[] },
_notify_push_ws: WebSocket | null | true,

@@ -36,3 +36,3 @@ _notify_push_online: boolean,

*/
export function listen(name: string, handler: (string) => void): boolean {
export function listen(name: string, handler: (string, any) => void): boolean {
setupGlobals();

@@ -112,7 +112,11 @@

window._notify_push_ws.onmessage = message => {
const event = message.data;
const i = message.data.indexOf(' ');
let [event, body] = i > 0 ? [message.data.slice(0, i), message.data.slice(i + 1)] : [message.data, null];
if (body) {
body = JSON.parse(body);
}
if (window._notify_push_listeners[event]) {
for (let cb of window._notify_push_listeners[event]) {
cb(event);
cb(event, body);
}

@@ -119,0 +123,0 @@ }

{
"name": "@nextcloud/notify_push",
"version": "1.1.0",
"version": "1.1.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",