github-url-detection
Advanced tools
Comparing version 5.8.0 to 5.9.0
@@ -95,2 +95,3 @@ export declare const is404: () => boolean; | ||
export declare const hasCode: (url?: URL | HTMLAnchorElement | Location) => boolean; | ||
export declare const hasFiles: (url?: URL | HTMLAnchorElement | Location) => boolean; | ||
export declare const isMarketplaceAction: (url?: URL | HTMLAnchorElement | Location) => boolean; | ||
@@ -97,0 +98,0 @@ export declare const isActionJobRun: (url?: URL | HTMLAnchorElement | Location) => boolean; |
@@ -133,3 +133,3 @@ 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", "advisories", "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-stories", "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", "team", "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" ]; | ||
var _a; | ||
return /^pull\/\d+\/commits\/[\da-f]{5,40}/.test(null === (_a = getRepo(url)) || void 0 === _a ? void 0 : _a.path); | ||
return /^pull\/\d+\/commits\/[\da-f]{5,40}$/.test(null === (_a = getRepo(url)) || void 0 === _a ? void 0 : _a.path); | ||
}; | ||
@@ -267,3 +267,3 @@ | ||
var _a; | ||
return /^commit\/[\da-f]{5,40}/.test(null === (_a = getRepo(url)) || void 0 === _a ? void 0 : _a.path); | ||
return /^commit\/[\da-f]{5,40}$/.test(null === (_a = getRepo(url)) || void 0 === _a ? void 0 : _a.path); | ||
}; | ||
@@ -304,3 +304,3 @@ | ||
const pathname = getCleanPathname(url); | ||
return pathname.length > 0 && !pathname.includes("/") && !reservedNames.includes(pathname); | ||
return pathname.length > 0 && !pathname.includes("/") && !pathname.includes(".") && !reservedNames.includes(pathname); | ||
}; | ||
@@ -326,2 +326,4 @@ | ||
const hasFiles = (url = location) => isCommit(url) || isCompare(url) || isPRFiles(url); | ||
const isMarketplaceAction = (url = location) => url.pathname.startsWith("/marketplace/actions/"); | ||
@@ -391,2 +393,2 @@ | ||
export { canUserEditOrganization, canUserEditRepo, hasCode, hasComments, hasFileEditor, hasReleaseEditor, hasRichTextEditor, hasWikiPageEditor, is404, is500, isActionJobRun, isActionRun, isBlame, isBranches, isClosedPR, isCommit, isCommitList, isCompare, isConversation, isConversationList, isDashboard, isDeletingFile, isDiscussion, isDiscussionList, isDraftPR, isEditingFile, isEditingRelease, isEditingWikiPage, isEmptyRepo, isEmptyRepoRoot, isEnterprise, isFileFinder, isForkedRepo, isGist, isGlobalConversationList, isGlobalSearchResults, isIssue, isLabelList, isMarketplaceAction, isMergedPR, isMilestone, isMilestoneList, isNewAction, isNewFile, isNewIssue, isNewRelease, isNewRepo, isNewRepoTemplate, isNewWikiPage, isNotifications, isOpenPR, isOrganizationDiscussion, isOrganizationProfile, isOrganizationRepo, isOwnOrganizationProfile, isOwnUserProfile, isPR, isPRCommit, isPRCommit404, isPRCommitList, isPRConflicts, isPRConversation, isPRFile404, isPRFiles, isPRList, isPasswordConfirmation, isProfile, isProject, isProjects, isQuickPR, isReleases, isReleasesOrTags, isRepliesSettings, isRepo, isRepoCommitList, isRepoConversationList, isRepoForksList, isRepoHome, isRepoIssueList, isRepoMainSettings, isRepoNetworkGraph, isRepoPRList, isRepoRoot, isRepoSearch, isRepoSettings, isRepoTaxonomyConversationList, isRepoTree, isRepoWiki, isRepositoryActions, isSingleCommit, isSingleFile, isSingleGist, isSingleTag, isTags, isTrending, isUserProfile, isUserProfileFollowersTab, isUserProfileFollowingTab, isUserProfileMainTab, isUserProfileRepoTab, isUserProfileStarsTab, isUserSettings, isUserTheOrganizationOwner, utils }; | ||
export { canUserEditOrganization, canUserEditRepo, hasCode, hasComments, hasFileEditor, hasFiles, hasReleaseEditor, hasRichTextEditor, hasWikiPageEditor, is404, is500, isActionJobRun, isActionRun, isBlame, isBranches, isClosedPR, isCommit, isCommitList, isCompare, isConversation, isConversationList, isDashboard, isDeletingFile, isDiscussion, isDiscussionList, isDraftPR, isEditingFile, isEditingRelease, isEditingWikiPage, isEmptyRepo, isEmptyRepoRoot, isEnterprise, isFileFinder, isForkedRepo, isGist, isGlobalConversationList, isGlobalSearchResults, isIssue, isLabelList, isMarketplaceAction, isMergedPR, isMilestone, isMilestoneList, isNewAction, isNewFile, isNewIssue, isNewRelease, isNewRepo, isNewRepoTemplate, isNewWikiPage, isNotifications, isOpenPR, isOrganizationDiscussion, isOrganizationProfile, isOrganizationRepo, isOwnOrganizationProfile, isOwnUserProfile, isPR, isPRCommit, isPRCommit404, isPRCommitList, isPRConflicts, isPRConversation, isPRFile404, isPRFiles, isPRList, isPasswordConfirmation, isProfile, isProject, isProjects, isQuickPR, isReleases, isReleasesOrTags, isRepliesSettings, isRepo, isRepoCommitList, isRepoConversationList, isRepoForksList, isRepoHome, isRepoIssueList, isRepoMainSettings, isRepoNetworkGraph, isRepoPRList, isRepoRoot, isRepoSearch, isRepoSettings, isRepoTaxonomyConversationList, isRepoTree, isRepoWiki, isRepositoryActions, isSingleCommit, isSingleFile, isSingleGist, isSingleTag, isTags, isTrending, isUserProfile, isUserProfileFollowersTab, isUserProfileFollowingTab, isUserProfileMainTab, isUserProfileRepoTab, isUserProfileStarsTab, isUserSettings, isUserTheOrganizationOwner, utils }; |
{ | ||
"name": "github-url-detection", | ||
"version": "5.8.0", | ||
"version": "5.9.0", | ||
"description": "Which GitHub page are you on? Is it an issue? Is it a list? Perfect for your WebExtension or userscript.", | ||
@@ -25,2 +25,6 @@ "keywords": [ | ||
], | ||
"alias": { | ||
"./this-stuff-is-just-for-local-parcel-tests": "./package.json", | ||
"./collector.js": "./collector.ts" | ||
}, | ||
"scripts": { | ||
@@ -59,6 +63,3 @@ "ava": "ava --timeout 30s", | ||
"@typescript-eslint/no-non-null-asserted-optional-chain": "off", | ||
"@typescript-eslint/comma-dangle": [ | ||
"error", | ||
"always-multiline" | ||
] | ||
"@typescript-eslint/naming-convention": "off" | ||
} | ||
@@ -68,10 +69,3 @@ } | ||
"rules": { | ||
"camelcase": "off", | ||
"comma-dangle": [ | ||
"error", | ||
"always-multiline" | ||
], | ||
"import/extensions": "off", | ||
"import/no-useless-path-segments": "off", | ||
"unicorn/import-index": "off" | ||
"camelcase": "off" | ||
} | ||
@@ -81,4 +75,3 @@ }, | ||
"environmentVariables": { | ||
"TS_NODE_FILES": "true", | ||
"TS_NODE_COMPILER_OPTIONS": "{\"module\": \"esnext\", \"allowSyntheticDefaultImports\": true}" | ||
"TS_NODE_FILES": "true" | ||
}, | ||
@@ -98,21 +91,22 @@ "extensions": { | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^13.0.5", | ||
"@rollup/plugin-typescript": "^8.2.5", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"@rollup/plugin-typescript": "^8.3.0", | ||
"@sindresorhus/tsconfig": "^2.0.0", | ||
"@types/estree": "^0.0.50", | ||
"@types/jsdom": "^16.2.13", | ||
"ava": "^3.15.0", | ||
"github-reserved-names": "^2.0.4", | ||
"jsdom": "^17.0.0", | ||
"jsdom": "^19.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"parcel-bundler": "^1.12.4", | ||
"parcel-plugin-svelte": "^4.0.9", | ||
"rollup": "^2.57.0", | ||
"rollup": "^2.60.2", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"strip-indent": "^4.0.0", | ||
"svelte": "^3.43.0", | ||
"svelte-check": "^2.2.6", | ||
"ts-node": "^10.2.1", | ||
"svelte": "^3.44.2", | ||
"svelte-check": "^2.2.10", | ||
"ts-node": "^10.4.0", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.4.3", | ||
"xo": "^0.44.0" | ||
"typescript": "^4.5.2", | ||
"xo": "^0.47.0" | ||
}, | ||
@@ -119,0 +113,0 @@ "engines": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
36023
416
21
1