Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export async function lscStorage<T extends Record<string, any>>(key: string): Pr
* const user = await lscStorage("user");
* console.log(user); // { name: "John Doe", age: 25 }
*/

export async function lscStorage<T extends Record<string, any>>(key: string, value?: T): Promise<T | string> {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Function signature update requires documentation and interface update

The function signature has been changed from returning Promise<T | void> to Promise<T | string>. This is a breaking change that would require updates to any code that depends on this function. The JSDoc comment in line 33 still shows the old return type and should be updated to match.


🏁 Script executed:

#!/bin/bash
# Find usages of lscStorage in the codebase that might need updates
rg -g "*.{ts,tsx,js,jsx}" -A 5 "lscStorage\(" --no-heading

Length of output: 1141


Action Required: Update JSDoc Documentation and Clean Up Deprecated Signatures

  • The updated function signature now returns Promise<T | string> instead of the previously documented Promise<T | void> (or Promise<T | null> in some variants).
  • The JSDoc block at line 33 still reflects the old return type—this could mislead any consumers of the function.
  • Additionally, there are multiple deprecated or commented-out variants of lscStorage in the file. Consider removing these to avoid confusion.

Please update the JSDoc comment in src/storage.ts (starting at line 33) to correctly document the new return type, and clean up any outdated or unused function signatures accordingly.

// this method need to be remove as soon as possible
try {
if (value !== undefined) {
localStorage.setItem(key, JSON.stringify(value));
Expand Down