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

redux-beacon

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-beacon - npm Package Compare versions

Comparing version 2.0.5 to 2.1.0

7

dist/get-events-with-matching-key.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getEventsWithMatchingKey(eventsMap, actionType) {
return Object.keys(eventsMap)
.filter(function (key) { return key === '*' || key === actionType; })
var objectKeys = Object.keys(eventsMap);
var symbolKeys = Object.getOwnPropertySymbols
? Object.getOwnPropertySymbols(eventsMap)
: [];
return objectKeys.concat(symbolKeys).filter(function (key) { return key === '*' || key === actionType; })
.map(function (matchingKey) { return eventsMap[matchingKey]; });
}
exports.default = getEventsWithMatchingKey;
{
"name": "redux-beacon",
"version": "2.0.5",
"version": "2.1.0",
"description": "Analytics integration for Redux and ngrx/store",

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

import getEventsWithMatchingKey from '../get-events-with-matching-key';
const actionSymbolString = 'actionSymbol';
const actionSymbol = Symbol('actionSymbol');
[

@@ -52,2 +54,12 @@ {

},
{
title: 'action type can be a Symbol',
eventsMap: {
[actionSymbol]: 'eventDefSymbol',
[actionSymbolString]: 'eventDefString',
[`Symbol(${actionSymbolString})`]: 'eventDefString',
},
actionType: actionSymbol,
expected: ['eventDefSymbol'],
},
].forEach((scenario, index) => {

@@ -54,0 +66,0 @@ const { title, eventsMap, actionType, expected, only } = scenario;

@@ -7,3 +7,7 @@ import { EventDefinition, EventsMap } from './types';

): EventDefinition[] {
return Object.keys(eventsMap)
const objectKeys = Object.keys(eventsMap);
const symbolKeys = Object.getOwnPropertySymbols
? Object.getOwnPropertySymbols(eventsMap)
: [];
return [...objectKeys, ...symbolKeys]
.filter(key => key === '*' || key === actionType)

@@ -10,0 +14,0 @@ .map(matchingKey => eventsMap[matchingKey]);

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