New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unicode-string

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unicode-string - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

slice.js

7

index.js
module.exports = {
substring: require('./substring'),
length: require('./length'),
slice: require('./slice'),
split: require('./split'),
substring: require('./substring'),
substr: require('./substr'),
length: require('./length')
substr: require('./substr')
}
{
"name": "unicode-string",
"version": "2.0.1",
"version": "2.1.0",
"main": "index.js",

@@ -10,3 +10,3 @@ "license": "CC0-1.0",

"devDependencies": {
"dexy": "github:michaelrhodes/dexy#1.0.5",
"dexy": "https://pkg.mkr.sx/dexy/1.0.6.tgz",
"to-zalgo": "^1.0.1"

@@ -13,0 +13,0 @@ },

@@ -8,3 +8,3 @@ # unicode-string

```sh
npm install https://michaelrhodes.github.io/unicode-string/2.0.1.tgz
npm install https://pkg.mkr.sx/unicode-string/2.1.0.tgz
```

@@ -14,25 +14,29 @@

```js
var uni = require('unicode-string')
var unicode = require('unicode-string')
var string = 'o 🇨🇦'
console.log(string.length)
=> 6
console.log(uni.length(string))
=> 3
string.length
> 6
unicode.length(string)
> 3
console.log(string.split(''))
=> [ 'o', ' ', '�', '�', '�', '�' ]
console.log(uni.split(string, ''))
=> [ 'o', ' ', '🇨🇦' ]
string.split('')
> ['o',' ','\ud83c','\udde8','\ud83c','\udde6']
unicode.split(string, '')
> ['o',' ','🇨🇦']
console.log(string.substring(2, 3))
=> �
console.log(uni.substring(string, 2, 3))
=> 🇨🇦
string.substring(2, 3)
> '\ud83c'
unicode.substring(string, 2, 3)
> '🇨🇦'
console.log(string.substr(2, 1))
=> �
console.log(uni.substr(string, 2, 1))
=> 🇨🇦
string.substr(2, 1)
> '\ud83c'
unicode.substr(string, 2, 1)
> '🇨🇦'
string.slice(0, -2)
> 'o \ud83c\udde8'
unicode.slice(string, 0, -2)
> 'o'
```

@@ -39,0 +43,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc