@octokit/oauth-authorization-url
Advanced tools
Comparing version 6.0.0 to 6.0.1
@@ -1,5 +0,26 @@ | ||
'use strict'; | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
// pkg/dist-src/index.js | ||
var dist_src_exports = {}; | ||
__export(dist_src_exports, { | ||
oauthAuthorizationUrl: () => oauthAuthorizationUrl | ||
}); | ||
module.exports = __toCommonJS(dist_src_exports); | ||
function oauthAuthorizationUrl(options) { | ||
@@ -34,16 +55,9 @@ const clientType = options.clientType || "oauth-app"; | ||
let url = base; | ||
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; | ||
Object.keys(map).filter((k) => options[k] !== null).filter((k) => { | ||
if (k !== "scopes") | ||
return true; | ||
if (options.clientType === "github-app") | ||
return false; | ||
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]}`]) | ||
// Finally, build the URL | ||
.forEach(([key, value], index) => { | ||
}).map((key) => [map[key], `${options[key]}`]).forEach(([key, value], index) => { | ||
url += index === 0 ? `?` : "&"; | ||
@@ -54,4 +68,5 @@ url += `${key}=${encodeURIComponent(value)}`; | ||
} | ||
exports.oauthAuthorizationUrl = oauthAuthorizationUrl; | ||
//# sourceMappingURL=index.js.map | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
oauthAuthorizationUrl | ||
}); |
{ | ||
"name": "@octokit/oauth-authorization-url", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"version": "6.0.1", | ||
"description": "Universal library to retrieve GitHubâs identity URL for the OAuth web flow", | ||
"version": "6.0.0", | ||
"license": "MIT", | ||
"repository": "github:octokit/oauth-authorization-url.js", | ||
"files": [ | ||
"dist-*/", | ||
"bin/" | ||
"dist-*/**", | ||
"bin/**" | ||
], | ||
"source": "dist-src/index.js", | ||
"types": "dist-types/index.d.ts", | ||
"main": "dist-node/index.js", | ||
"module": "dist-web/index.js", | ||
"unpkg": "dist-web/index.js", | ||
"pika": true, | ||
"sideEffects": false, | ||
"keywords": [ | ||
@@ -22,10 +18,9 @@ "octokit", | ||
], | ||
"repository": "github:octokit/oauth-authorization-url.js", | ||
"dependencies": {}, | ||
"author": "Gregor Martynus (https://github.com/gr2m)", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@pika/pack": "^0.3.7", | ||
"@pika/plugin-build-node": "^0.9.0", | ||
"@pika/plugin-build-web": "^0.9.0", | ||
"@pika/plugin-ts-standard-pkg": "^0.9.0", | ||
"@octokit/tsconfig": "^1.0.2", | ||
"@types/jest": "^29.0.0", | ||
"esbuild": "^0.17.19", | ||
"glob": "^10.2.6", | ||
"jest": "^29.0.0", | ||
@@ -40,5 +35,7 @@ "pika-plugin-unpkg-field": "^1.0.1", | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
"main": "dist-node/index.js", | ||
"browser": "dist-web/index.js", | ||
"types": "dist-types/index.d.ts", | ||
"module": "dist-src/index.js", | ||
"sideEffects": false | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
21699
9
10
201
1
1