index.js 724 B

123456789101112131415161718
  1. import { __assign } from "tslib";
  2. import { noCase } from "no-case";
  3. export function pascalCaseTransform(input, index) {
  4. var firstChar = input.charAt(0);
  5. var lowerChars = input.substr(1).toLowerCase();
  6. if (index > 0 && firstChar >= "0" && firstChar <= "9") {
  7. return "_" + firstChar + lowerChars;
  8. }
  9. return "" + firstChar.toUpperCase() + lowerChars;
  10. }
  11. export function pascalCaseTransformMerge(input) {
  12. return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
  13. }
  14. export function pascalCase(input, options) {
  15. if (options === void 0) { options = {}; }
  16. return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
  17. }
  18. //# sourceMappingURL=index.js.map