7
7
* found in the LICENSE file at https://angular.io/license
8
8
*/
9
9
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
10
- exports . levenshtein = exports . capitalize = exports . underscore = exports . classify = exports . camelize = exports . dasherize = exports . decamelize = void 0 ;
10
+ exports . decamelize = decamelize ;
11
+ exports . dasherize = dasherize ;
12
+ exports . camelize = camelize ;
13
+ exports . classify = classify ;
14
+ exports . underscore = underscore ;
15
+ exports . capitalize = capitalize ;
16
+ exports . levenshtein = levenshtein ;
11
17
const STRING_DASHERIZE_REGEXP = / [ _ ] / g;
12
18
const STRING_DECAMELIZE_REGEXP = / ( [ a - z \d ] ) ( [ A - Z ] ) / g;
13
19
const STRING_CAMELIZE_REGEXP = / ( - | _ | \. | \s ) + ( .) ? / g;
@@ -30,7 +36,6 @@ const STRING_UNDERSCORE_REGEXP_2 = /-|\s+/g;
30
36
function decamelize ( str ) {
31
37
return str . replace ( STRING_DECAMELIZE_REGEXP , '$1_$2' ) . toLowerCase ( ) ;
32
38
}
33
- exports . decamelize = decamelize ;
34
39
/**
35
40
Replaces underscores, spaces, or camelCase with dashes.
36
41
@@ -48,7 +53,6 @@ exports.decamelize = decamelize;
48
53
function dasherize ( str ) {
49
54
return decamelize ( str ) . replace ( STRING_DASHERIZE_REGEXP , '-' ) ;
50
55
}
51
- exports . dasherize = dasherize ;
52
56
/**
53
57
Returns the lowerCamelCase form of a string.
54
58
@@ -71,7 +75,6 @@ function camelize(str) {
71
75
} )
72
76
. replace ( / ^ ( [ A - Z ] ) / , ( match ) => match . toLowerCase ( ) ) ;
73
77
}
74
- exports . camelize = camelize ;
75
78
/**
76
79
Returns the UpperCamelCase form of a string.
77
80
@@ -93,7 +96,6 @@ function classify(str) {
93
96
. map ( ( part ) => capitalize ( camelize ( part ) ) )
94
97
. join ( '' ) ;
95
98
}
96
- exports . classify = classify ;
97
99
/**
98
100
More general than decamelize. Returns the lower_case_and_underscored
99
101
form of a string.
@@ -115,7 +117,6 @@ function underscore(str) {
115
117
. replace ( STRING_UNDERSCORE_REGEXP_2 , '_' )
116
118
. toLowerCase ( ) ;
117
119
}
118
- exports . underscore = underscore ;
119
120
/**
120
121
Returns the Capitalized form of a string
121
122
@@ -133,7 +134,6 @@ exports.underscore = underscore;
133
134
function capitalize ( str ) {
134
135
return str . charAt ( 0 ) . toUpperCase ( ) + str . slice ( 1 ) ;
135
136
}
136
- exports . capitalize = capitalize ;
137
137
/**
138
138
* Calculate the levenshtein distance of two strings.
139
139
* See https://en.wikipedia.org/wiki/Levenshtein_distance.
@@ -176,4 +176,3 @@ function levenshtein(a, b) {
176
176
}
177
177
return matrix [ b . length ] [ a . length ] ;
178
178
}
179
- exports . levenshtein = levenshtein ;
0 commit comments