@hestia-earth/utils 0.11.2 → 0.11.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.
package/dist/number.js CHANGED
@@ -27,7 +27,7 @@ exports.convertValue = exports.converters = exports.ConvertUnits = exports.toCom
27
27
  var isNumber = function (n) {
28
28
  var _a;
29
29
  return [
30
- (_a = /^(-)?[\d\.]+(e|e-)?[\d]+$/.exec(("" + n))) === null || _a === void 0 ? void 0 : _a.length,
30
+ (_a = /^(-)?[\d\.]+((e|e-)[\d]+)?$/.exec("" + n)) === null || _a === void 0 ? void 0 : _a.length,
31
31
  !isNaN(parseFloat("" + n)),
32
32
  isFinite(parseFloat("" + n))
33
33
  ].every(Boolean);
package/dist/string.js CHANGED
@@ -37,10 +37,10 @@ var toDashCase = function (value) {
37
37
  }
38
38
  return (args[0] + "-" + args[1]).toLowerCase();
39
39
  })
40
+ // handle words followed by numbers
41
+ .replace(/([A-Z][a-z]+)([0-9]{2,})/g, '$1-$2')
40
42
  // handle all capital letters
41
43
  .replace(/([A-Z])/g, function (g) { return "-" + g[0].toLowerCase(); })
42
- // handle years
43
- .replace(/([0-9]{4})/g, function (g) { return "-" + g; })
44
44
  // handle underscores
45
45
  .replace(/[\_\.]/g, '-')
46
46
  : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/utils",
3
- "version": "0.11.2",
3
+ "version": "0.11.3",
4
4
  "description": "Hestia Utils library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",