You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by mg...@apache.org on 2022/01/31 07:24:18 UTC

[avro] branch branch-1.11 updated: fix: Buffer is not defined in browser environment (#1473)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch branch-1.11
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/branch-1.11 by this push:
     new e2e1638  fix: Buffer is not defined in browser environment (#1473)
e2e1638 is described below

commit e2e1638c583af8c5a22122bfda392eafa19ad018
Author: ruleeeer <me...@ruleeeer.cn>
AuthorDate: Mon Jan 31 15:23:45 2022 +0800

    fix: Buffer is not defined in browser environment (#1473)
    
    (cherry picked from commit 91f289e1a69ca0f337a582401381759b12d3dc22)
---
 lang/js/etc/browser/avro.js | 3 ++-
 lang/js/lib/schemas.js      | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lang/js/etc/browser/avro.js b/lang/js/etc/browser/avro.js
index 2c4da58..b2b894e 100644
--- a/lang/js/etc/browser/avro.js
+++ b/lang/js/etc/browser/avro.js
@@ -30,7 +30,8 @@
 
 var Tap = require('../../lib/utils').Tap,
     schemas = require('../../lib/schemas'),
-    deprecated = require('../deprecated/validator');
+    deprecated = require('../deprecated/validator'),
+    Buffer = require('buffer').Buffer
 
 
 function parse(schema, opts) {
diff --git a/lang/js/lib/schemas.js b/lang/js/lib/schemas.js
index 5156221..cbf9e96 100644
--- a/lang/js/lib/schemas.js
+++ b/lang/js/lib/schemas.js
@@ -28,6 +28,7 @@ var utils = require('./utils'),
 // Convenience imports.
 var Tap = utils.Tap;
 var f = util.format;
+var Buffer = buffer.Buffer;
 
 // All Avro types.
 var TYPES = {