🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@yarnpkg/plugin-git

Package Overview
Dependencies
Maintainers
6
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yarnpkg/plugin-git - npm Package Compare versions

Comparing version
2.6.0-rc.13
to
2.6.0-rc.14
+4
-4
package.json
{
"name": "@yarnpkg/plugin-git",
"version": "2.6.0-rc.13",
"version": "2.6.0-rc.14",
"license": "BSD-2-Clause",

@@ -8,3 +8,3 @@ "main": "./lib/index.js",

"@types/semver": "^7.1.0",
"@yarnpkg/fslib": "^2.6.1-rc.8",
"@yarnpkg/fslib": "^2.6.1-rc.9",
"clipanion": "^3.2.0-rc.4",

@@ -17,3 +17,3 @@ "git-url-parse": "11.1.2",

"peerDependencies": {
"@yarnpkg/core": "^3.2.0-rc.13"
"@yarnpkg/core": "^3.2.0-rc.14"
},

@@ -23,3 +23,3 @@ "devDependencies": {

"@types/lodash": "^4.14.136",
"@yarnpkg/core": "^3.2.0-rc.13"
"@yarnpkg/core": "^3.2.0-rc.14"
},

@@ -26,0 +26,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

import * as gitUtils from './gitUtils';
const VALID_PATTERNS = [
`GitHubOrg/foo-bar.js`,
`GitHubOrg/foo2bar.js`,
`GitHubOrg/foo-bar.js#hash`,
`GitHubOrg/foo-bar.js#commit:hash`,
`GitHubOrg/foo-bar.js#commit=hash`,
`GitHubOrg/foo-bar.js#commit=hash&workspace=foo`,
`GitHubOrg/foo-bar.js#tag=hello`,
`GitHubOrg/foo-bar.js#workspace=foo`,
`github:GitHubOrg/foo-bar.js`,
`github:GitHubOrg/foo-bar.js#hash`,
`https://github.com/TooTallNate/util-deprecate.git#v1.0.0`,
`https://github.com/TooTallNate/util-deprecate.git#semver:v1.0.0`,
`https://github.com/TooTallNate/util-deprecate.git#master`,
`https://github.com/TooTallNate/util-deprecate.git#b3562c2798507869edb767da869cd7b85487726d`,
`https://github.com/TooTallNate/util-deprecate/tarball/b3562c2798507869edb767da869cd7b85487726d`,
`git://github.com/TooTallNate/util-deprecate.git#v1.0.1`,
`git+ssh://git@github.com/TooTallNate/util-deprecate.git#v1.0.1`,
`ssh://git@github.com/TooTallNate/util-deprecate.git#v1.0.1`,
`git+ssh://git@github.com:yarnpkg/berry.git#v2.1.1`,
`ssh://git@github.com:yarnpkg/berry.git#v2.1.1`,
`git+https://github.com/TooTallNate/util-deprecate#v1.0.1`,
`git+https://github.com/TooTallNate/util-deprecate.git#v1.0.1`,
];
const INVALID_PATTERNS = [
`./.`,
`../..`,
];
describe(`gitUtils`, () => {
for (const pattern of VALID_PATTERNS) {
it(`should detect ${pattern} as a valid Git url`, () => {
expect(gitUtils.isGitUrl(pattern)).toEqual(true);
});
}
for (const pattern of INVALID_PATTERNS) {
it(`shouldn't detect ${pattern} as a valid Git url`, () => {
expect(gitUtils.isGitUrl(pattern)).toEqual(false);
});
}
for (const pattern of VALID_PATTERNS) {
it(`should properly normalize ${pattern} ({ git: false })`, () => {
expect(gitUtils.normalizeRepoUrl(pattern)).toMatchSnapshot();
});
it(`should properly normalize ${pattern} ({ git: true })`, () => {
expect(gitUtils.normalizeRepoUrl(pattern, {git: true})).toMatchSnapshot();
});
}
for (const pattern of VALID_PATTERNS) {
it(`should properly split ${pattern}`, () => {
expect(gitUtils.splitRepoUrl(pattern)).toMatchSnapshot();
});
}
});