All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.initializers.utils.customPostProcessors.js Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
import { LOWERCASED, LOWERCASED_GLOBAL_REGEX } from "../constants";
var sentenceCase = function sentenceCase(value) {
  return value.charAt(0).toLocaleUpperCase() + value.slice(1);
};
export var sentenceCaseProcessor = {
  type: "postProcessor",
  name: "sentenceCaseProcessor",
  process: function process(value) {
    var shouldSentenceCase = value.startsWith(LOWERCASED);
    value = value.replace(LOWERCASED_GLOBAL_REGEX, "");
    return shouldSentenceCase ? sentenceCase(value) : value;
  }
};
//# sourceMappingURL=customPostProcessors.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy