apius 0.0.9 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +11 -11
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,36 +1,36 @@
1
1
  import chalk from 'chalk'
2
2
  export default {
3
- log: (str, color, bold = false) => {
3
+ color: (str, color, bold = false) => {
4
4
  if(bold == false) {
5
- return console.log(chalk[color](str))
5
+ return chalk[color](str)
6
6
  } else if(bold == true) {
7
- return console.log(chalk[color].bold(str))
7
+ return chalk[color].bold(str)
8
8
  }
9
9
  },
10
10
 
11
- logRGB: (str, rgb, bold = false) => {
11
+ rgb: (str, rgb, bold = false) => {
12
12
  if(bold == false) {
13
13
  const requestRGB = chalk.rgb(...rgb)
14
- return console.log(requestRGB(str))
14
+ return requestRGB(str)
15
15
  } else if(bold == true) {
16
- return console.log(chalk.rgb(...rgb).bold(str))
16
+ return chalk.rgb(...rgb).bold(str)
17
17
  }
18
18
  },
19
19
 
20
- logHex: (str, hexCode, bold = false) => {
20
+ hex: (str, hexCode, bold = false) => {
21
21
  if(bold == false) {
22
22
  const requestHex = chalk.hex(hexCode)
23
- return console.log(requestHex(str))
23
+ return requestHex(str)
24
24
  } else if(bold == true) {
25
- return console.log(chalk.hex(hexCode).bold(str))
25
+ return chalk.hex(hexCode).bold(str)
26
26
  }
27
27
  },
28
28
 
29
- randomNumberGenerator: (min = 0, max = 100) => {
29
+ numberGenerator: (min = 0, max = 100) => {
30
30
  return Math.round(Math.random() * (max - min) + min)
31
31
  },
32
32
 
33
33
  randomArray: (arr) => {
34
- return [arr](Math.floor(Math.random() * arr.length))
34
+ return arr[Math.floor(Math.random() * arr.length)]
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apius",
3
- "version": "0.0.9",
3
+ "version": "0.1.2",
4
4
  "description": "A simple package.",
5
5
  "main": "index.js",
6
6
  "type": "module",