UNPKG

ks3

Version:

本代码库为`金山云存储KS3`服务.主要提供`KS3 nodejs SDK`和`命令行工具`.

19 lines (16 loc) 527 B
function testTagging(tagging, tagHeader){ console.log('tagging:', tagging, tagHeader) if(tagging && tagging.TagSet && tagging.TagSet.Tag){ let tag = Array.isArray(tagging.TagSet.Tag) ? tagging.TagSet.Tag : [tagging.TagSet.Tag] let tagStr = ''; tag.forEach((item, index)=>{ tagStr += item.Key + '=' + item.Value + (index === tag.length - 1 ? '' : '&'); }) return tagStr == tagHeader }else{ return !tagHeader; } } module.exports = { testTagging }