command-join
Advanced tools
Comparing version 2.0.1 to 3.0.0
@@ -1,3 +0,4 @@ | ||
declare function commandJoin(arg: string | readonly string[]): string; | ||
export = commandJoin; | ||
export declare function joinNix(arr: readonly string[]): string; | ||
export declare function joinWin(arr: readonly string[]): string; | ||
export declare function commandJoin(arg: string | readonly string[]): string; | ||
//# sourceMappingURL=command-join.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const NEEDS_QUOTE = /[\s\\*\?\[\]`$()#<>|&;]/; | ||
@@ -49,2 +50,3 @@ function joinNix(arr) { | ||
} | ||
exports.joinNix = joinNix; | ||
function joinWin(arr) { | ||
@@ -99,2 +101,3 @@ const out = []; | ||
} | ||
exports.joinWin = joinWin; | ||
function commandJoin(arg) { | ||
@@ -112,3 +115,3 @@ if (typeof arg === 'string') { | ||
} | ||
module.exports = commandJoin; | ||
exports.commandJoin = commandJoin; | ||
//# sourceMappingURL=command-join.js.map |
{ | ||
"name": "command-join", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Escape and join command-line arguments, cross-platform.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -14,7 +14,7 @@ # command-join | ||
```javascript | ||
const commandJoin = require('command-join') | ||
```typescript | ||
import { commandJoin } from "command-join" | ||
``` | ||
### `commandJoin(arg: Array|String): String` | ||
### `commandJoin(arg: string | string[]): string` | ||
@@ -28,3 +28,3 @@ Escapes each command-line argument and joins them into a string that can then be executed, e.g. via `child_process.exec`. | ||
```javascript | ||
let command = commandJoin(['a', "b\\", "'c"]) | ||
const command = commandJoin(['a', "b\\", "'c"]) | ||
command | ||
@@ -36,1 +36,9 @@ // output on Windows: a "b\\" 'c | ||
See the tests for more convoluted examples. | ||
## Migrating | ||
**Migrating to v3**: | ||
```diff | ||
- const commandJoin = require("command-join") | ||
+ const { commandJoin } = require("command-join") | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
10728
116
42
0