tap-parser
Advanced tools
Comparing version 12.0.0 to 12.0.1
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
@@ -31,3 +32,3 @@ import { FinalResults } from './final-results.js'; | ||
} | ||
export declare class Parser extends EventEmitter { | ||
export declare class Parser extends EventEmitter implements NodeJS.WritableStream { | ||
private child; | ||
@@ -91,8 +92,8 @@ private current; | ||
processYamlish(): void; | ||
write(chunk: string | Buffer, cb?: (...x: any[]) => any): boolean; | ||
write(chunk: string | Buffer, encoding?: BufferEncoding): boolean; | ||
write(chunk: string | Buffer, encoding?: BufferEncoding, cb?: (...x: any[]) => any): boolean; | ||
end(chunk?: string | Buffer, encoding?: BufferEncoding, cb?: (...a: any[]) => any): Parser; | ||
end(chunk?: string | Buffer, cb?: (...a: any[]) => any): Parser; | ||
end(cb?: (...a: any[]) => any): Parser; | ||
write(chunk: string | Uint8Array | Buffer, cb?: (...x: any[]) => any): boolean; | ||
write(chunk: string | Uint8Array | Buffer, encoding?: BufferEncoding): boolean; | ||
write(chunk: string | Uint8Array | Buffer, encoding?: BufferEncoding, cb?: (...x: any[]) => any): boolean; | ||
end(chunk?: string | Buffer | Uint8Array, encoding?: BufferEncoding, cb?: (...a: any[]) => any): this; | ||
end(chunk?: string | Buffer | Uint8Array, cb?: (...a: any[]) => any): this; | ||
end(cb?: (...a: any[]) => any): this; | ||
emitComplete(skipAll: boolean): void; | ||
@@ -99,0 +100,0 @@ version(version: number, line: string): void; |
@@ -275,10 +275,13 @@ "use strict"; | ||
write(chunk, encoding, cb) { | ||
if (this.aborted) | ||
if (this.aborted) { | ||
return false; | ||
} | ||
if (typeof encoding === 'string' && | ||
encoding !== 'utf8' && | ||
typeof chunk === 'string') | ||
typeof chunk === 'string') { | ||
chunk = Buffer.from(chunk, encoding); | ||
if (Buffer.isBuffer(chunk)) | ||
} | ||
if (Buffer.isBuffer(chunk)) { | ||
chunk = chunk.toString('utf8'); | ||
} | ||
if (typeof encoding === 'function') { | ||
@@ -310,4 +313,5 @@ cb = encoding; | ||
} | ||
if (this.buffer) | ||
if (this.buffer) { | ||
this.write('\n'); | ||
} | ||
// if we have yamlish, means we didn't finish with a ... | ||
@@ -314,0 +318,0 @@ if (this.yamlish) |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
@@ -31,3 +32,3 @@ import { FinalResults } from './final-results.js'; | ||
} | ||
export declare class Parser extends EventEmitter { | ||
export declare class Parser extends EventEmitter implements NodeJS.WritableStream { | ||
private child; | ||
@@ -91,8 +92,8 @@ private current; | ||
processYamlish(): void; | ||
write(chunk: string | Buffer, cb?: (...x: any[]) => any): boolean; | ||
write(chunk: string | Buffer, encoding?: BufferEncoding): boolean; | ||
write(chunk: string | Buffer, encoding?: BufferEncoding, cb?: (...x: any[]) => any): boolean; | ||
end(chunk?: string | Buffer, encoding?: BufferEncoding, cb?: (...a: any[]) => any): Parser; | ||
end(chunk?: string | Buffer, cb?: (...a: any[]) => any): Parser; | ||
end(cb?: (...a: any[]) => any): Parser; | ||
write(chunk: string | Uint8Array | Buffer, cb?: (...x: any[]) => any): boolean; | ||
write(chunk: string | Uint8Array | Buffer, encoding?: BufferEncoding): boolean; | ||
write(chunk: string | Uint8Array | Buffer, encoding?: BufferEncoding, cb?: (...x: any[]) => any): boolean; | ||
end(chunk?: string | Buffer | Uint8Array, encoding?: BufferEncoding, cb?: (...a: any[]) => any): this; | ||
end(chunk?: string | Buffer | Uint8Array, cb?: (...a: any[]) => any): this; | ||
end(cb?: (...a: any[]) => any): this; | ||
emitComplete(skipAll: boolean): void; | ||
@@ -99,0 +100,0 @@ version(version: number, line: string): void; |
@@ -272,10 +272,13 @@ import { EventEmitter } from 'events'; | ||
write(chunk, encoding, cb) { | ||
if (this.aborted) | ||
if (this.aborted) { | ||
return false; | ||
} | ||
if (typeof encoding === 'string' && | ||
encoding !== 'utf8' && | ||
typeof chunk === 'string') | ||
typeof chunk === 'string') { | ||
chunk = Buffer.from(chunk, encoding); | ||
if (Buffer.isBuffer(chunk)) | ||
} | ||
if (Buffer.isBuffer(chunk)) { | ||
chunk = chunk.toString('utf8'); | ||
} | ||
if (typeof encoding === 'function') { | ||
@@ -307,4 +310,5 @@ cb = encoding; | ||
} | ||
if (this.buffer) | ||
if (this.buffer) { | ||
this.write('\n'); | ||
} | ||
// if we have yamlish, means we didn't finish with a ... | ||
@@ -311,0 +315,0 @@ if (this.yamlish) |
{ | ||
"name": "tap-parser", | ||
"version": "12.0.0", | ||
"version": "12.0.1", | ||
"description": "parse the test anything protocol", | ||
@@ -29,3 +29,3 @@ "main": "dist/cjs/index.js", | ||
"prettier": "^2.7.1", | ||
"tap": "^16.3.0", | ||
"tap": "^16.3.2", | ||
"ts-node": "^10.9.1", | ||
@@ -32,0 +32,0 @@ "typedoc": "^0.23.20", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
196676
2911
425
0