8000 added back Buffer as a require() · rvagg/archived-string_decoder@a95cbd3 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 5, 2018. It is now read-only.

Commit a95cbd3

Browse files
committed
added back Buffer as a require()
1 parent c355459 commit a95cbd3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

build/files.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
*/
88

99
module.exports['string_decoder.js'] = [
10+
11+
// pull in Bufer as a require
12+
[
13+
/^(\/\/ USE OR OTHER DEALINGS IN THE SOFTWARE\.)/m
14+
, '$1\n\nvar Buffer = require(\'buffer\').Buffer;'
15+
]
16+
1017
]
1118

1219
module.exports['string_decoder.js'].out = 'index.js'

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

22+
var Buffer = require('buffer').Buffer;
23+
2224
function assertEncoding(encoding) {
2325
if (encoding && !Buffer.isEncoding(encoding)) {
2426
throw new Error('Unknown encoding: ' + encoding);

0 commit comments

Comments
 (0)
0