File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
function camelCase ( str ) {
4
- return str . replace ( / [ \w - ] + / g, ( s ) =>
5
- / ^ - ? [ a - z ] + (?: - [ a - z ] + ) + $ / . test ( s )
4
+ return str . replace ( / [ \w - ] + / g, ( s ) => {
5
+ return / ^ - ? [ a - z ] + (?: - [ a - z ] + ) + $ / . test ( s )
6
6
? s
7
7
. replace ( / ^ - ( m s | m o z | k h t m l | e p u b | ( \w + - ? ) * w e b k i t ) (? = - ) / i, '$1' )
8
8
. replace ( / - \w / g, ( uncasedStr ) => uncasedStr [ 1 ] . toUpperCase ( ) )
9
- : s ,
10
- ) ;
9
+ : s ;
10
+ } ) ;
11
11
}
12
12
13
13
module . exports = camelCase ;
Original file line number Diff line number Diff line change 54
54
],
55
55
"rules" : {
56
56
"array-callback-return" : " off" ,
57
- "no-confusing-arrow" : " off" ,
58
57
"prefer-object-spread" : " off" ,
59
58
"prefer-rest-params" : " off" ,
60
59
"prefer-spread" : " off" ,
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
function unCamelCase ( str ) {
4
- return str . replace ( / [ \w - ] + / g, ( s ) =>
5
- / ^ [ A - Z ] ? [ a - z ] * (?: [ A - Z ] [ a - z ] * ) + $ / . test ( s )
4
+ return str . replace ( / [ \w - ] + / g, ( s ) => {
5
+ return / ^ [ A - Z ] ? [ a - z ] * (?: [ A - Z ] [ a - z ] * ) + $ / . test ( s )
6
6
? s
7
7
. replace ( / [ A - Z ] / g, ( casedStr ) => `-${ casedStr . toLowerCase ( ) } ` )
8
8
. replace ( / ^ ( o | m s | m o z | k h t m l | e p u b | ( \w + - ? ) * w e b k i t ) (? = - ) / i, '-$1' )
9
- : s ,
10
- ) ;
9
+ : s ;
10
+ } ) ;
11
11
}
12
12
13
13
module . exports = unCamelCase ;
You can’t perform that action at this time.
0 commit comments