[Pkg-javascript-commits] [node-string-decoder] 04/27: added back Buffer as a require()

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 11 15:12:30 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-string-decoder.

commit a95cbd3eea2b29553f3757b71bedcff2bd8489d8
Author: Rod Vagg <rod at vagg.org>
Date:   Fri Jan 17 21:31:02 2014 +1100

    added back Buffer as a require()
---
 build/files.js | 7 +++++++
 index.js       | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/build/files.js b/build/files.js
index 9ef7564..24d4d60 100644
--- a/build/files.js
+++ b/build/files.js
@@ -7,6 +7,13 @@
  */
 
 module.exports['string_decoder.js'] = [
+
+    // pull in Bufer as a require
+    [
+        /^(\/\/ USE OR OTHER DEALINGS IN THE SOFTWARE\.)/m
+      , '$1\n\nvar Buffer = require(\'buffer\').Buffer;'
+    ]
+
 ]
 
 module.exports['string_decoder.js'].out = 'index.js'
\ No newline at end of file
diff --git a/index.js b/index.js
index 6b1e308..80edb05 100644
--- a/index.js
+++ b/index.js
@@ -19,6 +19,8 @@
 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 // USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+var Buffer = require('buffer').Buffer;
+
 function assertEncoding(encoding) {
   if (encoding && !Buffer.isEncoding(encoding)) {
     throw new Error('Unknown encoding: ' + encoding);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-string-decoder.git



More information about the Pkg-javascript-commits mailing list