esmate 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils.js +3 -2
- package/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -3,8 +3,9 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_child_process_27f17141__ from "node:c
|
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
5
5
|
function mapArgs(command, args) {
|
|
6
|
-
args?.
|
|
7
|
-
|
|
6
|
+
if (args?.length === 0) command = command.replace(/\$\d+/g, "");
|
|
7
|
+
else args?.forEach((arg, index)=>{
|
|
8
|
+
command = command.replace(`$${index + 1}`, arg);
|
|
8
9
|
});
|
|
9
10
|
return command;
|
|
10
11
|
}
|