1 | ;
|
2 | const arrgv = require('arrgv');
|
3 |
|
4 | function normalizeNodeArguments(fromConf = [], fromArgv = '') {
|
5 | let parsedArgv = [];
|
6 | if (fromArgv !== '') {
|
7 | try {
|
8 | parsedArgv = arrgv(fromArgv);
|
9 | } catch {
|
10 | throw new Error('Could not parse `--node-arguments` value. Make sure all strings are closed and backslashes are used correctly.');
|
11 | }
|
12 | }
|
13 |
|
14 | return [...process.execArgv, ...fromConf, ...parsedArgv];
|
15 | }
|
16 |
|
17 | module.exports = normalizeNodeArguments;
|