DefinitelyTyped/types/get-func-name/get-func-name-tests.ts
2018-12-31 08:18:54 -08:00

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