@trenskow/caseit 1.2.0 → 1.3.2

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.
Files changed (2) hide show
  1. package/index.js +2 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -7,9 +7,7 @@ const separators = {
7
7
  'domain': '.',
8
8
  'kebab': '-',
9
9
  'title': ' ',
10
- 'http': '-',
11
- 'lower': '',
12
- 'upper': ''
10
+ 'http': '-'
13
11
  };
14
12
 
15
13
  const supported = Object.keys(separators).sort();
@@ -21,7 +19,6 @@ module.exports = exports = function(input, type = 'camel') {
21
19
  }
22
20
 
23
21
  const words = exports.words(input)
24
- .filter((key) => key.length)
25
22
  .map((key, idx) => {
26
23
  switch (type) {
27
24
  case 'camel':
@@ -37,12 +34,8 @@ module.exports = exports = function(input, type = 'camel') {
37
34
  // fallthrough
38
35
  case 'kebab':
39
36
  // fallthrough
40
- case 'lower':
41
- // fallthrough
42
37
  case 'snake':
43
38
  return key.toLowerCase();
44
- case 'upper':
45
- return key.toUpperCase();
46
39
  }
47
40
  });
48
41
 
@@ -52,6 +45,7 @@ module.exports = exports = function(input, type = 'camel') {
52
45
 
53
46
  exports.words = function(input) {
54
47
  return input.split(/(?=[A-Z])|_|-| |\./)
48
+ .filter((key) => key.length)
55
49
  .map((word) => word.toLowerCase());
56
50
  };
57
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/caseit",
3
- "version": "1.2.0",
3
+ "version": "1.3.2",
4
4
  "description": "Small library for converting between different casing.",
5
5
  "main": "index.js",
6
6
  "scripts": {