Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buffer

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer - npm Package Compare versions

Comparing version 2.1.11 to 2.1.12

19

bundle.js

@@ -25,13 +25,10 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"Focm2+":[function(require,module,exports){

Buffer._useTypedArrays = (function () {
// Detect if browser supports Typed Arrays. Supported browsers are IE 10+,
// Firefox 4+, Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+.
if (typeof Uint8Array !== 'function' || typeof ArrayBuffer !== 'function')
return false
// Does the browser support adding properties to `Uint8Array` instances? If
// not, then that's the same as no `Uint8Array` support. We need to be able to
// add all the node Buffer API methods.
// Bug in Firefox 4-29, now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
// Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
// Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
// properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
// because we need to be able to add all the node Buffer API methods. This is an issue
// in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
try {
var arr = new Uint8Array(0)
var buf = new ArrayBuffer(0)
var arr = new Uint8Array(buf)
arr.foo = function () { return 42 }

@@ -912,3 +909,3 @@ return 42 === arr.foo() &&

Buffer.prototype.toArrayBuffer = function () {
if (typeof Uint8Array === 'function') {
if (typeof Uint8Array !== 'undefined') {
if (Buffer._useTypedArrays) {

@@ -915,0 +912,0 @@ return (new Buffer(this)).buffer

@@ -24,13 +24,10 @@ /**

Buffer._useTypedArrays = (function () {
// Detect if browser supports Typed Arrays. Supported browsers are IE 10+,
// Firefox 4+, Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+.
if (typeof Uint8Array !== 'function' || typeof ArrayBuffer !== 'function')
return false
// Does the browser support adding properties to `Uint8Array` instances? If
// not, then that's the same as no `Uint8Array` support. We need to be able to
// add all the node Buffer API methods.
// Bug in Firefox 4-29, now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
// Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
// Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
// properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
// because we need to be able to add all the node Buffer API methods. This is an issue
// in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
try {
var arr = new Uint8Array(0)
var buf = new ArrayBuffer(0)
var arr = new Uint8Array(buf)
arr.foo = function () { return 42 }

@@ -911,3 +908,3 @@ return 42 === arr.foo() &&

Buffer.prototype.toArrayBuffer = function () {
if (typeof Uint8Array === 'function') {
if (typeof Uint8Array !== 'undefined') {
if (Buffer._useTypedArrays) {

@@ -914,0 +911,0 @@ return (new Buffer(this)).buffer

{
"name": "buffer",
"description": "Node.js Buffer API, for the browser",
"version": "2.1.11",
"version": "2.1.12",
"author": {

@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh",

@@ -9,3 +9,3 @@ # buffer [![build](https://img.shields.io/travis/feross/buffer.svg)](https://travis-ci.org/feross/buffer) [![npm](https://img.shields.io/npm/v/buffer.svg)](https://npmjs.org/package/buffer) [![npm downloads](https://img.shields.io/npm/dm/buffer.svg)](https://npmjs.org/package/buffer) [![gittip](https://img.shields.io/gittip/feross.svg)](https://www.gittip.com/feross/)

The goal is to provide a Buffer API that is 100% identical to node's Buffer API. Read
The goal is to provide a Buffer API that is 100% identical to node's Buffer API. Read
the [official node.js docs](http://nodejs.org/api/buffer.html) for a full list of

@@ -12,0 +12,0 @@ supported methods.

@@ -28,3 +28,3 @@ var B = require('../').Buffer

test('new buffer from uint8array', function (t) {
if (typeof Uint8Array === 'function') {
if (typeof Uint8Array !== 'undefined') {
var b1 = new Uint8Array([0, 1, 2, 3])

@@ -43,3 +43,3 @@ var b2 = new B(b1)

test('new buffer from uint16array', function (t) {
if (typeof Uint16Array === 'function') {
if (typeof Uint16Array !== 'undefined') {
var b1 = new Uint16Array([0, 1, 2, 3])

@@ -58,3 +58,3 @@ var b2 = new B(b1)

test('new buffer from uint32array', function (t) {
if (typeof Uint32Array === 'function') {
if (typeof Uint32Array !== 'undefined') {
var b1 = new Uint32Array([0, 1, 2, 3])

@@ -73,3 +73,3 @@ var b2 = new B(b1)

test('new buffer from int16array', function (t) {
if (typeof Int16Array === 'function') {
if (typeof Int16Array !== 'undefined') {
var b1 = new Int16Array([0, 1, 2, 3])

@@ -88,3 +88,3 @@ var b2 = new B(b1)

test('new buffer from int32array', function (t) {
if (typeof Int32Array === 'function') {
if (typeof Int32Array !== 'undefined') {
var b1 = new Int32Array([0, 1, 2, 3])

@@ -103,3 +103,3 @@ var b2 = new B(b1)

test('new buffer from float32array', function (t) {
if (typeof Float32Array === 'function') {
if (typeof Float32Array !== 'undefined') {
var b1 = new Float32Array([0, 1, 2, 3])

@@ -118,3 +118,3 @@ var b2 = new B(b1)

test('new buffer from float64array', function (t) {
if (typeof Float64Array === 'function') {
if (typeof Float64Array !== 'undefined') {
var b1 = new Float64Array([0, 1, 2, 3])

@@ -134,3 +134,3 @@ var b2 = new B(b1)

var data = [1, 2, 3, 4, 5, 6, 7, 8]
if (typeof Uint8Array === 'function') {
if (typeof Uint8Array !== 'undefined') {
var result = new B(data).toArrayBuffer()

@@ -156,3 +156,3 @@ var expected = new Uint8Array(data).buffer

test('buffer copy example', function (t) {
test('buffer copy example', function (t) {
var buf1 = new B(26)

@@ -159,0 +159,0 @@ var buf2 = new B(26)

@@ -7,3 +7,3 @@ var B = require('../').Buffer

var buf1 = new Buffer(26)
var buf1 = new B(26)
for (var i = 0 ; i < 26 ; i++) {

@@ -25,3 +25,3 @@ buf1[i] = i + 97 // 97 is ASCII a

var buf1 = new Buffer(26)
var buf1 = new B(26)
for (var i = 0 ; i < 26 ; i++) {

@@ -28,0 +28,0 @@ buf1[i] = i + 97 // 97 is ASCII a

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