mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
13 lines
314 B
TypeScript
13 lines
314 B
TypeScript
import getFuncName = require('get-func-name');
|
|
|
|
const unknownFunction = function myCoolFunction(word: string) {
|
|
return word + 'is cool';
|
|
};
|
|
|
|
const anonymousFunction = (() => {
|
|
return () => {};
|
|
})();
|
|
|
|
getFuncName(unknownFunction); // $ExpectType string
|
|
getFuncName(anonymousFunction); // $ExpectType string
|