Skip to content

Commit

Permalink
explain legacy normalize function
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-id committed Feb 25, 2024
1 parent a39ff0c commit 4079bcf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ export function traverse(
}

/**
* Provides compatibility with legacy version of the API.
* Provides compatibility with legacy version of the API. This function:
* - removes 'praw_' prefix from keys
* - lower first letter of keys
* - replaces empty strings with `undefined`
*
* Note: GUS API returns more prefixed keys than 'praw_'. Removing only this
* prefix was initial partial implementation. This approach is deprecated
* and left only for compatibility with legacy code.
*
* @param obj object to normalize
* @deprecated
*/
Expand Down

0 comments on commit 4079bcf

Please sign in to comment.