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

Add TypeScript definition #1

Closed
wants to merge 7 commits into from

Conversation

coolreader18
Copy link

No description provided.

@sindresorhus
Copy link
Owner

Thanks for creating a TypeScript definition. 🙌 Can you follow this styleguide?

@coolreader18 coolreader18 changed the title Add typescript typings Add TypeScript definition Feb 14, 2019
* @param separator - The separator to split on.
* @returns The string split on the separator, if possible.
*/
declare function splitOnFirst(string: string, separator: string): [string, string?];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to declare. You can just export it directly.

*
* @param string - The string to split.
* @param separator - The separator to split on.
* @returns The string split on the separator, if possible.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unclear. It makes it seem it returns the string. Should be clearer.

@sindresorhus
Copy link
Owner

Ping :)

@sindresorhus
Copy link
Owner

Closing in favor of #4

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 this pull request may close these issues.

2 participants