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 3.6.3 to 3.7.0

29

dist/provider.js

@@ -290,18 +290,15 @@ 'use strict';

class PullRequest {
constructor(repository, name, options = {}) {
Object.defineProperties(
this,
['title', 'state'].reduce(
(a, key) => {
if (options[key] !== undefined) {
a[key] = { value: options[key] };
}
return a;
},
{
name: { value: name },
repository: { value: repository }
}
)
);
static get defaultOptions() {
return {
title: undefined,
state: undefined
};
}
constructor(repository, name, options) {
const properties = {
name: { value: name },
repository: { value: repository }
};
propertiesFromOptions(properties, options, this.constructor.defaultOptions);
Object.defineProperties(this, properties);
repository.addPullRequest(this);

@@ -308,0 +305,0 @@ }

{
"name": "repository-provider",
"version": "3.6.3",
"version": "3.7.0",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

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

- [decline](#decline)
- [title](#title)
- [state](#state)
- [RepositoryGroup](#repositorygroup-1)

@@ -100,2 +102,4 @@ - [Parameters](#parameters-10)

- [Properties](#properties-6)
- [propertiesFromOptions](#propertiesfromoptions)
- [Parameters](#parameters-12)

@@ -311,3 +315,3 @@ ## Provider

- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `options.title` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

@@ -344,2 +348,14 @@ - `options.state` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**

## title
the description of the pull request.
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
## state
state of the pull request.
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
## RepositoryGroup

@@ -400,2 +416,14 @@

## propertiesFromOptions
- **See: Object.definedProperties()**
create properties from options and default options
### Parameters
- `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** where the properties will be stored
- `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
- `defaultOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
# install

@@ -402,0 +430,0 @@

@@ -1,2 +0,2 @@

import { notImplementedError } from './util';
import { notImplementedError, propertiesFromOptions } from "./util";

@@ -19,19 +19,28 @@ /**

export class PullRequest {
constructor(repository, name, options = {}) {
Object.defineProperties(
this,
['title', 'state'].reduce(
(a, key) => {
if (options[key] !== undefined) {
a[key] = { value: options[key] };
}
return a;
},
{
name: { value: name },
repository: { value: repository }
}
)
);
static get defaultOptions() {
return {
/**
* the description of the pull request.
* @return {string}
*/
title: undefined,
/**
* state of the pull request.
* @return {string}
*/
state: undefined
};
}
constructor(repository, name, options) {
const properties = {
name: { value: name },
repository: { value: repository }
};
propertiesFromOptions(properties, options, this.constructor.defaultOptions);
Object.defineProperties(this, properties);
repository.addPullRequest(this);

@@ -38,0 +47,0 @@ }

@@ -5,2 +5,9 @@ export function notImplementedError() {

/**
* create properties from options and default options
* @see Object.definedProperties()
* @param {Object} properties where the properties will be stored
* @param {Object} options
* @param {Object} defaultOptions
*/
export function propertiesFromOptions(properties, options, defaultOptions) {

@@ -7,0 +14,0 @@ Object.keys(defaultOptions).forEach(name => {

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