File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 1616 *
1717 * @method applyToStringTag
1818 *
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
2020 * typically one of your own creation through the class keyword; `class A {}`,
2121 * for example.
2222 */
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 ) {
2825 Object . defineProperty ( classObject . prototype , Symbol . toStringTag , {
2926 get ( ) {
3027 return this . constructor . name ;
3128 } ,
3229 } ) ;
3330 }
3431}
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