Skip to content

Detect fat arrow functions #2

Closed

Description

@chapmanjacobd

Does not detect this style of function:

 const m = (num: number) => Number(num.toFixed(2));

Activity

  1. whyboris commented on Jun 11, 2020

    @whyboris
    Owner

    Thank you!

    At the moment I'm focusing on getting the visualization done.
    First draft: #1
    But I plan to add several more visualization types as well.

    Once that's ironed out I'll look into detecting fat arrow functions too 🤝

  2. chapmanjacobd commented on Jun 11, 2020

    @chapmanjacobd
    ContributorAuthor

    it's strange that it doesn't work... I would think that isFunctionDeclaration would detect arrowFunctions.

    maybe arrowFunctionExpression ??

    maybe this will help: https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/runtime/closure/parseFunction.ts

  3. whyboris commented on Jun 11, 2020

    @whyboris
    Owner

    I think there exists isArrowFunction and could simply be included in my check 🤔
    https://github.com/microsoft/TypeScript/blob/35c1ba67baac2fd5152908184f8b2ec565815942/lib/typescript.d.ts#L3648

  4. whyboris commented on Jun 11, 2020

    @whyboris
    Owner
  5. chapmanjacobd commented on Jun 12, 2020

    @chapmanjacobd
    ContributorAuthor
  6. chaofan-nirvana commented on Jul 16, 2020

    @chaofan-nirvana
    Contributor

    I tried my version of the issue, worked as my expectation.

    WarriorTrading@5d554a6

  7. whyboris commented on Jul 25, 2020

    @whyboris
    Owner

    Closed by #5 🎉
    Thank you to @WarriorTrading and @chaofan-nirvana and @chapmanjacobd 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions