Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cucumber/ci-environment

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cucumber/ci-environment - npm Package Compare versions

Comparing version 8.1.0 to 9.0.0

6

dist/cjs/src/CiEnvironments.js

@@ -25,3 +25,2 @@ "use strict";

branch: '${bamboo_planRepository_branch}',
tag: null,
},

@@ -70,3 +69,2 @@ },

branch: '${CF_BRANCH}',
tag: null,
},

@@ -82,3 +80,2 @@ },

branch: '${CI_BRANCH}',
tag: null,
},

@@ -116,3 +113,2 @@ },

branch: '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}',
tag: null,
},

@@ -128,3 +124,2 @@ },

branch: '${GIT_LOCAL_BRANCH}',
tag: null,
},

@@ -162,3 +157,2 @@ },

branch: '${WERCKER_GIT_BRANCH}',
tag: null,
},

@@ -165,0 +159,0 @@ },

11

dist/cjs/src/detectCiEnvironment.js

@@ -66,12 +66,13 @@ "use strict";

function detectGit(ciEnvironment, env) {
var revision = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.git.revision, env);
var _a, _b, _c, _d;
var revision = (0, evaluateVariableExpression_js_1.default)((_a = ciEnvironment.git) === null || _a === void 0 ? void 0 : _a.revision, env);
if (!revision) {
return undefined;
}
var remote = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.git.remote, env);
var remote = (0, evaluateVariableExpression_js_1.default)((_b = ciEnvironment.git) === null || _b === void 0 ? void 0 : _b.remote, env);
if (!remote) {
return undefined;
}
var tag = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.git.tag, env);
var branch = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.git.branch, env);
var tag = (0, evaluateVariableExpression_js_1.default)((_c = ciEnvironment.git) === null || _c === void 0 ? void 0 : _c.tag, env);
var branch = (0, evaluateVariableExpression_js_1.default)((_d = ciEnvironment.git) === null || _d === void 0 ? void 0 : _d.branch, env);
return __assign(__assign({ revision: revision, remote: removeUserInfoFromUrl(remote) }, (tag && { tag: tag })), (branch && { branch: branch }));

@@ -81,3 +82,2 @@ }

var url = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.url, env);
var buildNumber = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.buildNumber, env);
if (url === undefined) {

@@ -88,2 +88,3 @@ // The url is what consumers will use as the primary key for a build

}
var buildNumber = (0, evaluateVariableExpression_js_1.default)(ciEnvironment.buildNumber, env);
var git = detectGit(ciEnvironment, env);

@@ -90,0 +91,0 @@ return __assign({ name: ciEnvironment.name, url: url, buildNumber: buildNumber }, (git && { git: git }));

import detectCiEnvironment from './detectCiEnvironment.js';
export * from './types.js';
export default detectCiEnvironment;
//# sourceMappingURL=index.d.ts.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -7,3 +17,4 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var detectCiEnvironment_js_1 = __importDefault(require("./detectCiEnvironment.js"));
__exportStar(require("./types.js"), exports);
exports.default = detectCiEnvironment_js_1.default;
//# sourceMappingURL=index.js.map
export declare type CiEnvironment = {
name: string;
url: string;
buildNumber: string;
buildNumber?: string;
git?: Git;

@@ -6,0 +6,0 @@ };

@@ -9,10 +9,4 @@ "use strict";

describe('removeUserInfoFromUrl', function () {
it('returns undefined for undefined', function () {
assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)(undefined), undefined);
});
it('returns null for null', function () {
assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)(null), null);
});
it('returns empty string for empty string', function () {
assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)(null), null);
assert_1.default.strictEqual((0, detectCiEnvironment_js_1.removeUserInfoFromUrl)(''), '');
});

@@ -19,0 +13,0 @@ it('leaves the data intact when no sensitive information is detected', function () {

@@ -22,3 +22,2 @@ // This file is auto-generated using npm run build-ci-environments

branch: '${bamboo_planRepository_branch}',
tag: null,
},

@@ -67,3 +66,2 @@ },

branch: '${CF_BRANCH}',
tag: null,
},

@@ -79,3 +77,2 @@ },

branch: '${CI_BRANCH}',
tag: null,
},

@@ -113,3 +110,2 @@ },

branch: '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}',
tag: null,
},

@@ -125,3 +121,2 @@ },

