Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.replace(/ ?International/, '')
},
// e.g. 'Attribution-NonCommercial'
function (argument) {
return 'CC-' +
argument
.replace('Attribution', 'BY')
.replace('NonCommercial', 'NC')
.replace('NoDerivatives', 'ND')
.replace(/ (\d)/, '-$1')
.replace(/ ?International/, '') +
'-4.0'
}
]
var licensesWithVersions = spdxLicenseIds
.map(function (id) {
var match = /^(.*)-\d+\.\d+$/.exec(id)
return match
? [match[0], match[1]]
: [id, null]
})
.reduce(function (objectMap, item) {
var key = item[1]
objectMap[key] = objectMap[key] || []
objectMap[key].push(item[0])
return objectMap
}, {})
var licensesWithOneVersion = Object.keys(licensesWithVersions)
.map(function makeEntries (key) {
return [key, licensesWithVersions[key]]
.replace(/ ?International/, '')
},
// e.g. 'Attribution-NonCommercial'
function (argument) {
return 'CC-' +
argument
.replace('Attribution', 'BY')
.replace('NonCommercial', 'NC')
.replace('NoDerivatives', 'ND')
.replace(/ (\d)/, '-$1')
.replace(/ ?International/, '') +
'-4.0'
}
]
var licensesWithVersions = spdxLicenseIds
.map(function (id) {
var match = /^(.*)-\d+\.\d+$/.exec(id)
return match
? [match[0], match[1]]
: [id, null]
})
.reduce(function (objectMap, item) {
var key = item[1]
objectMap[key] = objectMap[key] || []
objectMap[key].push(item[0])
return objectMap
}, {})
var licensesWithOneVersion = Object.keys(licensesWithVersions)
.map(function makeEntries (key) {
return [key, licensesWithVersions[key]]
.replace(/ ?International/, '')
},
// e.g. 'Attribution-NonCommercial'
function (argument) {
return 'CC-' +
argument
.replace('Attribution', 'BY')
.replace('NonCommercial', 'NC')
.replace('NoDerivatives', 'ND')
.replace(/ (\d)/, '-$1')
.replace(/ ?International/, '') +
'-4.0'
}
]
var licensesWithVersions = spdxLicenseIds
.map(function (id) {
var match = /^(.*)-\d+\.\d+$/.exec(id)
return match
? [match[0], match[1]]
: [id, null]
})
.reduce(function (objectMap, item) {
var key = item[1]
objectMap[key] = objectMap[key] || []
objectMap[key].push(item[0])
return objectMap
}, {})
var licensesWithOneVersion = Object.keys(licensesWithVersions)
.map(function makeEntries (key) {
return [key, licensesWithVersions[key]]
.replace(/ ?International/, '')
},
// e.g. 'Attribution-NonCommercial'
function (argument) {
return 'CC-' +
argument
.replace('Attribution', 'BY')
.replace('NonCommercial', 'NC')
.replace('NoDerivatives', 'ND')
.replace(/ (\d)/, '-$1')
.replace(/ ?International/, '') +
'-4.0'
}
]
var licensesWithVersions = spdxLicenseIds
.map(function (id) {
var match = /^(.*)-\d+\.\d+$/.exec(id)
return match
? [match[0], match[1]]
: [id, null]
})
.reduce(function (objectMap, item) {
var key = item[1]
objectMap[key] = objectMap[key] || []
objectMap[key].push(item[0])
return objectMap
}, {})
var licensesWithOneVersion = Object.keys(licensesWithVersions)
.map(function makeEntries (key) {
return [key, licensesWithVersions[key]]