File tree 1 file changed +3
-9
lines changed 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 16
16
*
17
17
* @method applyToStringTag
18
18
*
19
- * @param {Class<* > } classObject a class such as Object, String, Number but
19
+ * @param {Class<any > } classObject a class such as Object, String, Number but
20
20
* typically one of your own creation through the class keyword; `class A {}`,
21
21
* for example.
22
22
*/
23
- export function applyToStringTag ( classObject : Class < * > ) : void {
24
- const symbolType : string = typeof Symbol ;
25
- const toStringTagType : string = typeof Symbol . toStringTag ;
26
-
27
- if ( symbolType === 'function' && toStringTagType === 'symbol' ) {
23
+ export default function applyToStringTag ( classObject : Class < any > ) : void {
24
+ if ( typeof Symbol === 'function' && Symbol . toStringTag ) {
28
25
Object . defineProperty ( classObject . prototype , Symbol . toStringTag , {
29
26
get ( ) {
30
27
return this . constructor . name ;
31
28
} ,
32
29
} ) ;
33
30
}
34
31
}
35
-
36
- /** Support both default export and named `applyToStringTag` export */
37
- export default applyToStringTag ;
You can’t perform that action at this time.
0 commit comments