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.
27 lines
392 B
27 lines
392 B
var common = function() {};
|
|
|
|
|
|
var die = common.die = function(err) {
|
|
if (err) {
|
|
console.error(err);
|
|
process.exit(1);
|
|
}
|
|
};
|
|
|
|
common.parseMN = function(MN) {
|
|
if (!MN)
|
|
die('No m-n parameter');
|
|
var mn = MN.split('-');
|
|
|
|
var m = parseInt(mn[0]);
|
|
var n = parseInt(mn[1]);
|
|
|
|
if (!m || ! n) {
|
|
die('Bad m-n parameter');
|
|
}
|
|
|
|
return [m, n];
|
|
};
|
|
|
|
|
|
module.exports = common;
|
|
|