@@ -35,7 +35,7 @@ const flattenTokenCache = new WeakMap<any, string>();
35
35
/**
36
36
* Flatten token to string, this will auto cache the result when token not change
37
37
*/
38
- export function flattenToken ( token : any , hashed : boolean = false ) {
38
+ export function flattenToken ( token : any ) {
39
39
let str = flattenTokenCache . get ( token ) || '' ;
40
40
41
41
if ( ! str ) {
@@ -45,17 +45,15 @@ export function flattenToken(token: any, hashed: boolean = false) {
45
45
if ( value instanceof Theme ) {
46
46
str += value . id ;
47
47
} else if ( value && typeof value === 'object' ) {
48
- str += flattenToken ( value , hashed ) ;
48
+ str += flattenToken ( value ) ;
49
49
} else {
50
50
str += value ;
51
51
}
52
52
} ) ;
53
53
54
54
// https://github.com/ant-design/ant-design/issues/48386
55
55
// Should hash the string to avoid style tag name too long
56
- if ( hashed ) {
57
- str = hash ( str ) ;
58
- }
56
+ str = hash ( str ) ;
59
57
60
58
// Put in cache
61
59
flattenTokenCache . set ( token , str ) ;
@@ -67,7 +65,7 @@ export function flattenToken(token: any, hashed: boolean = false) {
67
65
* Convert derivative token to key string
68
66
*/
69
67
export function token2key ( token : any , salt : string ) : string {
70
- return hash ( `${ salt } _${ flattenToken ( token , true ) } ` ) ;
68
+ return hash ( `${ salt } _${ flattenToken ( token ) } ` ) ;
71
69
}
72
70
73
71
const randomSelectorKey = `random-${ Date . now ( ) } -${ Math . random ( ) } ` . replace (
0 commit comments