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 1.0.0 to 1.1.0

substring.js

2

chars.js

@@ -9,3 +9,3 @@ var multichars = require('multichar-regex')

var m
var m
var ri = 0

@@ -12,0 +12,0 @@ while (m = multichars.exec(string)) {

module.exports = {
chars: require('./chars'),
length: require('./length'),
substring: require('./substring'),
substr: require('./substr')
}
{
"name": "unicode-string",
"version": "1.0.0",
"version": "1.1.0",
"description": "a collection of unicode-aware string functions",

@@ -35,3 +35,3 @@ "main": "index.js",

},
"homepage": "https://github.com/michaelrhodes/unicode-string"
"homepage": "https://github.com/michaelrhodes/unicode-string"
}

@@ -18,2 +18,3 @@ # unicode-string

var chars = require('unicode-string/chars')
var substring = require('unicode-string/substring')
var substr = require('unicode-string/substr')

@@ -35,2 +36,8 @@

// substring
console.log(string.substring(2, 3))
=> �
console.log(substring(string, 2, 3))
=> 🇨🇦
// substr

@@ -47,5 +54,5 @@ console.log(string.substr(2, 1))

| :----------------------- | ------: |
| unicode-string.js | 2.03 kB |
| unicode-string.min.js | 1.5 kB |
| unicode-string.min.js.gz | 657 B |
| unicode-string.js | 2.5 kB |
| unicode-string.min.js | 1.77 kB |
| unicode-string.min.js.gz | 721 B |

@@ -52,0 +59,0 @@

@@ -7,3 +7,3 @@ var multichars = require('multichar-regex')

var characters = chars(string).slice(start, start + length)
return length < 0 ? '' : characters.join('')
return length < 0 ? '' : characters.join('')
}

@@ -15,3 +15,4 @@ var test = require('tape')

assert.equal(substr(f.hell, 2, -1), '')
assert.equal(substr('•••🇨🇦••••', 3, 1), '🇨🇦')
assert.end()
})
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