mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 05:23:03 +07:00
Quote ini values with equal sign
This commit is contained in:
parent
f20012026f
commit
3407e6019c
@ -109,6 +109,9 @@ describe('Utils tests', () => {
|
|||||||
expect(
|
expect(
|
||||||
await utils.CSVArray('a=E_ALL, b=E_ALL & ~ E_ALL, c="E_ALL", d=\'E_ALL\'')
|
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']);
|
).toEqual(['a=E_ALL', 'b=E_ALL & ~ E_ALL', 'c=E_ALL', 'd=E_ALL']);
|
||||||
|
expect(
|
||||||
|
await utils.CSVArray('a="b=c;d=e", b=\'c=d,e\', c="g=h,i=j", d=g=h, a===')
|
||||||
|
).toEqual(["a='b=c;d=e'", "b='c=d,e'", "c='g=h,i=j'", "d='g=h'", "a='=='"]);
|
||||||
expect(await utils.CSVArray('')).toEqual([]);
|
expect(await utils.CSVArray('')).toEqual([]);
|
||||||
expect(await utils.CSVArray(' ')).toEqual([]);
|
expect(await utils.CSVArray(' ')).toEqual([]);
|
||||||
});
|
});
|
||||||
|
3
dist/index.js
vendored
3
dist/index.js
vendored
@ -1172,7 +1172,8 @@ async function CSVArray(values_csv) {
|
|||||||
return value
|
return value
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||||
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'")
|
||||||
|
.replace(/=(.*?)(=.*)/, "='$1$2'");
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,8 @@ export async function CSVArray(values_csv: string): Promise<Array<string>> {
|
|||||||
return value
|
return value
|
||||||
.trim()
|
.trim()
|
||||||
.replace(/^["']|["']$|(?<==)["']/g, '')
|
.replace(/^["']|["']$|(?<==)["']/g, '')
|
||||||
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'");
|
.replace(/=(((?!E_).)*[?{}|&~![()^]+((?!E_).)+)/, "='$1'")
|
||||||
|
.replace(/=(.*?)(=.*)/, "='$1$2'");
|
||||||
})
|
})
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user