Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit 54eba03

Browse files
committed
binary encoding in the browser
1 parent 213e989 commit 54eba03

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/util.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ var extend = require('xtend')
5252
, buffer : false
5353
, type : 'json'
5454
}
55+
encodings.binary = {
56+
encode : function (data) {
57+
return isBinary(data) ? data : new Buffer(data)
58+
}
59+
, decode : function (data) {
60+
return data
61+
}
62+
, buffer : true
63+
, type : 'binary'
64+
}
5565
encodingNames.forEach(function (type) {
5666
if (encodings[type])
5767
return

0 commit comments

Comments
 (0)