Blame SOURCES/nodejs-concat-stream-1.4.4-Remove-dependency-on-typedarray.patch

9795f4
From 6f84bc49f32fb8c50b8a23e9277a693b18ad3e48 Mon Sep 17 00:00:00 2001
9795f4
From: Jamie Nguyen <j@jamielinux.com>
9795f4
Date: Thu, 13 Mar 2014 16:23:51 +0000
9795f4
Subject: [PATCH] Remove dependency on npm(typedarray)
9795f4
9795f4
---
9795f4
 index.js           | 4 +---
9795f4
 package.json       | 3 +--
9795f4
 test/buffer.js     | 4 +---
9795f4
 test/string.js     | 4 +---
9795f4
 test/typedarray.js | 8 +++-----
9795f4
 5 files changed, 7 insertions(+), 16 deletions(-)
9795f4
9795f4
diff --git a/index.js b/index.js
9795f4
index f9da8d2..91d004e 100644
9795f4
--- a/index.js
9795f4
+++ b/index.js
9795f4
@@ -1,7 +1,5 @@
9795f4
 var Writable = require('stream').Writable
9795f4
 var inherits = require('inherits')
9795f4
-var TA = require('typedarray')
9795f4
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
9795f4
 
9795f4
 function ConcatStream(opts, cb) {
9795f4
   if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb)
9795f4
@@ -122,7 +120,7 @@ function u8Concat (parts) {
9795f4
     }
9795f4
     len += parts[i].length
9795f4
   }
9795f4
-  var u8 = new U8(len)
9795f4
+  var u8 = new Uint8Array(len)
9795f4
   for (var i = 0, offset = 0; i < parts.length; i++) {
9795f4
     var part = parts[i]
9795f4
     for (var j = 0; j < part.length; j++) {
9795f4
diff --git a/package.json b/package.json
9795f4
index f84ce76..bf182f5 100644
9795f4
--- a/package.json
9795f4
+++ b/package.json
9795f4
@@ -25,8 +25,7 @@
9795f4
   },
9795f4
   "license": "MIT",
9795f4
   "dependencies": {
9795f4
-    "inherits": "~2.0.1",
9795f4
-    "typedarray": "~0.0.5"
9795f4
+    "inherits": "~2.0.1"
9795f4
   },
9795f4
   "devDependencies": {
9795f4
     "tape": "~2.3.2"
9795f4
diff --git a/test/buffer.js b/test/buffer.js
9795f4
index d28f5f9..b408158 100644
9795f4
--- a/test/buffer.js
9795f4
+++ b/test/buffer.js
9795f4
@@ -1,7 +1,5 @@
9795f4
 var concat = require('../')
9795f4
 var test = require('tape')
9795f4
-var TA = require('typedarray')
9795f4
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
9795f4
 
9795f4
 test('buffer stream', function (t) {
9795f4
   t.plan(2)
9795f4
@@ -23,7 +21,7 @@ test('buffer mixed writes', function (t) {
9795f4
   buffers.write(new Buffer('pizza'))
9795f4
   buffers.write(' Array is not a ')
9795f4
   buffers.write([ 115, 116, 114, 105, 110, 103, 121 ])
9795f4
-  var u8 = new U8(4)
9795f4
+  var u8 = new Uint8Array(4)
9795f4
   u8[0] = 32; u8[1] = 99; u8[2] = 97; u8[3] = 116
9795f4
   buffers.write(u8)
9795f4
   buffers.write(555)
9795f4
diff --git a/test/string.js b/test/string.js
9795f4
index 1fccb61..3ce41b0 100644
9795f4
--- a/test/string.js
9795f4
+++ b/test/string.js
9795f4
@@ -1,7 +1,5 @@
9795f4
 var concat = require('../')
9795f4
 var test = require('tape')
9795f4
-var TA = require('typedarray')
9795f4
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
9795f4
 
9795f4
 test('string -> buffer stream', function (t) {
9795f4
   t.plan(2)
9795f4
@@ -44,7 +42,7 @@ test('string from mixed write encodings', function (t) {
9795f4
   strings.write('na')
9795f4
   strings.write(Buffer('cho'))
9795f4
   strings.write([ 32, 100 ])
9795f4
-  var u8 = new U8(3)
9795f4
+  var u8 = new Uint8Array(3)
9795f4
   u8[0] = 111; u8[1] = 103; u8[2] = 115;
9795f4
   strings.end(u8)
9795f4
 })
9795f4
diff --git a/test/typedarray.js b/test/typedarray.js
9795f4
index ee07110..db24df1 100644
9795f4
--- a/test/typedarray.js
9795f4
+++ b/test/typedarray.js
9795f4
@@ -1,15 +1,13 @@
9795f4
 var concat = require('../')
9795f4
 var test = require('tape')
9795f4
-var TA = require('typedarray')
9795f4
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
9795f4
 
9795f4
 test('typed array stream', function (t) {
9795f4
   t.plan(2)
9795f4
-  var a = new U8(5)
9795f4
+  var a = new Uint8Array(5)
9795f4
   a[0] = 97; a[1] = 98; a[2] = 99; a[3] = 100; a[4] = 101;
9795f4
-  var b = new U8(3)
9795f4
+  var b = new Uint8Array(3)
9795f4
   b[0] = 32; b[1] = 102; b[2] = 103;
9795f4
-  var c = new U8(4)
9795f4
+  var c = new Uint8Array(4)
9795f4
   c[0] = 32; c[1] = 120; c[2] = 121; c[3] = 122;
9795f4
 
9795f4
   var arrays = concat({ encoding: 'Uint8Array' }, function(out) {
9795f4
-- 
9795f4
1.8.5.3
9795f4