Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

utfstring

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utfstring - npm Package Versions

2

3.1.3

Diff

camertron
published 3.1.2 •

camertron
published 3.1.1 •

Changelog

Source

3.1.1

  • Fixes issue causing incorrect values to be returned from indexOf.
    • For example, new UtfString("This is a Text!").indexOf("t", 15) should return -1 but returned 13.
camertron
published 3.1.0 •

Changelog

Source

3.1.0

Added

  • Index signature for UtfString and UtfVisualString classes (@krisztianb).
camertron
published 3.0.1 •

camertron
published 3.0.0 •

Changelog

Source

3.0.0

BREAKING CHANGES

  • UtfString.visual has been moved to a separate class called UtfVisualString.
  • Changed interface of substring method to use an end index parameter instead of a length parameter to match the interface of the String.substring method.
  • UtfString.length is now called UtfString.lengthOf.
  • UtfString.fromCharCode is now called UtfString.stringFromCharCode.

Changes

  • UtfString is now a class that can be instantiated and has its own set of string methods. (#9, @krisztianb)
  • UtfVisualString is now a class that can be instantiated and has its own set of string methods.

Added

  • New method UtfString.fromBytes: Converts an array of UTF-16 bytes into a UTF-safe string object.
  • New method UtfString.fromCharCode: Returns a UTF-safe string object for the given Unicode codepoint.
  • New method UtfString.fromCodePoints: Converts an array of codepoints into a UTF-safe string object.
  • New method UtfString.join: Concatenates the strings from the given array into a new string object.
  • New method UtfString.padEnd: Creates a new string by padding the string at the end with a given string.
  • New method UtfString.padStart: Creates a new string by padding the string at the beginning with a given string.
camertron
published 2.1.0 •

Changelog

Source

2.1.0

  • Port code to TypeScript and add comments (#8, @krisztianb).
camertron
published 2.0.2 •

Changelog

Source

2.0.2

  • Add missing var in front of local variable (#7, @SStauden).
camertron
published 2.0.1 •

Changelog

Source

2.0.1

  • Fix bug causing utfstring to incorrectly calculate logical character indices.
    • For example, utfstring.charCodeAt("\u0001\u1F1E6", 1) returned 56806 when it should have returned 127462.
camertron
published 2.0.0 •

Changelog

Source

2.0.0

  • Abstract grapheme cluster identification in order to separate visual graphemes from individual code points.
    • The classic example if this is regional indicators, which are separate code points but combined by display systems into one visible character. Automatically treating them as a single character can be confusing when using utfstring in other Unicode-aware libraries. Since a number of other programming languages (eg. Ruby, Elixir) don't combine regional indicators when determining length, substrings, etc, I've decided to move regional indicator combination support from the existing utfstring functions to a separate implementation available in UtfString.visual, which supports regional indicators but otherwise behaves identically.
2
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