aboutsummaryrefslogtreecommitdiffstats
path: root/dgbuilder/dgeflows/node_modules/body-parser/node_modules/depd/lib/compat/buffer-concat.js
diff options
context:
space:
mode:
Diffstat (limited to 'dgbuilder/dgeflows/node_modules/body-parser/node_modules/depd/lib/compat/buffer-concat.js')
-rw-r--r--dgbuilder/dgeflows/node_modules/body-parser/node_modules/depd/lib/compat/buffer-concat.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/dgbuilder/dgeflows/node_modules/body-parser/node_modules/depd/lib/compat/buffer-concat.js b/dgbuilder/dgeflows/node_modules/body-parser/node_modules/depd/lib/compat/buffer-concat.js
new file mode 100644
index 00000000..09d97219
--- /dev/null
+++ b/dgbuilder/dgeflows/node_modules/body-parser/node_modules/depd/lib/compat/buffer-concat.js
@@ -0,0 +1,33 @@
+/*!
+ * depd
+ * Copyright(c) 2014 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = bufferConcat
+
+/**
+ * Concatenate an array of Buffers.
+ */
+
+function bufferConcat(bufs) {
+ var length = 0
+
+ for (var i = 0, len = bufs.length; i < len; i++) {
+ length += bufs[i].length
+ }
+
+ var buf = new Buffer(length)
+ var pos = 0
+
+ for (var i = 0, len = bufs.length; i < len; i++) {
+ bufs[i].copy(buf, pos)
+ pos += bufs[i].length
+ }
+
+ return buf
+}