Skip to content

Commit 9f8ca5a

Browse files
Merge branch 'inlocalstorage_async_validateCache' into inlocalstorage_wrapper
2 parents 358a6b7 + 9f84077 commit 9f8ca5a

File tree

6 files changed

+14
-16
lines changed

6 files changed

+14
-16
lines changed

CHANGES.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2.4.0 (May 20, 2025)
2-
- Added support for targeting rules based on rule-based segments.
3-
- Added support for feature flag prerequisites.
1+
2.4.0 (May 27, 2025)
2+
- Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK.
3+
- Added support for feature flag prerequisites. This allows customers to define dependency conditions between flags, which are evaluated before any allowlists or targeting rules.
44

55
2.3.0 (May 16, 2025)
66
- Updated the Redis storage to:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-commons",
3-
"version": "2.3.1-rc.0",
3+
"version": "2.4.0",
44
"description": "Split JavaScript SDK common components",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

src/sdkManager/__tests__/mocks/input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@
5252
]
5353
}
5454
]
55-
}
55+
}

src/sdkManager/__tests__/mocks/output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
"flagName": "some_flag",
1515
"treatments": ["on"]
1616
}]
17-
}
17+
}

src/storages/inLocalStorage/MySegmentsCacheInLocal.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,12 @@ export class MySegmentsCacheInLocal extends AbstractMySegmentsCacheSync {
5050
}
5151

5252
getRegisteredSegments(): string[] {
53-
// Scan current values from localStorage
54-
return Object.keys(this.localStorage).reduce((accum, key) => {
55-
let segmentName = this.keys.extractSegmentName(key);
56-
57-
if (segmentName) accum.push(segmentName);
58-
59-
return accum;
60-
}, [] as string[]);
53+
const registeredSegments: string[] = [];
54+
for (let i = 0; i < this.localStorage.length; i++) {
55+
const segmentName = this.keys.extractSegmentName(this.localStorage.key(i)!);
56+
if (segmentName) registeredSegments.push(segmentName);
57+
}
58+
return registeredSegments;
6159
}
6260

6361
getKeysCount() {

0 commit comments

Comments
 (0)