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 @@ -88,6 +88,21 @@ function fileExists(fileName) {
88
88
} ) ;
89
89
}
90
90
91
+ /**
92
+ * Transform all selerialized Buffer value in a Buffer value inside a json object
93
+ *
94
+ * @param {json } json with serialized Buffer value.
95
+ * @return {json } json with Buffer object.
96
+ */
97
+ function unmarshalBuffer ( json ) {
98
+ _ . forEach ( json , function ( value , key ) {
99
+ if ( value . type === "Buffer" ) {
100
+ json [ key ] = new Buffer ( value . data ) ;
101
+ }
102
+ } ) ;
103
+ return json ;
104
+ }
105
+
91
106
/**
92
107
* Scrapes seed files out of a given location. This file may contain
93
108
* either a simple json object, or an array of simple json objects. An array
@@ -101,9 +116,9 @@ function getSeedsAtLocation(location) {
101
116
102
117
// Ensure the output is an array
103
118
if ( Array . isArray ( result ) ) {
104
- return result ;
119
+ return _ . forEach ( result , unmarshalBuffer ) ;
105
120
} else {
106
- return [ result ] ;
121
+ return [ unmarshalBuffer ( result ) ] ;
107
122
}
108
123
}
109
124
You can’t perform that action at this time.
0 commit comments