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

structurae

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

structurae - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

22

lib/string-view.js

@@ -114,2 +114,23 @@ const { searchNaive, searchShiftOr } = require('./algorithms');

}
/**
* Returns the size in bytes of a given string.
*
* @param {string} string the string to check
* @returns {number} the size in bytes
*/
static getStringSize(string) {
let size = 0;
for (let i = 0; i < string.length; i++) {
const code = string.codePointAt(i);
if (code < 0x0080) size += 1; // 1-byte
else if (code < 0x0800) size += 2; // 2-byte
else if (code < 0x10000) size += 3; // 3-byte
else { // 4-byte
size += 4;
i++;
}
}
return size;
}
}

@@ -119,2 +140,3 @@

* @type Int8Array
* @private
*/

@@ -121,0 +143,0 @@ StringView.masks = new Int8Array(256).fill(-1);

2

package.json
{
"name": "structurae",
"version": "0.0.12",
"version": "0.0.13",
"description": "Data structures for performance-sensitive modern JavaScript applications.",

@@ -5,0 +5,0 @@ "main": "index.js",

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