From 6be7b8de60d3e1f060cbfb8d5829aa3515e6e6db Mon Sep 17 00:00:00 2001 From: Dan Aprahamian Date: Thu, 7 Mar 2019 10:45:23 -0500 Subject: [PATCH] fix(Buffer): import buffer for binary, decimal128, and fnv1a Fixes NODE-1891 --- lib/binary.js | 2 ++ lib/decimal128.js | 1 + lib/fnv1a.js | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/binary.js b/lib/binary.js index b12b6154..d6abf9cc 100644 --- a/lib/binary.js +++ b/lib/binary.js @@ -1,5 +1,7 @@ 'use strict'; +const Buffer = require('buffer').Buffer; + /** * A class representation of the BSON Binary type. */ diff --git a/lib/decimal128.js b/lib/decimal128.js index d4a285c6..ac816a90 100644 --- a/lib/decimal128.js +++ b/lib/decimal128.js @@ -1,6 +1,7 @@ 'use strict'; let Long = require('./long'); +const Buffer = require('buffer').Buffer; const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; diff --git a/lib/fnv1a.js b/lib/fnv1a.js index d8c5bbbb..a26ac7ab 100644 --- a/lib/fnv1a.js +++ b/lib/fnv1a.js @@ -1,5 +1,6 @@ 'use strict'; +const Buffer = require('buffer').Buffer; const Long = require('./long'); const MASK_8 = 0xff;