package.initializers.utils.customPostProcessors.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
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