From 88c507126b132bb6349dd7d1225ce21ba56fa44f Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Mon, 15 Apr 2024 23:55:54 +0300 Subject: [PATCH] fix: underscore is allowed in environment name --- __tests__/lib/cli/envAlias.js | 1 + src/lib/cli/envAlias.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/__tests__/lib/cli/envAlias.js b/__tests__/lib/cli/envAlias.js index 690db9d5d..d0b70b706 100644 --- a/__tests__/lib/cli/envAlias.js +++ b/__tests__/lib/cli/envAlias.js @@ -17,6 +17,7 @@ describe( 'utils/cli/envAlias', () => { '@1', '@1.env', '@2.MixedCaseEnv', + '@xxx.production_test', ] )( 'should identify valid aliases - %p', alias => { expect( isAlias( alias ) ).toBe( true ); } ); diff --git a/src/lib/cli/envAlias.ts b/src/lib/cli/envAlias.ts index c295500ed..1360feb26 100644 --- a/src/lib/cli/envAlias.ts +++ b/src/lib/cli/envAlias.ts @@ -1,5 +1,5 @@ export function isAlias( alias: string ): boolean { - return /^@[A-Za-z0-9.-]+$/.test( alias ); + return /^@[A-Za-z0-9._-]+$/.test( alias ); } export function parseEnvAlias( alias: string ) {