Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-4byte-code-point

shinnn5.2kMIT1.0.0

Check if a given number is a code point of UTF-8 4-byte character

byte, check, string, char, character, code, point, code-point, count, number, browser, client-side

readme

is-4byte-code-point

NPM version Bower version Build Status Coverage Status Dependency Status Dependency Status

Check if a given number is a code point of UTF-8 4-byte character

import is4byteCodePoint from 'is-4byte-code-point';

is4byteCodePoint('A'.codePointAt(0)); //=> false
is4byteCodePoint('👍'.codePointAt(0)); //=> true

Installation

npm

npm install is-4byte-code-point

Bower

bower install is-4byte-code-point

is4byteCodePoint(number)

number: Number
Return: Boolean

It returns true if the number is no fewer than 65536 and no greater than 1114111, otherwise false.

is4byteCodePoint(-1); //=> false
is4byteCodePoint(0); //=> false
is4byteCodePoint(100000); //=> true
is4byteCodePoint(1000000); //=> false
is4byteCodePoint(NaN); //=> false
is4byteCodePoint(Infinity); //=> false

License

Copyright (c) 2016 Shinnosuke Watanabe

Licensed under the MIT License.