Socket
Socket
Sign inDemoInstall

@aws-sdk/util-buffer-from

Package Overview
Dependencies
Maintainers
5
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/util-buffer-from - npm Package Compare versions

Comparing version 3.310.0 to 3.374.0

19

dist-cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromString = exports.fromArrayBuffer = void 0;
const is_array_buffer_1 = require("@aws-sdk/is-array-buffer");
const buffer_1 = require("buffer");
const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
if (!(0, is_array_buffer_1.isArrayBuffer)(input)) {
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
}
return buffer_1.Buffer.from(input, offset, length);
};
exports.fromArrayBuffer = fromArrayBuffer;
const fromString = (input, encoding) => {
if (typeof input !== "string") {
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
}
return encoding ? buffer_1.Buffer.from(input, encoding) : buffer_1.Buffer.from(input);
};
exports.fromString = fromString;
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("@smithy/util-buffer-from"), exports);

@@ -1,14 +0,1 @@

import { isArrayBuffer } from "@aws-sdk/is-array-buffer";
import { Buffer } from "buffer";
export const fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
if (!isArrayBuffer(input)) {
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
}
return Buffer.from(input, offset, length);
};
export const fromString = (input, encoding) => {
if (typeof input !== "string") {
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);
};
export * from "@smithy/util-buffer-from";

@@ -1,13 +0,1 @@

import { Buffer } from "buffer";
/**
* @internal
*/
export declare const fromArrayBuffer: (input: ArrayBuffer, offset?: number, length?: number) => Buffer;
/**
* @internal
*/
export type StringEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex";
/**
* @internal
*/
export declare const fromString: (input: string, encoding?: StringEncoding) => Buffer;
export * from "@smithy/util-buffer-from";

@@ -1,19 +0,1 @@

import { Buffer } from "buffer";
export declare const fromArrayBuffer: (
input: ArrayBuffer,
offset?: number,
length?: number
) => Buffer;
export type StringEncoding =
| "ascii"
| "utf8"
| "utf16le"
| "ucs2"
| "base64"
| "latin1"
| "binary"
| "hex";
export declare const fromString: (
input: string,
encoding?: StringEncoding
) => Buffer;
export * from "@smithy/util-buffer-from";

6

package.json
{
"name": "@aws-sdk/util-buffer-from",
"version": "3.310.0",
"version": "3.374.0",
"scripts": {

@@ -12,3 +12,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",

"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
"test": "jest"
"test": "exit 0"
},

@@ -21,3 +21,3 @@ "author": {

"dependencies": {
"@aws-sdk/is-array-buffer": "3.310.0",
"@smithy/util-buffer-from": "^1.0.1",
"tslib": "^2.5.0"

@@ -24,0 +24,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc