Socket
Socket
Sign inDemoInstall

@octokit/oauth-authorization-url

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/oauth-authorization-url - npm Package Compare versions

Comparing version 4.2.0 to 4.2.1

10

dist-node/index.js

@@ -86,12 +86,12 @@ 'use strict';

let url = base;
Object.keys(map).filter(k => options[k] !== null) // Filter out keys that are null and remove the url key
Object.keys(map) // Filter out keys that are null and remove the url key
.filter(k => options[k] !== null) // Filter out empty scopes array
.filter(k => {
if (k !== "scopes") return true;
if (options.clientType === "github-app") return false;
return !Array.isArray(options[k]) || options[k].length > 1;
}) // Filter out empty scopes array
return !Array.isArray(options[k]) || options[k].length > 0;
}) // Map Array with the proper URL parameter names and change the value to a string using template strings
// @ts-ignore
.map(key => [map[key], `${options[key]}`]) // Map Array with the proper URL parameter names and change the value to a string using template strings
.map(key => [map[key], `${options[key]}`]) // Finally, build the URL
.forEach(([key, value], index) => {
// Finally, build the URL
url += index === 0 ? `?` : "&";

@@ -98,0 +98,0 @@ url += `${key}=${value}`;

@@ -41,3 +41,5 @@ export function oauthAuthorizationUrl(options) {

Object.keys(map)
.filter((k) => options[k] !== null) // Filter out keys that are null and remove the url key
// Filter out keys that are null and remove the url key
.filter((k) => options[k] !== null)
// Filter out empty scopes array
.filter((k) => {

@@ -48,8 +50,9 @@ if (k !== "scopes")

return false;
return !Array.isArray(options[k]) || options[k].length > 1;
}) // Filter out empty scopes array
return !Array.isArray(options[k]) || options[k].length > 0;
})
// Map Array with the proper URL parameter names and change the value to a string using template strings
// @ts-ignore
.map((key) => [map[key], `${options[key]}`]) // Map Array with the proper URL parameter names and change the value to a string using template strings
.map((key) => [map[key], `${options[key]}`])
// Finally, build the URL
.forEach(([key, value], index) => {
// Finally, build the URL
url += index === 0 ? `?` : "&";

@@ -56,0 +59,0 @@ url += `${key}=${value}`;

@@ -41,3 +41,5 @@ function oauthAuthorizationUrl(options) {

Object.keys(map)
.filter((k) => options[k] !== null) // Filter out keys that are null and remove the url key
// Filter out keys that are null and remove the url key
.filter((k) => options[k] !== null)
// Filter out empty scopes array
.filter((k) => {

@@ -48,8 +50,9 @@ if (k !== "scopes")

return false;
return !Array.isArray(options[k]) || options[k].length > 1;
}) // Filter out empty scopes array
return !Array.isArray(options[k]) || options[k].length > 0;
})
// Map Array with the proper URL parameter names and change the value to a string using template strings
// @ts-ignore
.map((key) => [map[key], `${options[key]}`]) // Map Array with the proper URL parameter names and change the value to a string using template strings
.map((key) => [map[key], `${options[key]}`])
// Finally, build the URL
.forEach(([key, value], index) => {
// Finally, build the URL
url += index === 0 ? `?` : "&";

@@ -56,0 +59,0 @@ url += `${key}=${value}`;

{
"name": "@octokit/oauth-authorization-url",
"description": "Universal library to retrieve GitHub’s identity URL for the OAuth web flow",
"version": "4.2.0",
"version": "4.2.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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