@@ -142,25 +142,26 @@ MongooseBuffer.mixin = {
142
142
* Compile other Buffer methods marking this buffer as modified.
143
143
*/
144
144
145
- (
146
- // node < 0.5
147
- ( 'writeUInt8 writeUInt16 writeUInt32 writeInt8 writeInt16 writeInt32 ' +
148
- 'writeFloat writeDouble fill ' +
149
- 'utf8Write binaryWrite asciiWrite set ' +
150
-
151
- // node >= 0.5
152
- 'writeUInt16LE writeUInt16BE writeUInt32LE writeUInt32BE ' +
153
- 'writeInt16LE writeInt16BE writeInt32LE writeInt32BE ' + 'writeFloatLE writeFloatBE writeDoubleLE writeDoubleBE' )
154
- ) . split ( ' ' ) . forEach ( function ( method ) {
155
- if ( ! Buffer . prototype [ method ] ) {
156
- return ;
157
- }
158
- MongooseBuffer . mixin [ method ] = function ( ) {
159
- const ret = Buffer . prototype [ method ] . apply ( this , arguments ) ;
160
- this . _markModified ( ) ;
161
- return ret ;
162
- } ;
163
- } ) ;
145
+ utils . each (
146
+ [
147
+ // node < 0.5
148
+ 'writeUInt8' , 'writeUInt16' , 'writeUInt32' , 'writeInt8' , 'writeInt16' , 'writeInt32' ,
149
+ 'writeFloat' , 'writeDouble' , 'fill' ,
150
+ 'utf8Write' , 'binaryWrite' , 'asciiWrite' , 'set' ,
151
+
152
+ // node >= 0.5
153
+ 'writeUInt16LE' , 'writeUInt16BE' , 'writeUInt32LE' , 'writeUInt32BE' ,
154
+ 'writeInt16LE' , 'writeInt16BE' , 'writeInt32LE' , 'writeInt32BE' , 'writeFloatLE' , 'writeFloatBE' , 'writeDoubleLE' , 'writeDoubleBE' ]
155
+ , function ( method ) {
156
+ if ( ! Buffer . prototype [ method ] ) {
157
+ return ;
158
+ }
159
+ MongooseBuffer . mixin [ method ] = function ( ) {
160
+ const ret = Buffer . prototype [ method ] . apply ( this , arguments ) ;
161
+ this . _markModified ( ) ;
162
+ return ret ;
163
+ } ;
164
+ } ) ;
164
165
165
166
/**
166
167
* Converts this buffer to its Binary type representation.
0 commit comments