promise-readable
Advanced tools
Comparing version 4.0.0 to 4.1.0
# Changelog | ||
## v4.1.0 2019-05-09 | ||
* Some changes for visibility of properties. | ||
## v4.0.1 2019-05-09 | ||
* Updated dependencies. | ||
## v4.0.0 2019-05-09 | ||
* Rewritten in Typescript. | ||
* `PromiseReadable` accepts `NodeJS.ReadableStream`. | ||
* `PromiseReadable` constructor accepts `NodeJS.ReadableStream`. | ||
* Dropped support for Node < 6. | ||
@@ -8,0 +16,0 @@ |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
interface ReadableStream extends NodeJS.ReadableStream { | ||
@@ -8,3 +9,5 @@ closed?: boolean; | ||
readonly stream: TReadable; | ||
private errorHandler; | ||
static [Symbol.hasInstance](instance: any): boolean; | ||
readonly isPromiseReadable: boolean; | ||
private readonly errorHandler?; | ||
private errored?; | ||
@@ -11,0 +14,0 @@ constructor(stream: TReadable); |
@@ -7,2 +7,3 @@ "use strict"; | ||
this.stream = stream; | ||
this.isPromiseReadable = true; | ||
this.errorHandler = (err) => { | ||
@@ -13,2 +14,5 @@ this.errored = err; | ||
} | ||
static [Symbol.hasInstance](instance) { | ||
return instance.isPromiseReadable; | ||
} | ||
read(size) { | ||
@@ -118,3 +122,2 @@ const stream = this.stream; | ||
this.stream.removeListener('error', this.errorHandler); | ||
delete this.errorHandler; | ||
} | ||
@@ -121,0 +124,0 @@ if (typeof this.stream.destroy === 'function') { |
{ | ||
"name": "promise-readable", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Return promise for readable stream", | ||
@@ -29,3 +29,4 @@ "main": "lib/promise-readable.js", | ||
"@types/mocha": "^5.2.6", | ||
"@types/node": "^9.4.7", | ||
"@types/node": "^12.0.0", | ||
"@types/semver": "^6.0.0", | ||
"chai": "^4.2.0", | ||
@@ -41,8 +42,8 @@ "coveralls": "^3.0.3", | ||
"prettier": "^1.17.0", | ||
"semver": "^6.0.0", | ||
"shx": "^0.3.2", | ||
"ts-node": "^8.1.0", | ||
"tslint": "^5.9.1", | ||
"tslint": "^5.16.0", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^7.0.0", | ||
"typescript": "^2.7.2" | ||
"typescript": "^3.4.5" | ||
}, | ||
@@ -49,0 +50,0 @@ "scripts": { |
@@ -10,3 +10,9 @@ /// <reference types="node" /> | ||
export class PromiseReadable<TReadable extends ReadableStream> { | ||
private errorHandler: (err: Error) => void | ||
static [Symbol.hasInstance](instance: any): boolean { | ||
return instance.isPromiseReadable | ||
} | ||
readonly isPromiseReadable: boolean = true | ||
private readonly errorHandler?: (err: Error) => void | ||
private errored?: Error | ||
@@ -147,3 +153,2 @@ | ||
this.stream.removeListener('error', this.errorHandler) | ||
delete this.errorHandler | ||
} | ||
@@ -150,0 +155,0 @@ if (typeof this.stream.destroy === 'function') { |
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
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
24012
428
0
20