@onurege3467/zerohelper 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,6 +75,14 @@ function shuffleArray(array) {
75
75
  [array[currentIndex], array[randomIndex]] = [
76
76
  array[randomIndex], array[currentIndex]];
77
77
  }
78
+ return array;
79
+ }
80
+ function titleCase(sentence) {
81
+ return sentence
82
+ .toLowerCase()
83
+ .split(" ")
84
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1))
85
+ .join(" ");
78
86
  }
79
87
  module.exports = {
80
88
  makeUniqueId,
@@ -87,5 +95,6 @@ module.exports = {
87
95
  uuid,
88
96
  isUUID,
89
97
  },
90
- shuffleArray
98
+ shuffleArray,
99
+ titleCase
91
100
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onurege3467/zerohelper",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "node test.js"
package/readme.md CHANGED
@@ -18,6 +18,7 @@ console.log(functions.randomHex()) // returns a random hex code
18
18
  console.log(functions.randomNumber()) // returns random number
19
19
  console.log(functions.randomText()) // returns random text
20
20
  console.log(functions.shuffleArray([1,2,3,4,5,6,7,8,9,0])) // returns shuffled array like [3,5,2,1,7,6,8,9,0]
21
+ console.log(functions.titleCase("HellO tHis iS DEMO teXt")) // returns Hello This Is Demo Text
21
22
  ```
22
23
  ## Using ZeroHelper As Database
23
24
  ZeroHelper's database is divided into 3 parts.