MCPcopy Index your code
hub / github.com/scality/cloudserver / decodeVID

Function decodeVID

lib/api/apiUtils/object/versioning.js:21–39  ·  view source on GitHub ↗

decodeVID - decode the version id * @param {string} versionId - version ID * @return {(Error|string|undefined)} - return Invalid Argument if decryption * fails due to improper format, otherwise undefined or the decoded version id

(versionId)

Source from the content-addressed store, hash-verified

19 * fails due to improper format, otherwise undefined or the decoded version id
20 */
21function decodeVID(versionId) {
22 if (versionId === 'null') {
23 return versionId;
24 }
25
26 let decoded;
27 const invalidErr = errorInstances.InvalidArgument.customizeDescription('Invalid version id specified');
28 try {
29 decoded = versionIdUtils.decode(versionId);
30 } catch {
31 return invalidErr;
32 }
33
34 if (decoded instanceof Error) {
35 return invalidErr;
36 }
37
38 return decoded;
39}
40
41/** decodeVersionId - decode the version id from a query object
42 * @param {object} [reqQuery] - request query object

Callers 5

objectPutFunction · 0.85
objectCopyFunction · 0.85
completeMultipartUploadFunction · 0.85
createAndStoreObjectFunction · 0.85
decodeVersionIdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected