futurGH / ts-to-jsdoc

Transpile TypeScript code to fully compatible JavaScript + JSDoc comments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arrow functions are not supported

weakish opened this issue · comments

Type info of parameters of arrow functions are stripped.

type Video = {
  id: string;
  // more fields
};

type Playlist = {
  videos: Video[];
};

const fetchPlaylist = async (
  playlistId: string,
): Promise<Playlist> => {
  // some code
};

will just be converted to

const fetchPlaylist = async (playlistId) => { /* code */}

However, if refactor fetchPlaylist to async function fetchPlaylist(),
ts-to-jsdoc will convert type infos to JSDoc successfully.

commented

Resolved by #24