1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | function maxLength(strs) {
|
10 | return strs.map(str => str.length).reduce((p, c) => Math.max(p, c), 0);
|
11 | }
|
12 | exports.maxLength = maxLength;
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | function pad(str, length, pad = " ") {
|
22 | if (length <= str.length) {
|
23 | return str;
|
24 | }
|
25 | if (pad === "") {
|
26 | throw new Error("pad can't to be empty string");
|
27 | }
|
28 | while (str.length < length) {
|
29 | str += pad;
|
30 | }
|
31 | return str;
|
32 | }
|
33 | exports.pad = pad;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | function kebabToLowerCamelCase(str) {
|
41 | let nextCamel = false;
|
42 | return str
|
43 | .split("")
|
44 | .map(char => {
|
45 | if (char === "-") {
|
46 | nextCamel = true;
|
47 | return "";
|
48 | }
|
49 | else if (nextCamel) {
|
50 | nextCamel = false;
|
51 | return char.toUpperCase();
|
52 | }
|
53 | else {
|
54 | return char;
|
55 | }
|
56 | })
|
57 | .join("");
|
58 | }
|
59 | exports.kebabToLowerCamelCase = kebabToLowerCamelCase;
|
60 |
|
\ | No newline at end of file |