@cucumber/create-meta
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -77,12 +77,12 @@ "use strict"; | ||
return value; | ||
const url = url_1.parse(value); | ||
const url = (0, url_1.parse)(value); | ||
if (url.auth === null) | ||
return value; | ||
url.auth = null; | ||
return url_1.format(url); | ||
return (0, url_1.format)(url); | ||
} | ||
exports.removeUserInfoFromUrl = removeUserInfoFromUrl; | ||
function createCi(ciName, ciSystem, envDict) { | ||
const url = evaluateVariableExpression_1.default(ciSystem.url, envDict); | ||
const buildNumber = evaluateVariableExpression_1.default(ciSystem.buildNumber, envDict); | ||
const url = (0, evaluateVariableExpression_1.default)(ciSystem.url, envDict); | ||
const buildNumber = (0, evaluateVariableExpression_1.default)(ciSystem.buildNumber, envDict); | ||
if (url === undefined) { | ||
@@ -93,3 +93,3 @@ // The url is what consumers will use as the primary key for a build | ||
} | ||
const branch = evaluateVariableExpression_1.default(ciSystem.git.branch, envDict); | ||
const branch = (0, evaluateVariableExpression_1.default)(ciSystem.git.branch, envDict); | ||
return { | ||
@@ -100,6 +100,6 @@ name: ciName, | ||
git: { | ||
remote: removeUserInfoFromUrl(evaluateVariableExpression_1.default(ciSystem.git.remote, envDict)), | ||
revision: evaluateVariableExpression_1.default(ciSystem.git.revision, envDict), | ||
remote: removeUserInfoFromUrl((0, evaluateVariableExpression_1.default)(ciSystem.git.remote, envDict)), | ||
revision: (0, evaluateVariableExpression_1.default)(ciSystem.git.revision, envDict), | ||
branch: branch, | ||
tag: evaluateVariableExpression_1.default(ciSystem.git.tag, envDict), | ||
tag: (0, evaluateVariableExpression_1.default)(ciSystem.git.tag, envDict), | ||
}, | ||
@@ -106,0 +106,0 @@ }; |
@@ -24,3 +24,3 @@ "use strict"; | ||
const env = Object.fromEntries(entries); | ||
const ci = createMeta_1.detectCI(ciDict_json_1.default, env); | ||
const ci = (0, createMeta_1.detectCI)(ciDict_json_1.default, env); | ||
stdout.write(JSON.stringify(ci, null, 2) + '\n'); | ||
@@ -27,0 +27,0 @@ }); |
@@ -11,3 +11,3 @@ "use strict"; | ||
it('defines the implementation product', () => { | ||
const meta = createMeta_1.default('someTool', '1.2.3', {}, {}); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', {}, {}); | ||
assert_1.default.strictEqual(meta.implementation.name, 'someTool'); | ||
@@ -25,3 +25,3 @@ assert_1.default.strictEqual(meta.implementation.version, '1.2.3'); | ||
}; | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const ci = { | ||
@@ -48,3 +48,3 @@ name: 'CircleCI', | ||
}; | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const ci = { | ||
@@ -71,3 +71,3 @@ name: 'GitHub Actions', | ||
}; | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const ci = { | ||
@@ -94,3 +94,3 @@ name: 'GitHub Actions', | ||
}; | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const ci = { | ||
@@ -117,3 +117,3 @@ name: 'Azure Pipelines', | ||
}; | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const ci = { | ||
@@ -141,3 +141,3 @@ name: 'Azure Pipelines', | ||
}; | ||
const meta = createMeta_1.default('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const meta = (0, createMeta_1.default)('someTool', '1.2.3', envDict, ciDict_json_1.default); | ||
const ci = { | ||
@@ -144,0 +144,0 @@ git: { |
@@ -11,3 +11,3 @@ "use strict"; | ||
const expression = 'hello-${SOME_VAR}'; | ||
const result = evaluateVariableExpression_1.default(expression, {}); | ||
const result = (0, evaluateVariableExpression_1.default)(expression, {}); | ||
assert_1.default.strictEqual(result, undefined); | ||
@@ -17,3 +17,3 @@ }); | ||
const expression = '${SOME_VAR}'; | ||
const result = evaluateVariableExpression_1.default(expression, { SOME_VAR: 'some_value' }); | ||
const result = (0, evaluateVariableExpression_1.default)(expression, { SOME_VAR: 'some_value' }); | ||
assert_1.default.strictEqual(result, 'some_value'); | ||
@@ -23,3 +23,3 @@ }); | ||
const expression = '${SOME_REF/refs\\/heads\\/(.*)/\\1}'; | ||
const result = evaluateVariableExpression_1.default(expression, { SOME_REF: 'refs/heads/main' }); | ||
const result = (0, evaluateVariableExpression_1.default)(expression, { SOME_REF: 'refs/heads/main' }); | ||
assert_1.default.strictEqual(result, 'main'); | ||
@@ -29,3 +29,3 @@ }); | ||
const expression = '${GO_SCM_*_PR_BRANCH/.*:(.*)/\\1}'; | ||
const result = evaluateVariableExpression_1.default(expression, { | ||
const result = (0, evaluateVariableExpression_1.default)(expression, { | ||
GO_SCM_MY_MATERIAL_PR_BRANCH: 'ashwankthkumar:feature-1', | ||
@@ -37,3 +37,3 @@ }); | ||
const expression = 'hello-${VAR1}-${VAR2/(.*) (.*)/\\2-\\1}-world'; | ||
const result = evaluateVariableExpression_1.default(expression, { | ||
const result = (0, evaluateVariableExpression_1.default)(expression, { | ||
VAR1: 'amazing', | ||
@@ -40,0 +40,0 @@ VAR2: 'gorgeous beautiful', |
@@ -10,22 +10,22 @@ "use strict"; | ||
it('returns undefined for undefined', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl(undefined), undefined); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)(undefined), undefined); | ||
}); | ||
it('returns null for null', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl(null), null); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)(null), null); | ||
}); | ||
it('returns empty string for empty string', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl(null), null); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)(null), null); | ||
}); | ||
it('leaves the data intact when no sensitive information is detected', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl('pretty safe'), 'pretty safe'); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)('pretty safe'), 'pretty safe'); | ||
}); | ||
context('with URLs', () => { | ||
it('leaves intact when no password is found', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl('https://example.com/git/repo.git'), 'https://example.com/git/repo.git'); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)('https://example.com/git/repo.git'), 'https://example.com/git/repo.git'); | ||
}); | ||
it('removes credentials when found', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl('http://login@example.com/git/repo.git'), 'http://example.com/git/repo.git'); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)('http://login@example.com/git/repo.git'), 'http://example.com/git/repo.git'); | ||
}); | ||
it('removes credentials and passwords when found', () => { | ||
assert_1.default.strictEqual(createMeta_1.removeUserInfoFromUrl('ssh://login:password@example.com/git/repo.git'), 'ssh://example.com/git/repo.git'); | ||
assert_1.default.strictEqual((0, createMeta_1.removeUserInfoFromUrl)('ssh://login:password@example.com/git/repo.git'), 'ssh://example.com/git/repo.git'); | ||
}); | ||
@@ -32,0 +32,0 @@ }); |
{ | ||
"name": "@cucumber/create-meta", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "Produce the meta message for Cucumber JavaScript", | ||
@@ -27,11 +27,11 @@ "main": "dist/src/index.js", | ||
"@types/glob": "7.1.4", | ||
"@types/mocha": "8.2.3", | ||
"@types/node": "14.17.5", | ||
"mocha": "9.0.2", | ||
"source-map-support": "0.5.19", | ||
"ts-node": "10.1.0", | ||
"typescript": "4.3.5" | ||
"@types/mocha": "9.0.0", | ||
"@types/node": "14.17.27", | ||
"mocha": "9.1.3", | ||
"source-map-support": "0.5.20", | ||
"ts-node": "10.3.0", | ||
"typescript": "4.4.4" | ||
}, | ||
"dependencies": { | ||
"@cucumber/messages": "^17.0.1" | ||
"@cucumber/messages": "^17.1.1" | ||
}, | ||
@@ -38,0 +38,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
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
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
101025
60
1407
Updated@cucumber/messages@^17.1.1