@trenskow/caseit 1.1.2 → 1.1.3

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 +4 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -10,12 +10,12 @@ const separators = {
10
10
  'http': '-'
11
11
  };
12
12
 
13
- const supported = Object.keys(separators);
13
+ const supported = Object.keys(separators).sort();
14
14
 
15
15
  module.exports = exports = function(input, type = 'camel') {
16
16
 
17
17
  if (!supported.includes(type)) {
18
- throw new TypeError('Type must either be `camel`, `pascal`, `snake`, `domain`, `kebab`, `title`, `http`.');
18
+ throw new TypeError(`Type must either be ${supported.slice(0, -1).join(', ')} or ${supported.slice(-1)[0]}.`);
19
19
  }
20
20
 
21
21
  const words = exports.words(input)
@@ -53,3 +53,5 @@ exports.detect = function(input) {
53
53
  return supported
54
54
  .filter((type) => exports(input, type) === input);
55
55
  };
56
+
57
+ exports.supported = supported;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/caseit",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Small library for converting between different casing.",
5
5
  "main": "index.js",
6
6
  "scripts": {