Skip to content

Commit ff93696

Browse files
committed
Fix TypeScript 5.9 compatibility and bump @openfeature/core
- Remove explicit IterableIterator return types (TS 5.9 MapIterator change) - Bump @openfeature/core from ^1.8.1 to ^1.9.0 for web-sdk compatibility - Add hookData property to test mock (required in @openfeature/core 1.9)
1 parent 02ca655 commit ff93696

6 files changed

Lines changed: 16 additions & 22 deletions

File tree

packages/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
"@types/chrome": "^0.1.18"
5050
},
5151
"peerDependencies": {
52-
"@openfeature/core": "^1.8.0",
52+
"@openfeature/core": "^1.9.0",
5353
"@openfeature/web-sdk": "^1.5.0"
5454
},
5555
"devDependencies": {
56-
"@openfeature/core": "^1.8.1",
56+
"@openfeature/core": "^1.9.0",
5757
"@openfeature/web-sdk": "^1.5.0",
5858
"@types/jest": "^30.0.0",
5959
"@types/node": "^18.0.0",

packages/browser/src/cache/local-storage-assignment-shim.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ export class LocalStorageAssignmentShim implements Map<string, string> {
3030

3131
size: number = this.getCache().size
3232

33-
entries(): IterableIterator<[string, string]> {
33+
entries() {
3434
return this.getCache().entries()
3535
}
3636

37-
keys(): IterableIterator<string> {
37+
keys() {
3838
return this.getCache().keys()
3939
}
4040

41-
values(): IterableIterator<string> {
41+
values() {
4242
return this.getCache().values()
4343
}
4444

45-
[Symbol.iterator](): IterableIterator<[string, string]> {
45+
[Symbol.iterator]() {
4646
return this.getCache()[Symbol.iterator]()
4747
}
4848

packages/browser/test/openfeature/flagEvaluations.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ describe('createFlagEvaluationTrackingHook', () => {
7070
warn: jest.fn(),
7171
error: jest.fn(),
7272
} as any,
73+
hookData: new Map(),
7374
}
7475

7576
const mockDetails: EvaluationDetails<boolean> = {

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"typecheck": "tsc --noEmit"
4242
},
4343
"devDependencies": {
44-
"@openfeature/core": "^1.8.1",
44+
"@openfeature/core": "^1.9.0",
4545
"@types/jest": "^30.0.0",
4646
"@types/node": "^18.0.0",
4747
"@types/spark-md5": "^3.0.5",

packages/core/src/cache/lru-cache.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class LRUCache implements Map<string, string> {
1919

2020
constructor(protected readonly capacity: number) {}
2121

22-
[Symbol.iterator](): IterableIterator<[string, string]> {
22+
[Symbol.iterator]() {
2323
return this.cache[Symbol.iterator]()
2424
}
2525

@@ -29,7 +29,7 @@ export class LRUCache implements Map<string, string> {
2929

3030
readonly size: number = this.cache.size
3131

32-
entries(): IterableIterator<[string, string]> {
32+
entries() {
3333
return this.cache.entries()
3434
}
3535

@@ -41,11 +41,11 @@ export class LRUCache implements Map<string, string> {
4141
return this.cache.delete(key)
4242
}
4343

44-
keys(): IterableIterator<string> {
44+
keys() {
4545
return this.cache.keys()
4646
}
4747

48-
values(): IterableIterator<string> {
48+
values() {
4949
return this.cache.values()
5050
}
5151

yarn.lock

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ __metadata:
561561
version: 0.0.0-use.local
562562
resolution: "@datadog/flagging-core@workspace:packages/core"
563563
dependencies:
564-
"@openfeature/core": "npm:^1.8.1"
564+
"@openfeature/core": "npm:^1.9.0"
565565
"@types/jest": "npm:^30.0.0"
566566
"@types/node": "npm:^18.0.0"
567567
"@types/spark-md5": "npm:^3.0.5"
@@ -580,7 +580,7 @@ __metadata:
580580
dependencies:
581581
"@datadog/browser-core": "npm:^6.19.0"
582582
"@datadog/flagging-core": "npm:0.3.3"
583-
"@openfeature/core": "npm:^1.8.1"
583+
"@openfeature/core": "npm:^1.9.0"
584584
"@openfeature/web-sdk": "npm:^1.5.0"
585585
"@types/chrome": "npm:^0.1.18"
586586
"@types/jest": "npm:^30.0.0"
@@ -594,7 +594,7 @@ __metadata:
594594
ts-loader: "npm:^9.5.2"
595595
typescript: "npm:^5.5.0"
596596
peerDependencies:
597-
"@openfeature/core": ^1.8.0
597+
"@openfeature/core": ^1.9.0
598598
"@openfeature/web-sdk": ^1.5.0
599599
languageName: unknown
600600
linkType: soft
@@ -1967,20 +1967,13 @@ __metadata:
19671967
languageName: node
19681968
linkType: hard
19691969

1970-
"@openfeature/core@npm:1.9.1":
1970+
"@openfeature/core@npm:1.9.1, @openfeature/core@npm:^1.9.0":
19711971
version: 1.9.1
19721972
resolution: "@openfeature/core@npm:1.9.1"
19731973
checksum: 10c0/983c651484621e6e5a3b4bf83fce5398a1adc2ace6162ff5a13a8eaf6d285b7c6b15f5c0a477ece9010ca88b28799985d810047ea0c18324d7a51ac4d04e18d6
19741974
languageName: node
19751975
linkType: hard
19761976

1977-
"@openfeature/core@npm:^1.8.1":
1978-
version: 1.8.1
1979-
resolution: "@openfeature/core@npm:1.8.1"
1980-
checksum: 10c0/534396e8890858e8aba4ca73062a657b6078f0c94d6f3a041100026ed005183e617c2b6e7076c06cb55d96c9edb296b40653bbb495cf42d036a6a62364b256ea
1981-
languageName: node
1982-
linkType: hard
1983-
19841977
"@openfeature/server-sdk@npm:1.20.1":
19851978
version: 1.20.1
19861979
resolution: "@openfeature/server-sdk@npm:1.20.1"

0 commit comments

Comments
 (0)