@aws-sdk/util-buffer-from
Advanced tools
Comparing version 3.170.0 to 3.183.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.183.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.182.0...v3.183.0) (2022-10-03) | ||
**Note:** Version bump only for package @aws-sdk/util-buffer-from | ||
# [3.170.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.169.0...v3.170.0) (2022-09-13) | ||
@@ -8,0 +16,0 @@ |
import { isArrayBuffer } from "@aws-sdk/is-array-buffer"; | ||
import { Buffer } from "buffer"; | ||
export var fromArrayBuffer = function (input, offset, length) { | ||
if (offset === void 0) { offset = 0; } | ||
if (length === void 0) { length = input.byteLength - offset; } | ||
export const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => { | ||
if (!isArrayBuffer(input)) { | ||
throw new TypeError("The \"input\" argument must be ArrayBuffer. Received type ".concat(typeof input, " (").concat(input, ")")); | ||
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`); | ||
} | ||
return Buffer.from(input, offset, length); | ||
}; | ||
export var fromString = function (input, encoding) { | ||
export const fromString = (input, encoding) => { | ||
if (typeof input !== "string") { | ||
throw new TypeError("The \"input\" argument must be of type string. Received type ".concat(typeof input, " (").concat(input, ")")); | ||
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`); | ||
} | ||
return encoding ? Buffer.from(input, encoding) : Buffer.from(input); | ||
}; |
{ | ||
"name": "@aws-sdk/util-buffer-from", | ||
"version": "3.170.0", | ||
"version": "3.183.0", | ||
"scripts": { | ||
@@ -20,3 +20,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"dependencies": { | ||
"@aws-sdk/is-array-buffer": "3.170.0", | ||
"@aws-sdk/is-array-buffer": "3.183.0", | ||
"tslib": "^2.3.1" | ||
@@ -23,0 +23,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
34298
56
+ Added@aws-sdk/is-array-buffer@3.183.0(transitive)
- Removed@aws-sdk/is-array-buffer@3.170.0(transitive)