HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/inflected/src/camelize.js
import inflections from "./inflections";
import capitalize from "./capitalize";

export default function camelize(term, uppercaseFirstLetter) {
  if (uppercaseFirstLetter === null || uppercaseFirstLetter === undefined) {
    uppercaseFirstLetter = true;
  }

  let result = "" + term;

  if (uppercaseFirstLetter) {
    result = result.replace(/^[a-z\d]*/, function(a) {
      return inflections().acronyms[a] || capitalize(a);
    });
  } else {
    result = result.replace(
      new RegExp(
        "^(?:" + inflections().acronymRegex.source + "(?=\\b|[A-Z_])|\\w)"
      ),
      function(a) {
        return a.toLowerCase();
      }
    );
  }

  result = result.replace(/(?:_|(\/))([a-z\d]*)/gi, function(
    match,
    a,
    b,
    idx,
    string
  ) {
    a || (a = "");
    return "" + a + (inflections().acronyms[b] || capitalize(b));
  });

  return result;
}