repository-provider
Advanced tools
Comparing version 5.2.6 to 5.3.0
@@ -5,2 +5,4 @@ 'use strict'; | ||
var stream = require('stream'); | ||
function _AwaitValue(value) { | ||
@@ -332,2 +334,12 @@ this.wrapped = value; | ||
const {Readable} = stream; | ||
var toReadableStream = input => ( | ||
new Readable({ | ||
read() { | ||
this.push(input); | ||
this.push(null); | ||
} | ||
}) | ||
); | ||
class Content { | ||
@@ -379,2 +391,5 @@ static get TYPE_BLOB() { | ||
} | ||
toStream() { | ||
return this.content instanceof stream.Stream ? this.content : toReadableStream(this.content); | ||
} | ||
toJSON() { | ||
@@ -381,0 +396,0 @@ return { |
{ | ||
"name": "repository-provider", | ||
"version": "5.2.6", | ||
"version": "5.3.0", | ||
"publishConfig": { | ||
@@ -33,3 +33,5 @@ "access": "public" | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"to-readable-stream": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -36,0 +38,0 @@ "@babel/plugin-proposal-async-generator-functions": "^7.1.0", |
@@ -105,2 +105,3 @@ [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider) | ||
- [toString](#tostring) | ||
- [toStream](#tostream) | ||
- [equals](#equals) | ||
@@ -444,2 +445,8 @@ - [Parameters](#parameters-12) | ||
### toStream | ||
Deliver content as stream | ||
Returns **ReadableStream** content | ||
### equals | ||
@@ -446,0 +453,0 @@ |
@@ -0,1 +1,4 @@ | ||
import toReadableStream from "to-readable-stream"; | ||
import { Stream } from 'stream'; | ||
/** | ||
@@ -79,2 +82,10 @@ * Representation of one file or directory entry | ||
/** | ||
* Deliver content as stream | ||
* @return {ReadableStream} content | ||
*/ | ||
toStream() { | ||
return this.content instanceof Stream ? this.content : toReadableStream(this.content); | ||
} | ||
toJSON() { | ||
@@ -81,0 +92,0 @@ return { |
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
62606
1602
494
1
+ Addedto-readable-stream@^1.0.0
+ Addedto-readable-stream@1.0.0(transitive)