-
-
Notifications
You must be signed in to change notification settings - Fork 907
docs: improve README examples of lib/node_modules/@stdlib/constants/u… #2097
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,21 +22,33 @@ limitations under the License. | |
|
||
> Unicode constants. | ||
|
||
<section class="usage"> | ||
|
||
## Usage | ||
|
||
```javascript | ||
var constants = require( '@stdlib/constants/unicode' ); | ||
|
||
// Maximum Unicode code point: | ||
console.log( 'Maximum Unicode code point:', constants.MAX ); | ||
|
||
// Maximum Basic Multilingual Plane (BMP) code point: | ||
console.log( 'Maximum BMP code point:', constants.MAX_BMP ); | ||
Comment on lines
+29
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first code block is always the import. Please see other packages in the project. |
||
``` | ||
|
||
#### constants | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this change made? Where else in the project do we make the API heading level 2? |
||
## constants | ||
|
||
Namespace containing Unicode constants. | ||
|
||
```javascript | ||
var ns = constants; | ||
// returns {...} | ||
var constants = require( '@stdlib/constants/unicode' ); | ||
|
||
function isValidBmpCharacter( char ) { | ||
return char.codePointAt(0) <= constants.MAX_BMP; | ||
} | ||
|
||
// Check if a character is within the BMP: | ||
console.log( 'Is "𝔸" a BMP character?', isValidBmpCharacter('𝔸') ); // false | ||
console.log( 'Is "A" a BMP character?', isValidBmpCharacter('A') ); // true | ||
|
||
``` | ||
|
||
<!-- <toc pattern="*"> --> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?