UNPKG

@dipscope/type-manager

Version:

Transform JSON strings or plain objects into JS class instances.

21 lines 793 B
import { getWords } from '../functions/get-words'; var KebabUpperCaseNamingConvention = (function () { function KebabUpperCaseNamingConvention() { } KebabUpperCaseNamingConvention.prototype.convert = function (name) { return getWords(name).reduce(this.reduce, ''); }; KebabUpperCaseNamingConvention.prototype.reduce = function (result, word, index) { if (word.length === 0) { return result; } var wordUpperCased = word.toUpperCase(); if (index === 0) { return wordUpperCased; } return "".concat(result, "-").concat(wordUpperCased); }; return KebabUpperCaseNamingConvention; }()); export { KebabUpperCaseNamingConvention }; //# sourceMappingURL=kebab-upper-case-naming-convention.js.map