// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 export const createErrorSearchParamsString = ({ error, errorDescription, }: { error: string | null; errorDescription: string | null; }): string => { const errorParams = new URLSearchParams(); if (error) { errorParams.set('error', error); } if (errorDescription) { errorParams.set('error_description', errorDescription); } return errorParams.toString(); };