serverless-dynamodb-local
Advanced tools
Comparing version 0.2.21 to 0.2.22
@@ -184,3 +184,3 @@ "use strict"; | ||
const seedConfig = _.get(config, "seed", {}); | ||
const seed = this.options.seed; | ||
const seed = this.options.seed || config.start.seed; | ||
let categories; | ||
@@ -201,2 +201,5 @@ if (typeof seed === "string") { | ||
return new BbPromise((resolve, reject) => { | ||
if (migration.StreamSpecification && migration.StreamSpecification.StreamViewType) { | ||
migration.StreamSpecification.StreamEnabled = true; | ||
} | ||
dynamodb.raw.createTable(migration, (err) => { | ||
@@ -203,0 +206,0 @@ if (err) { |
{ | ||
"name": "serverless-dynamodb-local", | ||
"version": "0.2.21", | ||
"version": "0.2.22", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=4.0" |
@@ -92,2 +92,17 @@ "use strict"; | ||
/** | ||
* Transform all selerialized Buffer value in a Buffer value inside a json object | ||
* | ||
* @param {json} json with serialized Buffer value. | ||
* @return {json} json with Buffer object. | ||
*/ | ||
function unmarshalBuffer(json) { | ||
_.forEach(json, function(value, key) { | ||
if (value.type==="Buffer") { | ||
json[key]= new Buffer(value.data); | ||
} | ||
}); | ||
return json; | ||
} | ||
/** | ||
* Scrapes seed files out of a given location. This file may contain | ||
@@ -105,5 +120,5 @@ * either a simple json object, or an array of simple json objects. An array | ||
if (Array.isArray(result)) { | ||
return result; | ||
return _.forEach(result, unmarshalBuffer); | ||
} else { | ||
return [ result ]; | ||
return [ unmarshalBuffer(result) ]; | ||
} | ||
@@ -110,0 +125,0 @@ } |
26748
334