"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.deSlug = exports.spaceAndCapitalize = exports.unCapitalize = exports.capitalize = void 0;

const capitalize = str => !str ? '' : str.slice(0, 1).toUpperCase() + str.slice(1);

exports.capitalize = capitalize;

const unCapitalize = str => !str ? '' : str.slice(0, 1).toLowerCase() + str.slice(1);

exports.unCapitalize = unCapitalize;

const spaceAndCapitalize = str => {
  const words = str.split(/(?=[A-Z])/);
  return words.map((word, index) => index === 0 ? capitalize(word) : unCapitalize(word)).join(' ');
};

exports.spaceAndCapitalize = spaceAndCapitalize;

const deSlug = str => !str ? '' : str.replace(/-/g, ' ');

exports.deSlug = deSlug;