@ac-kit/format-shell 0.1.1 → 0.1.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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/command/escape-posix-sh-command.d.ts +4 -3
- package/dist/command/escape-posix-sh-command.d.ts.map +1 -1
- package/dist/command/escape-posix-sh-command.js +4 -3
- package/dist/command/escape-posix-sh-command.js.map +1 -1
- package/dist/command/escape-win32-cmd-command.d.ts +1 -1
- package/dist/command/escape-win32-cmd-command.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -65,5 +65,5 @@ when the caller decides it means something else. `toProcessEnv` and
|
|
|
65
65
|
## Usage
|
|
66
66
|
|
|
67
67
|
See the
|
|
68
|
-
[generated API docs](https://anthochamp.
|
|
68
|
+
[generated API docs](https://anthochamp.pages.grenadine.io/node-essentials/api/format-shell/)
|
|
69
69
|
for the full reference.
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* POSIX-compliant shell command into executing arbitrary commands.
|
|
4
4
|
*
|
|
5
5
|
* It escapes the following characters by adding a backslash before them:
|
|
6
|
-
*
|
|
6
|
+
* ``&#;`|*?~<>^()[]{}$``, `\n` and `\xFF`.
|
|
7
7
|
*
|
|
8
|
-
* The characters ' and " are escaped only if they are not paired.
|
|
8
|
+
* The characters `'` and `"` are escaped only if they are not paired.
|
|
9
9
|
*
|
|
10
10
|
* Based on PHP escapeshellcmd:
|
|
11
11
|
* https://www.php.net/manual/en/function.escapeshellcmd.php
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* Source code:
|
|
14
14
|
* https://github.com/php/php-src/blob/d85662d6cc2c6d5f69403f6fb2001ff78e1bd174/ext/standard/exec.c#L270
|
|
15
15
|
*
|
|
16
|
-
* @param cmd The command to escape
|
|
16
|
+
* @param cmd The command to escape
|
|
17
|
+
* @returns The escaped command
|
|
17
18
|
*/
|
|
18
19
|
export declare function escapePosixShCommand(cmd: string): string;
|
|
19
20
|
//# sourceMappingURL=escape-posix-sh-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escape-posix-sh-command.d.ts","sourceRoot":"","sources":["../../src/command/escape-posix-sh-command.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"escape-posix-sh-command.d.ts","sourceRoot":"","sources":["../../src/command/escape-posix-sh-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAoCxD"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* POSIX-compliant shell command into executing arbitrary commands.
|
|
4
4
|
*
|
|
5
5
|
* It escapes the following characters by adding a backslash before them:
|
|
6
|
-
*
|
|
6
|
+
* ``&#;`|*?~<>^()[]{}$``, `\n` and `\xFF`.
|
|
7
7
|
*
|
|
8
|
-
* The characters ' and " are escaped only if they are not paired.
|
|
8
|
+
* The characters `'` and `"` are escaped only if they are not paired.
|
|
9
9
|
*
|
|
10
10
|
* Based on PHP escapeshellcmd:
|
|
11
11
|
* https://www.php.net/manual/en/function.escapeshellcmd.php
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* Source code:
|
|
14
14
|
* https://github.com/php/php-src/blob/d85662d6cc2c6d5f69403f6fb2001ff78e1bd174/ext/standard/exec.c#L270
|
|
15
15
|
*
|
|
16
|
-
* @param cmd The command to escape
|
|
16
|
+
* @param cmd The command to escape
|
|
17
|
+
* @returns The escaped command
|
|
17
18
|
*/
|
|
18
19
|
export function escapePosixShCommand(cmd) {
|
|
19
20
|
// Escape any of the special characters with a backslash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escape-posix-sh-command.js","sourceRoot":"","sources":["../../src/command/escape-posix-sh-command.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"escape-posix-sh-command.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,CAAC;AACf,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* cmd.exe command into executing arbitrary commands.
|
|
4
4
|
*
|
|
5
5
|
* It escapes the following characters by adding a caret (^) before them:
|
|
6
|
-
* '"%!&#;`|*?~<>^()[]{}
|
|
6
|
+
* ``'"%!&#;`|*?~<>^()[]{}$``, `\n` and `\xFF`.
|
|
7
7
|
*
|
|
8
8
|
* Based on PHP escapeshellcmd:
|
|
9
9
|
* https://www.php.net/manual/en/function.escapeshellcmd.php
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* cmd.exe command into executing arbitrary commands.
|
|
4
4
|
*
|
|
5
5
|
* It escapes the following characters by adding a caret (^) before them:
|
|
6
|
-
* '"%!&#;`|*?~<>^()[]{}
|
|
6
|
+
* ``'"%!&#;`|*?~<>^()[]{}$``, `\n` and `\xFF`.
|
|
7
7
|
*
|
|
8
8
|
* Based on PHP escapeshellcmd:
|
|
9
9
|
* https://www.php.net/manual/en/function.escapeshellcmd.php
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/format-shell",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Shell syntax: command-line quoting per shell dialect, and environment variable parsing and printing per env syntax.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dotenv",
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"quoting",
|
|
11
11
|
"shell"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://anthochamp.
|
|
13
|
+
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/format-shell/",
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://
|
|
15
|
+
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
16
16
|
},
|
|
17
17
|
"license": "BSD-3-Clause",
|
|
18
18
|
"author": "Anthony Champagne <dev@anthonychampagne.fr>",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://
|
|
21
|
+
"url": "git+https://git.grenadine.io/anthochamp/node-essentials.git",
|
|
22
22
|
"directory": "packages/format-shell"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"prepack": "yarn build"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@ac-kit/core": "^0.
|
|
49
|
+
"@ac-kit/core": "^0.4.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@ac-kit/tsconfig": "0.1.0",
|