Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
unescape-unicode
Advanced tools
unescape-unicode is a Node.js library that can convert a Unicode escape ("\uxxxx" notation) into its corresponding Unicode character.
Install using npm
:
$ npm install --save unescape-unicode
You'll need to have at least Node.js 8 or newer.
unescapeUnicode(input[, start])
Converts the Unicode escape within input
.
The Unicode escape must be valid, although it can just contain hexadecimal segment. That is, it has to match the following pattern:
(\\u)?[0-9A-Fa-f]{4}
An error will be thrown if no valid Unicode escape is found.
Optionally, a start
index can be provided to begin conversion at a specific location within input
. If start
is not
specified, null
, or negative, the conversion will begin at the start of input
.
const unescapeUnicode = require('unescape-unicode');
unescapeUnicode('\\u2665');
//=> "♥"
unescapeUnicode('2665');
//=> "♥"
unescapeUnicode('I \\u2665 Unicode!', 2);
//=> "♥"
unescapeUnicode('\\u03bb');
//=> "λ"
unescapeUnicode('03BB');
//=> "λ"
If you have any problems with this library or would like to see changes currently in development you can do so here.
If you want to contribute, you're a legend! Information on how you can do so can be found in CONTRIBUTING.md. We want your suggestions and pull requests!
A list of contributors can be found in AUTHORS.md.
Copyright © 2018 Alasdair Mercer
See LICENSE.md for more information on our MIT license.
FAQs
Converts Unicode escapes
We found that unescape-unicode 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.