Comparing version 0.4.1 to 0.4.2
@@ -40,2 +40,5 @@ /// <reference path="type_declarations/DefinitelyTyped/node/node.d.ts" /> | ||
var buffer = new Buffer(length); | ||
if (length === 0) { | ||
return buffer; | ||
} | ||
var bytesRead = fs_1.readSync(this.fd, buffer, 0, length, position); | ||
@@ -42,0 +45,0 @@ if (bytesRead < length) { |
@@ -40,2 +40,5 @@ /// <reference path="type_declarations/DefinitelyTyped/node/node.d.ts" /> | ||
var buffer = new Buffer(length); | ||
if (length === 0) { | ||
return buffer; | ||
} | ||
var bytesRead = readSync(this.fd, buffer, 0, length, position); | ||
@@ -42,0 +45,0 @@ if (bytesRead < length) { |
@@ -74,4 +74,4 @@ //// export module lexing { | ||
} | ||
StringIterator.fromBuffer = function (buffer, encoding) { | ||
var str = buffer.toString(encoding); | ||
StringIterator.fromBuffer = function (buffer, encoding, start, end) { | ||
var str = buffer.toString(encoding, start, end); | ||
return new StringIterator(str); | ||
@@ -78,0 +78,0 @@ }; |
@@ -137,4 +137,4 @@ //// export module lexing { | ||
static fromBuffer(buffer: Buffer, encoding?: string): StringIterator { | ||
var str = buffer.toString(encoding); | ||
static fromBuffer(buffer: Buffer, encoding?: string, start?: number, end?: number): StringIterator { | ||
var str = buffer.toString(encoding, start, end); | ||
return new StringIterator(str); | ||
@@ -141,0 +141,0 @@ } |
@@ -102,3 +102,3 @@ declare module "lexing" { | ||
constructor(_string: string, position?: number); | ||
static fromBuffer(buffer: Buffer, encoding?: string): StringIterator; | ||
static fromBuffer(buffer: Buffer, encoding?: string, start?: number, end?: number): StringIterator; | ||
/** | ||
@@ -105,0 +105,0 @@ Return the total length of the underlying Buffer. |
{ | ||
"name": "lexing", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Regex-based lexer", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140859
15
3210