Skip to content

Commit fa4c525

Browse files
committed
fix: remove DataStoreSerializer generic parameter
1 parent d8f538c commit fa4c525

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.changeset/metal-seals-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@sv443-network/coreutils": patch
3+
---
4+
5+
Removed `DataStoreSerializer` generic parameter.

.github/workflows/build-and-publish-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
retention-days: ${{ env.RETENTION_DAYS }}
7474

7575
- name: Create release or publish package
76-
uses: changesets/action@v1
76+
uses: changesets/action@v1.6.0
7777
id: changesets
7878
with:
7979
publish: npm run publish-package

lib/DataStoreSerializer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export type StoreFilter = string[] | ((id: string) => boolean);
5050
*
5151
* - ⚠️ Needs to run in a secure context (HTTPS) due to the use of the SubtleCrypto API if checksumming is enabled.
5252
*/
53-
export class DataStoreSerializer<TData extends DataStoreData> {
54-
protected stores: DataStore<TData>[];
53+
export class DataStoreSerializer {
54+
protected stores: DataStore<DataStoreData>[];
5555
protected options: Required<DataStoreSerializerOptions>;
5656

57-
constructor(stores: DataStore<TData>[], options: DataStoreSerializerOptions = {}) {
57+
constructor(stores: DataStore<DataStoreData>[], options: DataStoreSerializerOptions = {}) {
5858
if(!crypto || !crypto.subtle)
5959
throw new ScriptContextError("DataStoreSerializer has to run in a secure context (HTTPS) or in another environment that implements the subtleCrypto API!");
6060

@@ -245,7 +245,7 @@ export class DataStoreSerializer<TData extends DataStoreData> {
245245
}
246246

247247
/** Returns the DataStore instances whose IDs match the provided array or function */
248-
protected getStoresFiltered(stores?: StoreFilter): DataStore<TData>[] {
248+
protected getStoresFiltered(stores?: StoreFilter): DataStore<DataStoreData>[] {
249249
return this.stores.filter(s => typeof stores === "undefined" ? true : Array.isArray(stores) ? stores.includes(s.id) : stores(s.id));
250250
}
251251
}

0 commit comments

Comments
 (0)