in source/lambda/requestArchives/lib/filenameparser.js [41:68]
function detectAndParseDescription(archiveDescription) {
// [ FAST GLACIER v 2,3,4 ]
if (archiveDescription.match(/<m>.*<\/m>/m)) {
return parseFastGlacier(archiveDescription, 'm', 'p')
}
// [ FAST GLACIER v 1 ]
if (archiveDescription.match(/<ArchiveMetadata>.*<\/ArchiveMetadata>/m)) {
return parseFastGlacier(archiveDescription, 'ArchiveMetadata', 'Path')
}
// [ JSON ]
if (archiveDescription.match(/{\s*\\*\".*}\s*/)) {
try {
let jsonObject = JSON.parse(archiveDescription)
if (typeof jsonObject === 'string')
jsonObject = JSON.parse(jsonObject)
// [ CLOUD BERRY ]
if (jsonObject.hasOwnProperty('Path')) return jsonObject.Path
} catch (err) {
console.warn(`Failed to parse JSON: ${archiveDescription}`)
console.warn(`Err: ${err}`)
}
}
return archiveDescription
}