Переглянути джерело

fix: TS type for `DataStoreSerializer.serialize()`

Sv443 1 місяць тому
батько
коміт
24dad2b
2 змінених файлів з 7 додано та 2 видалено
  1. 5 0
      .changeset/thin-pumpkins-invite.md
  2. 2 2
      lib/DataStoreSerializer.ts

+ 5 - 0
.changeset/thin-pumpkins-invite.md

@@ -0,0 +1,5 @@
+---
+"@sv443-network/userutils": patch
+---
+
+Fixed TS type for `DataStoreSerializer.serialize()`

+ 2 - 2
lib/DataStoreSerializer.ts

@@ -71,13 +71,13 @@ export class DataStoreSerializer {
    * @param useEncoding Whether to encode the data using each DataStore's `encodeData()` method
    * @param stringified Whether to return the result as a string or as an array of `SerializedDataStore` objects
    */
-  public async serialize(useEncoding: boolean, stringified: true): Promise<string>;
+  public async serialize(useEncoding?: boolean, stringified?: true): Promise<string>;
   /**
    * Serializes the data stores into a string.  
    * @param useEncoding Whether to encode the data using each DataStore's `encodeData()` method
    * @param stringified Whether to return the result as a string or as an array of `SerializedDataStore` objects
    */
-  public async serialize(useEncoding: boolean, stringified: false): Promise<SerializedDataStore[]>;
+  public async serialize(useEncoding?: boolean, stringified?: false): Promise<SerializedDataStore[]>;
   /**
    * Serializes the data stores into a string.  
    * @param useEncoding Whether to encode the data using each DataStore's `encodeData()` method