Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

repository-provider

Package Overview
Dependencies
Maintainers
1
Versions
662
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repository-provider - npm Package Compare versions

Comparing version 2.10.0 to 2.10.1

23

dist/repository-provider.js

@@ -449,12 +449,22 @@ 'use strict';

* @see {@link Repository#defaultBranch}
* @param {string} name
* @param {string} name with optional branch name as '#myBranchName'
* @return {Promise<Branch>}
*/
async branch(name) {
const repository = await this.repository(name);
const m = name.match(/#(\w+)$/);
if (m) {
return repository.branch(m[1]);
const [repoName, branchName] = name.split(/#/);
let repository;
if (branchName !== undefined) {
repository = await this.repository(repoName);
if (repository !== undefined) {
return repository.branch(branchName);
}
}
repository = await this.repository(repoName);
if (repository === undefined) {
throw new Error(`Unknown repository ${repoName}`);
}
return repository.defaultBranch;

@@ -476,4 +486,3 @@ }

*/
get type()
{
get type() {
return 'git';

@@ -480,0 +489,0 @@ }

{
"name": "repository-provider",
"version": "2.10.0",
"version": "2.10.1",
"main": "dist/repository-provider.js",

@@ -5,0 +5,0 @@ "module": "src/repository-provider.js",

@@ -157,3 +157,3 @@ [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider)

- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** with optional branch name as '#myBranchName'

@@ -160,0 +160,0 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Branch](#branch)>**

@@ -95,12 +95,22 @@ import { Branch } from './branch';

* @see {@link Repository#defaultBranch}
* @param {string} name
* @param {string} name with optional branch name as '#myBranchName'
* @return {Promise<Branch>}
*/
async branch(name) {
const repository = await this.repository(name);
const m = name.match(/#(\w+)$/);
if (m) {
return repository.branch(m[1]);
const [repoName, branchName] = name.split(/#/);
let repository;
if (branchName !== undefined) {
repository = await this.repository(repoName);
if (repository !== undefined) {
return repository.branch(branchName);
}
}
repository = await this.repository(repoName);
if (repository === undefined) {
throw new Error(`Unknown repository ${repoName}`);
}
return repository.defaultBranch;

@@ -122,6 +132,5 @@ }

*/
get type()
{
get type() {
return 'git';
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc