sv443.js
Advanced tools
Comparing version 1.0.2 to 1.0.4
82
index.js
class Sv { | ||
constructor(options = {}) { | ||
/** | ||
* Create a new instance of Sv | ||
* @param {int} height | ||
* @param {int} weight | ||
* @param {int} gay | ||
* @param {int} age | ||
* @param {int|string} name | ||
*/ | ||
constructor(options) { | ||
if(options.height && isNaN(options.height) || options.weight && isNaN(options.weight) || options.gay && isNaN(options.gay) || options.age && isNaN(options.age)) { | ||
@@ -10,56 +18,86 @@ throw new Error('Sv options must be integers') | ||
this.gay = options.gay ? options.gay : 100 | ||
this.age = options.age ? options.age : 16 | ||
this.age = options.age ? options.age : 17 | ||
this.name = options.name ? options.name : 'Sven' | ||
} | ||
addGay(lvl) { | ||
return this.gay += lvl | ||
/** | ||
* @param {int} a | ||
*/ | ||
addGay(a) { | ||
return this.gay += a | ||
} | ||
addHeight(h) { | ||
return this.height += h | ||
/** | ||
* @param {int} a | ||
*/ | ||
addHeight(a) { | ||
return this.height += a | ||
} | ||
addWeight(w) { | ||
return this.weight += w | ||
/** | ||
* @param {int} a | ||
*/ | ||
addWeight(a) { | ||
return this.weight += a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
addAge(a) { | ||
return this.age += a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
subGay(a) { | ||
return this.gay -= a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
subHeight(a) { | ||
return this.height -= a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
subWeight(a) { | ||
return this.weight -= a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
subAge(a) { | ||
return this.age -= a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
setGay(a) { | ||
return this.gay = a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
setHeight(a) { | ||
return this.height = a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
setWeight(a) { | ||
return this.weight = a | ||
} | ||
/** | ||
* @param {int} a | ||
*/ | ||
setAge(a) { | ||
return this.age = a | ||
} | ||
/** | ||
* @param {string} a | ||
*/ | ||
setName(a) { | ||
return this.name = a | ||
} | ||
} | ||
module.exports.Sv = Sv |
{ | ||
"name": "sv443.js", | ||
"version": "1.0.2", | ||
"version": "1.0.4", | ||
"description": "Create your own Sv!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,3 +15,4 @@ # sv443.js is a node package that allows you to create your very own Sv! | ||
gay: 100, // a measure of Sv's gay level, scale is determined by you | ||
age: 16 | ||
age: 16, | ||
name: 'Sven' | ||
} | ||
@@ -33,4 +34,4 @@ | ||
// age manipulation | ||
console.log(succ.age) // expected output: 16, the default age | ||
console.log(succ.addAge(4)) // expected output: 20 | ||
console.log(succ.age) // expected output: 17, the default age | ||
console.log(succ.addAge(4)) // expected output: 21 | ||
console.log(succ.setAge(16)) // expected output: 16 | ||
@@ -51,3 +52,3 @@ console.log(succ.subAge(4)) // expected output: 12 | ||
//gay level manipulation | ||
// gay level manipulation | ||
console.log(succ.gay) // expected output: 100 | ||
@@ -57,2 +58,6 @@ console.log(succ.addGay(4)) // expected output: 104 | ||
console.log(succ.subGay(4)) // expected output: 96 | ||
// name manipulation | ||
console.log(succ.name) // expected output: Sven | ||
console.log(succ.setName('Big Boi')) // expected output: Big Boi | ||
``` |
4265
98
59
3