index.js 1.0 KB

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.pascalCase = exports.pascalCaseTransformMerge = exports.pascalCaseTransform = void 0;
  4. var tslib_1 = require("tslib");
  5. var no_case_1 = require("no-case");
  6. function pascalCaseTransform(input, index) {
  7. var firstChar = input.charAt(0);
  8. var lowerChars = input.substr(1).toLowerCase();
  9. if (index > 0 && firstChar >= "0" && firstChar <= "9") {
  10. return "_" + firstChar + lowerChars;
  11. }
  12. return "" + firstChar.toUpperCase() + lowerChars;
  13. }
  14. exports.pascalCaseTransform = pascalCaseTransform;
  15. function pascalCaseTransformMerge(input) {
  16. return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
  17. }
  18. exports.pascalCaseTransformMerge = pascalCaseTransformMerge;
  19. function pascalCase(input, options) {
  20. if (options === void 0) { options = {}; }
  21. return no_case_1.noCase(input, tslib_1.__assign({ delimiter: "", transform: pascalCaseTransform }, options));
  22. }
  23. exports.pascalCase = pascalCase;
  24. //# sourceMappingURL=index.js.map