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

lexing

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lexing - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

tsconfig.json

10

index.js

@@ -5,4 +5,3 @@ //// export module lexing {

function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};

@@ -301,7 +300,12 @@ /**

// TODO (see TODO in next())
// _ensureLength(length) ensures that our subsequent call to toString() will
// return a string that is at least `length` long.
this._ensureLength(length);
var consumed_string = this._buffer.toString(this._encoding).slice(0, length);
// even though we know we consumed (at least) `length` number of characters,
// we also need to know exactly how long that string is in bytes, in order
// to advance the underlying buffer appropriately
var byteLength = Buffer.byteLength(consumed_string, this._encoding);
// we cannot skip more than `this._buffer.length` bytes
var bytesSkipped = Math.min(byteLength, this._buffer.length);
// var bytesSkipped = Math.min(byteLength, this._buffer.length); // is this necessary?
this._buffer = this._buffer.slice(byteLength);

@@ -308,0 +312,0 @@ return consumed_string.length;

@@ -348,7 +348,12 @@ //// export module lexing {

// TODO (see TODO in next())
// _ensureLength(length) ensures that our subsequent call to toString() will
// return a string that is at least `length` long.
this._ensureLength(length);
var consumed_string = this._buffer.toString(this._encoding).slice(0, length);
// even though we know we consumed (at least) `length` number of characters,
// we also need to know exactly how long that string is in bytes, in order
// to advance the underlying buffer appropriately
var byteLength = Buffer.byteLength(consumed_string, this._encoding);
// we cannot skip more than `this._buffer.length` bytes
var bytesSkipped = Math.min(byteLength, this._buffer.length);
// var bytesSkipped = Math.min(byteLength, this._buffer.length); // is this necessary?
this._buffer = this._buffer.slice(byteLength);

@@ -355,0 +360,0 @@ return consumed_string.length;

{
"name": "lexing",
"version": "0.4.2",
"version": "0.4.3",
"description": "Regex-based lexer",

@@ -5,0 +5,0 @@ "keywords": [

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