@itwithlyam/aco
Version:
The A.CO. JS package
58 lines (43 loc) • 2.19 kB
JavaScript
module.exports.description = function describe() {
return "A. CO. is a place for everyone to enjoy fun, technology and life in general.";
};
module.exports.ADT = function ADTcredits() {
return "Our ADT (ACO Server Developer Team) consists of The Developer (tech admin), Mr Good (tech admin), Chaseyy, AESTHETIC, Airbus A330-200, MeNotRudie, SpoOp_xj and of course Ayaan the CEO. They deal with bots and ACO systems.";
};
module.exports.ACEIT = function ACEITcredits() {
return "Our ACEIT (ACO Server Emergency Investigation Response Team) consists of Ayaan (CEO), ._Quack_., Chad, Chaseyy and Mιrαвєℓℓιєr. They deal with server-wide security and emergency investigations.";
};
function isInt(value) {
return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10));
}
module.exports.calculate = function calculator(num1, num2, func) {
if (!isInt(num1) || !isInt(num2) || typeof func !== "string") throw new TypeError("ACO module wants: massive.calculate(num1, num2, function)");
if (func === 'add') return console.log(num1 + num2);
if (func === 'subtract') return console.log(num1 - num2);
if (func === 'divide') return console.log(num1 / num2);
if (func === 'multiply') return console.log(num1 * num2);
throw new TypeError("Please use the functions add, subtract, multiply or divide.");
};
module.exports.small = function tiny(string) {
if (typeof string !== "string") throw new TypeError("ACO module wants a string!");
return string.replace(/\s/g, "");
};
module.exports.big = function upper(string) {
if (typeof string !== "string") throw new TypeError("ACO module wants a string!");
return string.toUpperCase();
};
/*
const aco = require('@itwithlyam/aco');
aco.calculate(1, 1, add);
// returns 2
const upper = aco.big('I like soup');
// returns I LIKE SOUP
const nospace = aco.small('no spaces please');
// returns nospacesplease
const adtcreds = aco.ADT();
// returns the adt credits list
const aceitcreds = aco.ACEIT();
// returns the ACEIT credits list
const acodescr = aco.description();
// returns the ACO description
*/