-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 9156c4e Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 31 16:47:38 2023 +0800 chore(deps): bump github.com/docker/docker from 24.0.5+incompatible to 24.0.7+incompatible (#15085) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 088678c Author: Korbinian <[email protected]> Date: Tue Oct 31 06:24:37 2023 +0100 feat(bridge-ui-v2): confirmation step (#15083) commit 6c702d1 Author: NguyenTuanCanh <[email protected]> Date: Tue Oct 31 07:54:30 2023 +0700 refactor(decodeBase64ToJson): throw an error if any issues with decod… (#15064) Co-authored-by: Korbinian <[email protected]> commit 799ed71 Author: Kenk <[email protected]> Date: Mon Oct 30 22:33:51 2023 +0700 feat(website): add apus network to ecosystem (#15082)
- Loading branch information
1 parent
f7b3759
commit f98fa08
Showing
5 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import { Buffer } from 'buffer'; | ||
|
||
export const decodeBase64ToJson = (base64: string) => { | ||
return JSON.parse(Buffer.from(base64, 'base64').toString('utf-8')); | ||
try { | ||
const decodedString = Buffer.from(base64, 'base64').toString('utf-8'); | ||
return JSON.parse(decodedString); | ||
} catch (error) { | ||
throw new Error('Failed to decode and parse JSON from base64: ' + (error as Error).message); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.