launchdarkly-js-sdk-common 5.7.0-beta.4 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the `launchdarkly-js-sdk-common` package will be documented in this file. Changes that affect the dependent SDKs such as `launchdarkly-js-client-sdk` should also be logged in those projects, in the next release that uses the updated version of this package. This project adheres to [Semantic Versioning](http://semver.org).
|
|
4
4
|
|
|
5
|
+
## [5.7.0](https://github.com/launchdarkly/js-sdk-common/compare/5.6.0...5.7.0) (2025-05-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* Add support for per-context summary events. ([#126](https://github.com/launchdarkly/js-sdk-common/issues/126)) ([05f7d4e](https://github.com/launchdarkly/js-sdk-common/commit/05f7d4ec0ac7b072e12a3260f55861c7db039e03))
|
|
11
|
+
|
|
5
12
|
## [5.6.0](https://github.com/launchdarkly/js-sdk-common/compare/5.5.1...5.6.0) (2025-04-29)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -2,9 +2,8 @@ const canonicalize = require('./canonicalize');
|
|
|
2
2
|
const EventSummarizer = require('./EventSummarizer');
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Construct a multi-event summarizer. This summarizer produces a summary event for each unique context.
|
|
6
6
|
* @param {{filter: (context: any) => any}} contextFilter
|
|
7
|
-
* @param {() => {update: (value: string) => void, digest: (format: string) => Promise<string>}} hasherFactory
|
|
8
7
|
*/
|
|
9
8
|
function MultiEventSummarizer(contextFilter) {
|
|
10
9
|
let summarizers = {};
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
const MultiEventSummarizer = require('../MultiEventSummarizer');
|
|
2
2
|
const ContextFilter = require('../ContextFilter');
|
|
3
3
|
|
|
4
|
-
function mockHasher() {
|
|
5
|
-
let state = '';
|
|
6
|
-
return {
|
|
7
|
-
update: input => {
|
|
8
|
-
state += input;
|
|
9
|
-
},
|
|
10
|
-
digest: () => state,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
4
|
function makeEvent(key, version, variation, value, defaultVal, context) {
|
|
15
5
|
return {
|
|
16
6
|
kind: 'feature',
|
|
@@ -24,13 +14,13 @@ function makeEvent(key, version, variation, value, defaultVal, context) {
|
|
|
24
14
|
};
|
|
25
15
|
}
|
|
26
16
|
|
|
27
|
-
describe('
|
|
17
|
+
describe('given a multi-event summarizer and context filter', () => {
|
|
28
18
|
let summarizer;
|
|
29
19
|
let contextFilter;
|
|
30
20
|
|
|
31
21
|
beforeEach(() => {
|
|
32
22
|
contextFilter = ContextFilter(false, []);
|
|
33
|
-
summarizer = MultiEventSummarizer(contextFilter
|
|
23
|
+
summarizer = MultiEventSummarizer(contextFilter);
|
|
34
24
|
});
|
|
35
25
|
|
|
36
26
|
it('creates new summarizer for new context hash', async () => {
|