redux-beacon
Advanced tools
Comparing version 2.0.5 to 2.1.0
"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]); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57674
1307