File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,27 @@ function getSeedsAtLocation(location) {
101
101
102
102
// Ensure the output is an array
103
103
if ( Array . isArray ( result ) ) {
104
- return result ;
104
+ return _ . forEach ( result , unmarshalBuffer ) ;
105
105
} else {
106
- return [ result ] ;
106
+ return [ unmarshalBuffer ( result ) ] ;
107
107
}
108
108
}
109
109
110
+ /**
111
+ * Transform all selerialized Buffer value in a Buffer value inside a json object
112
+ *
113
+ * @param {json } json with serialized Buffer value.
114
+ * @return {json } json with Buffer object.
115
+ */
116
+ function unmarshalBuffer ( json ) {
117
+ _ . forEach ( json , function ( value , key ) {
118
+ if ( value . type === 'Buffer' ) {
119
+ json [ key ] = new Buffer ( value . data ) ;
120
+ }
121
+ } ) ;
122
+ return json ;
123
+ }
124
+
110
125
/**
111
126
* Locates seeds given a set of files to scrape
112
127
* @param {string[] } sources The filenames to scrape for seeds
You can’t perform that action at this time.
0 commit comments