
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Unicode-aware JS string splitting with full Emoji support.
Split a string into its constituent characters, without munging emoji and other non-BMP code points.
this is typescript version fork form runes
The native String#split
implementation does not pay attention to surrogate pairs. When the code units of a surrogate pair are split apart, they are not intelligible on their own. Unless they are put back together in the correct order, individual code units will cause problems in code that handles strings.
$ npm install runes2
const runes = require('runes2').default
const runes = require('runes2').runes
import runes from 'runes2';
import { runes } from 'runes2';
// Standard String.split
'♥️'.split('') // => ['♥', '️']
'Emoji 🤖'.split('') // => ['E', 'm', 'o', 'j', 'i', ' ', '�', '�']
'👩👩👧👦'.split('') // => ['�', '�', '', '�', '�', '', '�', '�', '', '�', '�']
// ES6 string iterator
[
...
'♥️'
] =>
['♥', '️']
[
...
'Emoji 🤖'
] // => [ 'E', 'm', 'o', 'j', 'i', ' ', '🤖' ]
[...'👩👩👧👦'] // => [ '👩', '', '👩', '', '👧', '', '👦' ]
// Runes
runes('♥️') // => ['♥️']
runes('Emoji 🤖') // => ['E', 'm', 'o', 'j', 'i', ' ', '🤖']
runes('👩👩👧👦') // => ['👩👩👧👦']
// String.substring
'👨👨👧👧a'.substring(1) // => '�👨👧👧a'
// Runes
runes.substr('👨👨👧👧a', 1) // => 'a'
FAQs
Unicode-aware JS string splitting, typescript version
The npm package runes2 receives a total of 150,765 weekly downloads. As such, runes2 popularity was classified as popular.
We found that runes2 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
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.