This repository was archived by the owner on Dec 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ module.exports = (function () {
2323 }
2424
2525 var encodings = { }
26+
2627 encodings . utf8 = encodings [ 'utf-8' ] = {
2728 encode : function ( data ) {
2829 return isBinary ( data ) ? data : String ( data )
@@ -31,12 +32,14 @@ module.exports = (function () {
3132 , buffer : false
3233 , type : 'utf8'
3334 }
35+
3436 encodings . json = {
3537 encode : JSON . stringify
3638 , decode : JSON . parse
3739 , buffer : false
3840 , type : 'json'
3941 }
42+
4043 encodings . binary = {
4144 encode : function ( data ) {
4245 return isBinary ( data ) ? data : new Buffer ( data )
@@ -51,6 +54,7 @@ module.exports = (function () {
5154 encodingNames . forEach ( function ( type ) {
5255 if ( encodings [ type ] )
5356 return
57+
5458 encodings [ type ] = {
5559 encode : function ( data ) {
5660 return isBinary ( data ) ? data : new Buffer ( data , type )
@@ -62,6 +66,7 @@ module.exports = (function () {
6266 , type : type // useful for debugging purposes
6367 }
6468 } )
69+
6570 return encodings
6671} ) ( )
6772
You can’t perform that action at this time.
0 commit comments