Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nextcloud/event-bus

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nextcloud/event-bus - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

CHANGELOG.md

1

dist/package.d.ts

@@ -24,2 +24,3 @@ export declare const name: string;

"core-js": string;
"semver": string;
};

@@ -26,0 +27,0 @@ export declare const devDependencies: {

14

dist/ProxyBus.js

@@ -8,2 +8,6 @@ "use strict";

var _semver = _interopRequireDefault(require("semver"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -19,3 +23,3 @@

name: "@nextcloud/event-bus",
version: "1.0.0",
version: "1.0.1",
description: "",

@@ -41,3 +45,4 @@ main: "dist/index.js",

dependencies: {
"core-js": "^3.1.4"
"core-js": "^3.1.4",
semver: "^7.1.1"
},

@@ -68,4 +73,5 @@ devDependencies: {

if (bus.getVersion() !== this.getVersion()) {
// TODO: only warn if major version number does not match
if (typeof bus.getVersion !== 'function' || !_semver.default.valid(bus.getVersion())) {
console.warn('Proxying an event bus with an unknown or invalid version');
} else if (_semver.default.major(bus.getVersion()) !== _semver.default.major(this.getVersion())) {
console.warn('Proxying an event bus of version ' + bus.getVersion() + ' with ' + this.getVersion());

@@ -72,0 +78,0 @@ }

@@ -34,3 +34,3 @@ "use strict";

name: "@nextcloud/event-bus",
version: "1.0.0",
version: "1.0.1",
description: "",

@@ -56,3 +56,4 @@ main: "dist/index.js",

dependencies: {
"core-js": "^3.1.4"
"core-js": "^3.1.4",
semver: "^7.1.1"
},

@@ -59,0 +60,0 @@ devDependencies: {

@@ -0,1 +1,3 @@

import semver from 'semver';
import packageJson from "../package.json";

@@ -11,4 +13,5 @@ import { Event } from "./Event.js";

constructor(bus: EventBus) {
if (bus.getVersion() !== this.getVersion()) {
// TODO: only warn if major version number does not match
if (typeof bus.getVersion !== 'function' || !semver.valid(bus.getVersion())) {
console.warn('Proxying an event bus with an unknown or invalid version')
} else if (semver.major(bus.getVersion()) !== semver.major(this.getVersion())) {
console.warn('Proxying an event bus of version ' + bus.getVersion() + ' with ' + this.getVersion())

@@ -15,0 +18,0 @@ }

{
"name": "@nextcloud/event-bus",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -26,3 +26,4 @@ "main": "dist/index.js",

"dependencies": {
"core-js": "^3.1.4"
"core-js": "^3.1.4",
"semver": "^7.1.1"
},

@@ -29,0 +30,0 @@ "devDependencies": {

import { emit, subscribe, unsubscribe } from '../lib/index'
test('readme example', () => {
const h = jest.fn(e => console.info(e))
const h = jest.fn()

@@ -18,3 +18,3 @@ subscribe('a', h)

test('unsubscribe', () => {
const h = jest.fn(e => console.info(e))
const h = jest.fn()

@@ -21,0 +21,0 @@ subscribe('a', h)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc