Add TypeScript definition#6
Merged
sindresorhus merged 1 commit intosindresorhus:masterfrom Mar 18, 2019
BendingBender:typescript-defs
Merged
Add TypeScript definition#6sindresorhus merged 1 commit intosindresorhus:masterfrom BendingBender:typescript-defs
sindresorhus merged 1 commit intosindresorhus:masterfrom
BendingBender:typescript-defs
Conversation
| Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms). | ||
|
|
||
| @param input - [Code point](https://en.wikipedia.org/wiki/Code_point) of a character. | ||
| */ |
Owner
There was a problem hiding this comment.
Can you include the example from the readme here when creating these definitions (with changed import statement of course)? Usually examples are the best documentation, and without, it's harder to use them.
| import {expectType} from 'tsd-check'; | ||
| import isFullwidthCodePoint from '.'; | ||
|
|
||
| const codePoint = '谢'.codePointAt(0) as number; |
Owner
There was a problem hiding this comment.
I prefer ! and find it more readable, as it makes it clear it's only about removing undefined instead of as which could change the type completely.
Suggested change
| const codePoint = '谢'.codePointAt(0) as number; | |
| const codePoint = '谢'.codePointAt(0)!; |
Owner
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.