Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
contains-chinese
Advanced tools
Checks whether the input string contains any Chinese text (at least one character). Works with Traditional and Simplified. Unlike the is-chinese package, returns `true` even if the string contains mixed Chinese and non-Chinese characters.
const containsChinese = require('contains-chinese');
let t = containsChinese('香港 is cool'); // true
let f = containsChinese('홍콩'); // false - not Chinese
This package provides a way to check whether a string contains any Chinese
text. The function will return true
if there is at least one Chinese
character in the string.
is-chinese
Another package called is-chinese
will return false if the string contains
at least one non-Chinese character, for example Welcome to 香港
will
result in false
.
In contrast, this package will return true
for such text containing mixed
Chinese and non-Chinese text.
containsChinese
- returns true
if the string has any Chinese characters.containsChinese.HAN_REGEX
- contains the regex used for this check.If you have any comments, contact me here: https://github.com/catcher-in-the-try/
FAQs
Checks whether the input string contains any Chinese text (at least one character). Works with Traditional and Simplified. Unlike the is-chinese package, returns `true` even if the string contains mixed Chinese and non-Chinese characters.
The npm package contains-chinese receives a total of 232 weekly downloads. As such, contains-chinese popularity was classified as not popular.
We found that contains-chinese demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.