repository-provider
Advanced tools
Comparing version 6.1.0 to 7.0.0
@@ -309,5 +309,14 @@ 'use strict'; | ||
} | ||
async createPullRequest() { | ||
return notImplementedError(); | ||
async createPullRequest(name, source, options) { | ||
await this.initialize(); | ||
let pr = this._pullRequests.get(name); | ||
if (pr === undefined) { | ||
pr = await this._createPullRequest(name, source, options); | ||
this._pullRequests.set(pr.name, pr); | ||
} | ||
return pr; | ||
} | ||
async _createPullRequest(name, source, options) { | ||
return new this.pullRequestClass(name, source, this, options); | ||
} | ||
async pullRequests() { | ||
@@ -420,3 +429,3 @@ await this.initialize(); | ||
} | ||
toStream() { | ||
async getReadStream() { | ||
return this.content instanceof stream.Stream ? this.content : toReadableStream(this.content); | ||
@@ -423,0 +432,0 @@ } |
{ | ||
"name": "repository-provider", | ||
"version": "6.1.0", | ||
"version": "7.0.0", | ||
"publishConfig": { | ||
@@ -51,3 +51,3 @@ "access": "public" | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"semantic-release": "^15.10.5", | ||
"semantic-release": "^15.10.7", | ||
"travis-deploy-once": "^5.0.9" | ||
@@ -54,0 +54,0 @@ }, |
@@ -108,3 +108,3 @@ [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider) | ||
- [toString](#tostring) | ||
- [toStream](#tostream) | ||
- [getReadStream](#getreadstream) | ||
- [equals](#equals) | ||
@@ -461,7 +461,7 @@ - [Parameters](#parameters-12) | ||
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true is content represents a directory | ||
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if content represents a directory | ||
### isFile | ||
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true is content represents a blob (plain old file) | ||
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if content represents a blob (plain old file) | ||
@@ -474,3 +474,3 @@ ### toString | ||
### toStream | ||
### getReadStream | ||
@@ -477,0 +477,0 @@ Deliver content as stream |
@@ -23,2 +23,3 @@ import toReadableStream from "to-readable-stream"; | ||
} | ||
static get TYPE_TREE() { | ||
@@ -65,3 +66,3 @@ return "tree"; | ||
/** | ||
* @return {boolean} true is content represents a directory | ||
* @return {boolean} true if content represents a directory | ||
*/ | ||
@@ -73,3 +74,3 @@ get isDirectory() { | ||
/** | ||
* @return {boolean} true is content represents a blob (plain old file) | ||
* @return {boolean} true if content represents a blob (plain old file) | ||
*/ | ||
@@ -100,3 +101,3 @@ get isFile() { | ||
*/ | ||
toStream() { | ||
async getReadStream() { | ||
return this.content instanceof Stream | ||
@@ -103,0 +104,0 @@ ? this.content |
@@ -210,6 +210,17 @@ import { notImplementedError } from "./util"; | ||
async createPullRequest() { | ||
return notImplementedError(); | ||
async createPullRequest(name, source, options) { | ||
await this.initialize(); | ||
let pr = this._pullRequests.get(name); | ||
if (pr === undefined) { | ||
pr = await this._createPullRequest(name, source, options); | ||
this._pullRequests.set(pr.name, pr); | ||
} | ||
return pr; | ||
} | ||
async _createPullRequest(name, source, options) { | ||
return new this.pullRequestClass(name, source, this, options); | ||
} | ||
/** | ||
@@ -216,0 +227,0 @@ * Deliver all {@link PullRequest}s |
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
69503
1806