package.cjs.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.
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sentenceCaseProcessor = void 0;
var _constants = require("../constants");
var sentenceCase = function sentenceCase(value) {
return value.charAt(0).toLocaleUpperCase() + value.slice(1);
};
var sentenceCaseProcessor = exports.sentenceCaseProcessor = {
type: "postProcessor",
name: "sentenceCaseProcessor",
process: function process(value) {
var shouldSentenceCase = value.startsWith(_constants.LOWERCASED);
value = value.replace(_constants.LOWERCASED_GLOBAL_REGEX, "");
return shouldSentenceCase ? sentenceCase(value) : value;
}
};
//# sourceMappingURL=customPostProcessors.js.map