@aws-sdk/util-base64-node
Advanced tools
Comparing version 3.183.0 to 3.186.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06) | ||
**Note:** Version bump only for package @aws-sdk/util-base64-node | ||
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) | ||
@@ -8,0 +16,0 @@ |
import { fromArrayBuffer, fromString } from "@aws-sdk/util-buffer-from"; | ||
const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; | ||
var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/; | ||
export function fromBase64(input) { | ||
if ((input.length * 3) % 4 !== 0) { | ||
throw new TypeError(`Incorrect padding on base64 string.`); | ||
throw new TypeError("Incorrect padding on base64 string."); | ||
} | ||
if (!BASE64_REGEX.exec(input)) { | ||
throw new TypeError(`Invalid base64 string.`); | ||
throw new TypeError("Invalid base64 string."); | ||
} | ||
const buffer = fromString(input, "base64"); | ||
var buffer = fromString(input, "base64"); | ||
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); | ||
@@ -12,0 +12,0 @@ } |
{ | ||
"name": "@aws-sdk/util-base64-node", | ||
"version": "3.183.0", | ||
"version": "3.186.0", | ||
"description": "A Node.JS Base64 <-> UInt8Array converter", | ||
@@ -23,3 +23,3 @@ "main": "./dist-cjs/index.js", | ||
"dependencies": { | ||
"@aws-sdk/util-buffer-from": "3.183.0", | ||
"@aws-sdk/util-buffer-from": "3.186.0", | ||
"tslib": "^2.3.1" | ||
@@ -26,0 +26,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34974
+ Added@aws-sdk/is-array-buffer@3.186.0(transitive)
+ Added@aws-sdk/util-buffer-from@3.186.0(transitive)
- Removed@aws-sdk/is-array-buffer@3.183.0(transitive)
- Removed@aws-sdk/util-buffer-from@3.183.0(transitive)