Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
aInnerCallback(new statusError({
message: '`@license` must match in UserScript and UserLibrary metadata blocks.',
code: 400
}), null);
return;
}
if (!isLib) {
userKeyset = masterKeyset;
} else {
userKeyset = slaveKeyset;
}
if (userKeyset) {
thatSPDX = userKeyset[userKeyset.length - 1].split('; ')[0];
if (SPDX.indexOf(thatSPDX) === -1 || blockSPDX.indexOf(thatSPDX) > -1) {
// No valid OSI primary e.g. last key... reject
aInnerCallback(new statusError({
message: '`@license` is not OSI primary and compatible in the metadata block(s).',
code: 400
}), null);
return;
}
for (i = 0; userKey = userKeyset[i++];) {
thisKeyComponents = userKey.split('; ');
if (thisKeyComponents.length > 2) {
// Too many parts... reject
aInnerCallback(new statusError({
message: '`@license` has too many parts in the metadata block(s).',
code: 400
}), null);
function tokenTypeForString (string, start) {
if (ids.indexOf(string) !== -1) {
return 'LICENSE'
} else if (string === 'AND') {
return 'AND'
} else if (string === 'OR') {
return 'OR'
} else if (string === 'WITH') {
return 'WITH'
} else if (exceptions.indexOf(string) !== -1) {
return 'EXCEPTION'
} else if (LICENSEREF.test(string)) {
return 'LICENSEREF'
} else if (DOCUMENTREF.test(string)) {
return 'DOCUMENTREF'
} else if (string === '(') {
return 'OPEN'
} else if (string === ')') {
function valid(string) {
return licenseIDs.indexOf(string) > -1;
}
function valid(string) {
return licenseIDs.indexOf(string) > -1;
}