]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blobdiff - example/iot-gateway/node_modules/arraybuffer.slice/index.js
Updated Sensor To Cloud design to have an easy to use setup GUI on the
[apps/tidep0084.git] / example / iot-gateway / node_modules / arraybuffer.slice / index.js
diff --git a/example/iot-gateway/node_modules/arraybuffer.slice/index.js b/example/iot-gateway/node_modules/arraybuffer.slice/index.js
deleted file mode 100644 (file)
index 11ac556..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * An abstraction for slicing an arraybuffer even when
- * ArrayBuffer.prototype.slice is not supported
- *
- * @api public
- */
-
-module.exports = function(arraybuffer, start, end) {
-  var bytes = arraybuffer.byteLength;
-  start = start || 0;
-  end = end || bytes;
-
-  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
-
-  if (start < 0) { start += bytes; }
-  if (end < 0) { end += bytes; }
-  if (end > bytes) { end = bytes; }
-
-  if (start >= bytes || start >= end || bytes === 0) {
-    return new ArrayBuffer(0);
-  }
-
-  var abv = new Uint8Array(arraybuffer);
-  var result = new Uint8Array(end - start);
-  for (var i = start, ii = 0; i < end; i++, ii++) {
-    result[ii] = abv[i];
-  }
-  return result.buffer;
-};