INNER CODE UNIT · JavaScript

BbPromise

99x/serverless-dynamodb-local · src/seeder.js:86

  return new BbPromise((resolve) => {
    fs.exists(fileName, (exists) => resolve(exists));
  });
}

/**
 * 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) {
    // Null check to prevent creation of Buffer when value is null
    if (value !== null && value.type==="Buffer") {
      json[key]= new Buffer(value.data);
    }
  });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…