@8ms/helpers 1.3.23 → 1.3.24

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.3.23",
4
+ "version": "1.3.24",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
5
5
  * https://stackoverflow.com/a/196991/2664955
6
6
  */
7
7
  const getCapitalised = ({ input, split }) => {
8
- const splitToken = split || '_';
8
+ const regex = new RegExp(split || '_', 'g');
9
9
  return input
10
- .replace(`/${splitToken}/g`, ' ')
10
+ .replace(regex, ' ')
11
11
  .replace(/\w\S*/g, function (txt) {
12
12
  return txt.charAt(0)
13
13
  .toUpperCase() + txt.substr(1)