branch: '${GIT_LOCAL_BRANCH}',
tag: null,
},

@@ -159,3 +154,2 @@ },

branch: '${WERCKER_GIT_BRANCH}',
tag: null,
},

@@ -162,0 +156,0 @@ },

@@ -25,12 +25,13 @@ import { CiEnvironments } from './CiEnvironments.js';

function detectGit(ciEnvironment, env) {
const revision = evaluateVariableExpression(ciEnvironment.git.revision, env);
var _a, _b, _c, _d;
const revision = evaluateVariableExpression((_a = ciEnvironment.git) === null || _a === void 0 ? void 0 : _a.revision, env);
if (!revision) {
return undefined;
}
const remote = evaluateVariableExpression(ciEnvironment.git.remote, env);
const remote = evaluateVariableExpression((_b = ciEnvironment.git) === null || _b === void 0 ? void 0 : _b.remote, env);
if (!remote) {
return undefined;
}
const tag = evaluateVariableExpression(ciEnvironment.git.tag, env);
const branch = evaluateVariableExpression(ciEnvironment.git.branch, env);
const tag = evaluateVariableExpression((_c = ciEnvironment.git) === null || _c === void 0 ? void 0 : _c.tag, env);
const branch = evaluateVariableExpression((_d = ciEnvironment.git) === null || _d === void 0 ? void 0 : _d.branch, env);
return Object.assign(Object.assign({ revision, remote: removeUserInfoFromUrl(remote) }, (tag && { tag })), (branch && { branch }));

@@ -40,3 +41,2 @@ }

const url = evaluateVariableExpression(ciEnvironment.url, env);
const buildNumber = evaluateVariableExpression(ciEnvironment.buildNumber, env);
if (url === undefined) {

@@ -47,2 +47,3 @@ // The url is what consumers will use as the primary key for a build

}
const buildNumber = evaluateVariableExpression(ciEnvironment.buildNumber, env);
const git = detectGit(ciEnvironment, env);

@@ -49,0 +50,0 @@ return Object.assign({ name: ciEnvironment.name, url,

import detectCiEnvironment from './detectCiEnvironment.js';
export * from './types.js';
export default detectCiEnvironment;
//# sourceMappingURL=index.d.ts.map
import detectCiEnvironment from './detectCiEnvironment.js';
export * from './types.js';
export default detectCiEnvironment;
//# sourceMappingURL=index.js.map
export declare type CiEnvironment = {
name: string;
url: string;
buildNumber: string;
buildNumber?: string;
git?: Git;

@@ -6,0 +6,0 @@ };

import assert from 'assert';
import { removeUserInfoFromUrl } from '../src/detectCiEnvironment.js';
describe('removeUserInfoFromUrl', () => {
it('returns undefined for undefined', () => {
assert.strictEqual(removeUserInfoFromUrl(undefined), undefined);
});
it('returns null for null', () => {
assert.strictEqual(removeUserInfoFromUrl(null), null);
});
it('returns empty string for empty string', () => {
assert.strictEqual(removeUserInfoFromUrl(null), null);
assert.strictEqual(removeUserInfoFromUrl(''), '');
});

@@ -13,0 +7,0 @@ it('leaves the data intact when no sensitive information is detected', () => {

{
"name": "@cucumber/ci-environment",
"version": "8.1.0",
"version": "9.0.0",
"description": "Detect CI Environment from environment variables",

@@ -47,9 +47,9 @@ "type": "module",

"@types/glob": "7.2.0",
"@types/mocha": "9.0.0",
"@types/node": "17.0.6",
"@typescript-eslint/eslint-plugin": "5.8.1",
"@typescript-eslint/parser": "5.8.1",
"eslint": "8.6.0",
"@types/mocha": "9.1.0",
"@types/node": "17.0.12",
"@typescript-eslint/eslint-plugin": "5.10.1",
"@typescript-eslint/parser": "5.10.1",
"eslint": "8.7.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-node": "11.1.0",

@@ -59,7 +59,7 @@ "eslint-plugin-prettier": "4.0.0",

"glob": "7.2.0",
"mocha": "9.1.3",
"mocha": "9.2.0",
"prettier": "2.5.1",
"shx": "0.3.3",
"shx": "0.3.4",
"ts-node": "10.4.0",
"typescript": "4.5.4"
"typescript": "4.5.5"
},

@@ -66,0 +66,0 @@ "directories": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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