* Build the state of the master version from its object metadata * * @param {object} objMD - object metadata parsed from JSON * * @return {object} state of master version, with the following attributes: * - {boolean} exists - true if the object exists (i.e. if `objMD` is truish) * - {string} v
(objMD)
| 296 | * - {array} objLocation - array of data locations |
| 297 | */ |
| 298 | function getMasterState(objMD) { |
| 299 | if (!objMD) { |
| 300 | return {}; |
| 301 | } |
| 302 | |
| 303 | const mst = { |
| 304 | exists: true, |
| 305 | versionId: objMD.versionId, |
| 306 | uploadId: objMD.uploadId, |
| 307 | isNull: objMD.isNull, |
| 308 | isNull2: objMD.isNull2, |
| 309 | nullVersionId: objMD.nullVersionId, |
| 310 | nullUploadId: objMD.nullUploadId, |
| 311 | }; |
| 312 | |
| 313 | if (objMD.location) { |
| 314 | mst.objLocation = Array.isArray(objMD.location) ? |
| 315 | objMD.location : [objMD.location]; |
| 316 | } |
| 317 | |
| 318 | return mst; |
| 319 | } |
| 320 | /** versioningPreprocessing - return versioning information for S3 to handle |
| 321 | * creation of new versions and manage deletion of old data and metadata |
| 322 | * @param {string} bucketName - name of bucket |
no outgoing calls
no test coverage detected