Skip to content
Snippets Groups Projects
Unverified Commit 415f5cbb authored by Pierre Cavin's avatar Pierre Cavin Committed by GitHub
Browse files

fix(hex): fix Elixir's special operator in list (#33325)

parent ab1ed9c4
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,7 @@ describe('modules/versioning/hex/index', () => {
${'~> 1.2.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.0'}
${'~> 1.2.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'}
${'~> 1.2.0'} | ${'bump'} | ${'1.2.3'} | ${'2.0.7'} | ${'~> 2.0.7'}
${'~> 0.2 and <= 0.2.6'} | ${'widen'} | ${'0.2.6'} | ${'0.2.8'} | ${'~> 0.2 and <= 0.2.8'}
${'>= 1.0.0 and <= 2.0.0'} | ${'widen'} | ${'1.2.3'} | ${'2.0.7'} | ${'>= 1.0.0 and <= 2.0.7'}
${'>= 1.0.0 and <= 2.0.0'} | ${'replace'} | ${'1.2.3'} | ${'2.0.7'} | ${'<= 2.0.7'}
${'>= 1.0.0 and <= 2.0.0'} | ${'pin'} | ${'1.2.3'} | ${'2.0.7'} | ${'== 2.0.7'}
......
......@@ -31,7 +31,7 @@ function npm2hex(input: string): string {
.map((str) => str.trim())
.filter((str) => str !== '');
let output = '';
const operators = ['^', '=', '>', '<', '<=', '>=', '~'];
const operators = ['^', '=', '>', '<', '<=', '>=', '~>'];
for (let i = 0; i < res.length; i += 1) {
if (i === res.length - 1) {
output += res[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment