diff --git a/__tests__/utils.test.ts b/__tests__/utils.test.ts index 9e7b4be7..7eaec679 100644 --- a/__tests__/utils.test.ts +++ b/__tests__/utils.test.ts @@ -136,6 +136,9 @@ describe('Utils tests', () => { 'b=3, 4', 'c=5' ]); + expect( + await utils.CSVArray('a=E_ALL, b=E_ALL & ~ E_ALL, c="E_ALL", d=\'E_ALL\'') + ).toEqual(['a=E_ALL', 'b=E_ALL & ~ E_ALL', 'c=E_ALL', 'd=E_ALL']); expect(await utils.CSVArray('')).toEqual([]); expect(await utils.CSVArray(' ')).toEqual([]); }); diff --git a/dist/index.js b/dist/index.js index e2190853..75cbe17e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1285,7 +1285,7 @@ async function CSVArray(values_csv) { return value .trim() .replace(/^["']|["']$|(?<==)["']/g, '') - .replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'"); + .replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'"); }) .filter(Boolean); } diff --git a/src/utils.ts b/src/utils.ts index 5391cc59..cb3af9c0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -273,7 +273,7 @@ export async function CSVArray(values_csv: string): Promise> { return value .trim() .replace(/^["']|["']$|(?<==)["']/g, '') - .replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'"); + .replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'"); }) .filter(Boolean); }