Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript support #4

Closed
leaumar opened this issue Nov 25, 2020 · 3 comments · Fixed by #5
Closed

Typescript support #4

leaumar opened this issue Nov 25, 2020 · 3 comments · Fixed by #5

Comments

@leaumar
Copy link

leaumar commented Nov 25, 2020

I tried to use this library in my typescript project but it lacks included type mappings and is not included in DefinitelyTyped either.

I wrote the following .d.ts myself for my project and compared it to forwarded-parse's behavior, it appears to be a good match.

Please include it in your project. I believe just adding index.d.ts to the files root is all it takes, but I'm no expert on publishing typed libraries.

declare module "forwarded-parse" {
    export interface Entry {
        by?: string;
        for?: string;
        host?: string;
        proto?: string;
    }

    export default function parseForwarded(forwarded: string): Entry[];
}
@lpinca
Copy link
Owner

lpinca commented Nov 25, 2020

Please open a PR on the DefinitelyTyped repository. I don't want to maintain TypeScript type definitions.

@leaumar
Copy link
Author

leaumar commented Nov 25, 2020

All that overhead for 1 function that hasn't changed in 3 years and probably never will? :/

lpinca added a commit that referenced this issue Nov 26, 2020
lpinca added a commit that referenced this issue Nov 26, 2020
lpinca added a commit that referenced this issue Nov 26, 2020
@lpinca lpinca closed this as completed in #5 Nov 26, 2020
lpinca added a commit that referenced this issue Nov 26, 2020
@leaumar
Copy link
Author

leaumar commented Nov 26, 2020

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants