New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github-url-detection

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-url-detection - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

6

cjs/index.d.ts

@@ -27,2 +27,4 @@ export declare const is404: () => boolean;

export declare const isPR: (url?: URL | Location) => boolean;
export declare const isPRConflicts: (url?: URL | Location) => boolean;
/** @deprecated use isPRConflicts instead */
export declare const isConflict: (url?: URL | Location) => boolean;

@@ -39,3 +41,5 @@ /** Any `isDiscussionList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown */

export declare const isRepo: (url?: URL | Location) => boolean;
/** @deprecated use isEmptyRepoRoot instead */
export declare const isEmptyRepo: () => boolean;
export declare const isEmptyRepoRoot: () => boolean;
export declare const isRepoTaxonomyDiscussionList: (url?: URL | Location) => boolean;

@@ -71,3 +75,3 @@ export declare const isRepoDiscussionList: (url?: URL | Location) => boolean;

export declare const canUserEditRepo: () => boolean;
/** @deprecated use canUserEditRepo */
/** @deprecated use canUserEditRepo instead */
export declare const isRepoWithAccess: () => boolean;

@@ -74,0 +78,0 @@ export declare const utils: {

17

cjs/index.js

@@ -33,4 +33,8 @@ "use strict";

const isPR = (url = location) => /^pull\/\d+/.test(getRepoPath(url));
const isPR = (url = location) => /^pull\/\d+/.test(getRepoPath(url)) && !isPRConflicts(url);
const isPRConflicts = (url = location) => /^pull\/\d+\/conflicts/.test(getRepoPath(url));
const isConflict = isPRConflicts;
const isPRCommit = (url = location) => /^pull\/\d+\/commits\/[\da-f]{5,40}/.test(getRepoPath(url));

@@ -102,6 +106,3 @@

exports.isBranches = (url = location) => {
var _a;
return null !== (_a = String(getRepoPath(url)).startsWith("branches")) && void 0 !== _a && _a;
};
exports.isBranches = (url = location) => String(getRepoPath(url)).startsWith("branches");

@@ -114,3 +115,3 @@ exports.isCommit = isCommit;

exports.isConflict = (url = location) => /^pull\/\d+\/conflicts/.test(getRepoPath(url));
exports.isConflict = isConflict;

@@ -125,2 +126,4 @@ exports.isDashboard = isDashboard;

exports.isEmptyRepoRoot = () => isRepoRoot() && exists(".blankslate");
exports.isEnterprise = (url = location) => "github.com" !== url.hostname && "gist.github.com" !== url.hostname;

@@ -166,2 +169,4 @@

exports.isPRConflicts = isPRConflicts;
exports.isPRConversation = (url = location) => /^pull\/\d+$/.test(getRepoPath(url));

@@ -168,0 +173,0 @@

@@ -27,2 +27,4 @@ export declare const is404: () => boolean;

export declare const isPR: (url?: URL | Location) => boolean;
export declare const isPRConflicts: (url?: URL | Location) => boolean;
/** @deprecated use isPRConflicts instead */
export declare const isConflict: (url?: URL | Location) => boolean;

@@ -39,3 +41,5 @@ /** Any `isDiscussionList` can display both issues and PRs, prefer that detection. `isPRList` only exists because this page has PR-specific filters like the "Reviews" dropdown */

export declare const isRepo: (url?: URL | Location) => boolean;
/** @deprecated use isEmptyRepoRoot instead */
export declare const isEmptyRepo: () => boolean;
export declare const isEmptyRepoRoot: () => boolean;
export declare const isRepoTaxonomyDiscussionList: (url?: URL | Location) => boolean;

@@ -71,3 +75,3 @@ export declare const isRepoDiscussionList: (url?: URL | Location) => boolean;

export declare const canUserEditRepo: () => boolean;
/** @deprecated use canUserEditRepo */
/** @deprecated use canUserEditRepo instead */
export declare const isRepoWithAccess: () => boolean;

@@ -74,0 +78,0 @@ export declare const utils: {

@@ -55,6 +55,8 @@ var reservedNames = [ "400", "401", "402", "403", "404", "405", "406", "407", "408", "409", "410", "411", "412", "413", "414", "415", "416", "417", "418", "419", "420", "421", "422", "423", "424", "425", "426", "427", "428", "429", "430", "431", "500", "501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "about", "access", "account", "admin", "anonymous", "any", "api", "apps", "attributes", "auth", "billing", "blob", "blog", "bounty", "branches", "business", "businesses", "c", "cache", "case-studies", "categories", "central", "certification", "changelog", "cla", "cloud", "codereview", "collection", "collections", "comments", "commit", "commits", "community", "companies", "compare", "contact", "contributing", "cookbook", "coupons", "customer", "customers", "dashboard", "dashboards", "design", "develop", "developer", "diff", "discover", "discussions", "docs", "downloads", "downtime", "editor", "editors", "edu", "enterprise", "events", "explore", "featured", "features", "files", "fixtures", "forked", "garage", "ghost", "gist", "gists", "graphs", "guide", "guides", "help", "help-wanted", "home", "hooks", "hosting", "hovercards", "identity", "images", "inbox", "individual", "info", "integration", "interfaces", "introduction", "invalid-email-address", "investors", "issues", "jobs", "join", "journal", "journals", "lab", "labs", "languages", "launch", "layouts", "learn", "legal", "library", "linux", "listings", "lists", "login", "logos", "logout", "mac", "maintenance", "malware", "man", "marketplace", "mention", "mentioned", "mentioning", "mentions", "migrating", "milestones", "mine", "mirrors", "mobile", "navigation", "network", "new", "news", "none", "nonprofit", "nonprofits", "notices", "notifications", "oauth", "offer", "open-source", "organisations", "organizations", "orgs", "pages", "partners", "payments", "personal", "plans", "plugins", "popular", "popularity", "posts", "press", "pricing", "professional", "projects", "pulls", "raw", "readme", "recommendations", "redeem", "releases", "render", "reply", "repositories", "resources", "restore", "revert", "save-net-neutrality", "saved", "scraping", "search", "security", "services", "sessions", "settings", "shareholders", "shop", "showcases", "signin", "signup", "site", "spam", "sponsors", "ssh", "staff", "starred", "stars", "static", "status", "statuses", "storage", "store", "stories", "styleguide", "subscriptions", "suggest", "suggestion", "suggestions", "support", "suspended", "talks", "teach", "teacher", "teachers", "teaching", "teams", "ten", "terms", "timeline", "topic", "topics", "tos", "tour", "train", "training", "translations", "tree", "trending", "updates", "username", "users", "visualization", "w", "watching", "wiki", "windows", "works-with", "www0", "www1", "www2", "www3", "www4", "www5", "www6", "www7", "www8", "www9" ];

const isPR = (url = location) => /^pull\/\d+/.test(getRepoPath(url));
const isPR = (url = location) => /^pull\/\d+/.test(getRepoPath(url)) && !isPRConflicts(url);
const isConflict = (url = location) => /^pull\/\d+\/conflicts/.test(getRepoPath(url));
const isPRConflicts = (url = location) => /^pull\/\d+\/conflicts/.test(getRepoPath(url));
const isConflict = isPRConflicts;
const isPRList = (url = location) => "/pulls" === url.pathname || "pulls" === getRepoPath(url);

@@ -80,2 +82,4 @@

const isEmptyRepoRoot = () => isRepoRoot() && exists(".blankslate");
const isRepoTaxonomyDiscussionList = (url = location) => /^labels\/.+|^milestones\/\d+(?!\/edit)/.test(getRepoPath(url));

@@ -111,6 +115,3 @@

const isBranches = (url = location) => {
var _a;
return null !== (_a = String(getRepoPath(url)).startsWith("branches")) && void 0 !== _a && _a;
};
const isBranches = (url = location) => String(getRepoPath(url)).startsWith("branches");

@@ -161,2 +162,2 @@ const isUserProfile = () => exists(".user-profile-nav");

export { canUserEditOrganization, canUserEditRepo, hasCode, hasComments, hasRichTextEditor, is404, is500, isActionJobRun, isActionPage, isBlame, isBranches, isCommit, isCommitList, isCompare, isConflict, isDashboard, isDiscussionList, isEditingFile, isEmptyRepo, isEnterprise, isFileFinder, isForkedRepo, isGist, isGlobalDiscussionList, isGlobalSearchResults, isIssue, isLabelList, isMilestone, isMilestoneList, isNewIssue, isNewRelease, isNotifications, isOrganizationDiscussion, isOrganizationProfile, isOwnOrganizationProfile, isOwnUserProfile, isPR, isPRCommit, isPRCommitList, isPRConversation, isPRFiles, isPRList, isProject, isQuickPR, isReleasesOrTags, isRepo, isRepoCommitList, isRepoDiscussionList, isRepoIssueList, isRepoMainSettings, isRepoPRList, isRepoRoot, isRepoSearch, isRepoSettings, isRepoTaxonomyDiscussionList, isRepoTree, isRepoWithAccess, isSingleCommit, isSingleFile, isSingleGist, isSingleTagPage, isTrending, isUserProfile, isUserProfileFollowersTab, isUserProfileFollowingTab, isUserProfileMainTab, isUserProfileRepoTab, isUserProfileStarsTab, utils };
export { canUserEditOrganization, canUserEditRepo, hasCode, hasComments, hasRichTextEditor, is404, is500, isActionJobRun, isActionPage, isBlame, isBranches, isCommit, isCommitList, isCompare, isConflict, isDashboard, isDiscussionList, isEditingFile, isEmptyRepo, isEmptyRepoRoot, isEnterprise, isFileFinder, isForkedRepo, isGist, isGlobalDiscussionList, isGlobalSearchResults, isIssue, isLabelList, isMilestone, isMilestoneList, isNewIssue, isNewRelease, isNotifications, isOrganizationDiscussion, isOrganizationProfile, isOwnOrganizationProfile, isOwnUserProfile, isPR, isPRCommit, isPRCommitList, isPRConflicts, isPRConversation, isPRFiles, isPRList, isProject, isQuickPR, isReleasesOrTags, isRepo, isRepoCommitList, isRepoDiscussionList, isRepoIssueList, isRepoMainSettings, isRepoPRList, isRepoRoot, isRepoSearch, isRepoSettings, isRepoTaxonomyDiscussionList, isRepoTree, isRepoWithAccess, isSingleCommit, isSingleFile, isSingleGist, isSingleTagPage, isTrending, isUserProfile, isUserProfileFollowersTab, isUserProfileFollowingTab, isUserProfileMainTab, isUserProfileRepoTab, isUserProfileStarsTab, utils };
{
"name": "github-url-detection",
"version": "1.1.5",
"version": "1.1.6",
"description": "Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.",

@@ -25,3 +25,3 @@ "keywords": [

"scripts": {
"ava": "TS_NODE_PROJECT=tsconfig.ava.json ava",
"ava": "TS_NODE_PROJECT=tsconfig.ava.json ava --timeout 30s",
"build": "rollup -c",

@@ -37,11 +37,20 @@ "prepack": "rollup -c",

],
"overrides": [
{
"files": [
"*.ts"
],
"rules": {
"@typescript-eslint/no-unnecessary-condition": "error"
}
}
],
"rules": {
"camelcase": "off",
"unicorn/import-index": "off",
"import/no-useless-path-segments": "off",
"@typescript-eslint/prefer-readonly-parameter-types": "off",
"comma-dangle": [
"error",
"always-multiline"
]
],
"import/no-useless-path-segments": "off",
"unicorn/import-index": "off"
}

@@ -59,8 +68,7 @@ },

"devDependencies": {
"@rollup/plugin-json": "^4.0.3",
"@rollup/plugin-node-resolve": "^7.1.3",
"@rollup/plugin-typescript": "^4.1.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-typescript": "^4.1.2",
"@sindresorhus/tsconfig": "^0.7.0",
"@types/jsdom": "^16.2.1",
"ava": "^3.8.1",
"@types/jsdom": "^16.2.3",
"ava": "^3.8.2",
"esm": "^3.2.25",

@@ -70,10 +78,10 @@ "github-reserved-names": "^1.1.8",

"npm-run-all": "^4.1.5",
"rollup": "^2.7.6",
"rollup-plugin-terser": "^5.3.0",
"rollup": "^2.13.1",
"rollup-plugin-terser": "^6.1.0",
"strip-indent": "^3.0.0",
"ts-node": "^8.10.1",
"tslib": "^1.11.2",
"typescript": "^3.8.3",
"xo": "^0.30.0"
"ts-node": "^8.10.2",
"tslib": "^2.0.0",
"typescript": "^3.9.5",
"xo": "^0.32.0"
}
}
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