@barchart/events-api-common
Advanced tools
Comparing version 1.3.6 to 1.3.7
const assert = require('@barchart/common-js/lang/assert'), | ||
array = require('@barchart/common-js/lang/array'), | ||
Enum = require('@barchart/common-js/lang/Enum'); | ||
@@ -178,2 +179,19 @@ | ||
/** | ||
* Get all context keys for productType. | ||
* | ||
* @public | ||
* @static | ||
* @param {ProductType} productType | ||
* @returns {Array} | ||
*/ | ||
static getContextKeysFor(productType) { | ||
assert.argumentIsRequired(productType, 'productType', ProductType, 'ProductType'); | ||
return array.unique(Enum.getItems(EventType) | ||
.filter(eventType => eventType.product === productType) | ||
.reduce((acc, item) => acc.concat(item.contextKeys), [ ]) | ||
); | ||
} | ||
toString() { | ||
@@ -180,0 +198,0 @@ return `[EventType (code=${this.code})]`; |
{ | ||
"name": "@barchart/events-api-common", | ||
"version": "1.3.6", | ||
"version": "1.3.7", | ||
"description": "Common classes used by the Event system", | ||
@@ -5,0 +5,0 @@ "author": { |
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
21454
656