Skip to content

Commit 19fb7ab

Browse files
committed
add JSDocs on large method
1 parent 1c34390 commit 19fb7ab

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

clients/fides-js/src/lib/gpp/string-to-consent.ts

+17
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ interface FidesStringToConsentArgs {
188188
fidesString: string;
189189
cmpApi: CmpApi;
190190
}
191+
192+
/**
193+
* Converts a Fides string to consent preferences and updates the CMP API
194+
*
195+
* This function handles both TCF and non-TCF consent scenarios:
196+
* 1. Decodes the provided Fides string and extracts GPP data
197+
* 2. Updates the CMP API with the GPP string and sets signal status
198+
* 3. Maps privacy notices with their translation ID
199+
* 4. Decodes consent preferences from appropriate CMP API
200+
* 5. Formats consent preferences to save
201+
* 6. Calls updateConsentPreferences with the formatted consent preferences
202+
*
203+
* @param {FidesStringToConsentArgs} args - The arguments object
204+
* @param {string} args.fidesString - The encoded Fides consent string containing GPP data
205+
* @param {CmpApi} args.cmpApi - The GPP CMP API instance to update with consent data
206+
* @returns {void}
207+
*/
191208
export const fidesStringToConsent = ({
192209
fidesString,
193210
cmpApi,

0 commit comments

Comments
 (0)