@aws-amplify/core
Version:
Core category of aws-amplify
1 lines • 1.03 kB
Source Map (JSON)
{"version":3,"file":"base64Decoder.mjs","sources":["../../../../../src/utils/convert/base64/base64Decoder.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getAtob } from '../../globalHelpers';\nexport const base64Decoder = {\n convert(input, options) {\n let inputStr = input;\n // urlSafe character replacement options conform to the base64 url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#page-7\n if (options?.urlSafe) {\n inputStr = inputStr.replace(/-/g, '+').replace(/_/g, '/');\n }\n return getAtob()(inputStr);\n },\n};\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,aAAa,GAAG;AAC7B,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE;AAC5B,QAAQ,IAAI,QAAQ,GAAG,KAAK;AAC5B;AACA;AACA,QAAQ,IAAI,OAAO,EAAE,OAAO,EAAE;AAC9B,YAAY,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AACrE;AACA,QAAQ,OAAO,OAAO,EAAE,CAAC,QAAQ,CAAC;AAClC,KAAK;AACL;;;;"}