You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
venv/PyCharm 2025.2.1.1/plugins/javascript-plugin/helpers/package-version-range-matcher/bin/batch-matcher

32 lines
783 B

#!/usr/bin/env node
var matcher = require('../semver-range-matcher');
function getRequests() {
var result = [];
var argv = process.argv.slice(2);
for (var i = 0; i < argv.length; i++) {
if (argv[i] !== '--package') {
console.error('Unexpected option ' + argv[i]);
process.exit(1);
}
if (i + 3 < argv.length) {
result.push({
packageName: argv[i + 1],
versionRange: argv[i + 2],
version: argv[i + 3]
});
i += 3;
}
else {
console.error('Too few parameters after position ' + i + ': ' + JSON.stringify(argv));
process.exit(1);
}
}
return result;
}
var requests = getRequests();
var responses = matcher.match(requests);
process.stdout.write(JSON.stringify(responses, null, 2) + '\n');