@ac-kit/core 0.1.0 → 0.2.0
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 +74 -0
- package/dist/big-int/is-safe-number.d.ts +20 -0
- package/dist/big-int/is-safe-number.d.ts.map +1 -0
- package/dist/big-int/is-safe-number.js +24 -0
- package/dist/big-int/is-safe-number.js.map +1 -0
- package/dist/guards/has-object-prototype.d.ts +27 -0
- package/dist/guards/has-object-prototype.d.ts.map +1 -0
- package/dist/guards/has-object-prototype.js +30 -0
- package/dist/guards/has-object-prototype.js.map +1 -0
- package/dist/guards/is-object.d.ts +28 -2
- package/dist/guards/is-object.d.ts.map +1 -1
- package/dist/guards/is-object.js +28 -2
- package/dist/guards/is-object.js.map +1 -1
- package/dist/guards/is-pojo.d.ts +27 -2
- package/dist/guards/is-pojo.d.ts.map +1 -1
- package/dist/guards/is-pojo.js +27 -2
- package/dist/guards/is-pojo.js.map +1 -1
- package/dist/index.d.ts +11 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -13
- package/dist/index.js.map +1 -1
- package/dist/json/replacers/big-int.d.ts.map +1 -1
- package/dist/json/replacers/big-int.js +2 -5
- package/dist/json/replacers/big-int.js.map +1 -1
- package/dist/number/parse-number-or-big-int.d.ts +30 -0
- package/dist/number/parse-number-or-big-int.d.ts.map +1 -0
- package/dist/number/parse-number-or-big-int.js +44 -0
- package/dist/number/parse-number-or-big-int.js.map +1 -0
- package/dist/object/defaults.d.ts.map +1 -1
- package/dist/object/defaults.js +11 -4
- package/dist/object/defaults.js.map +1 -1
- package/dist/object/get-at-path.d.ts +5 -0
- package/dist/object/get-at-path.d.ts.map +1 -1
- package/dist/object/get-at-path.js +5 -0
- package/dist/object/get-at-path.js.map +1 -1
- package/dist/object/is-unsafe-record-key.d.ts +26 -0
- package/dist/object/is-unsafe-record-key.d.ts.map +1 -0
- package/dist/object/is-unsafe-record-key.js +28 -0
- package/dist/object/is-unsafe-record-key.js.map +1 -0
- package/dist/object/merge-inplace.d.ts.map +1 -1
- package/dist/object/merge-inplace.js +4 -2
- package/dist/object/merge-inplace.js.map +1 -1
- package/dist/object/merge.d.ts.map +1 -1
- package/dist/object/merge.js +4 -2
- package/dist/object/merge.js.map +1 -1
- package/dist/object/null-if-empty.d.ts +12 -0
- package/dist/object/null-if-empty.d.ts.map +1 -0
- package/dist/object/null-if-empty.js +17 -0
- package/dist/object/null-if-empty.js.map +1 -0
- package/dist/object/set-at-path.d.ts +5 -0
- package/dist/object/set-at-path.d.ts.map +1 -1
- package/dist/object/set-at-path.js +10 -3
- package/dist/object/set-at-path.js.map +1 -1
- package/dist/object/set-record-entry.d.ts +32 -0
- package/dist/object/set-record-entry.d.ts.map +1 -0
- package/dist/object/set-record-entry.js +43 -0
- package/dist/object/set-record-entry.js.map +1 -0
- package/dist/object/traverse.js +3 -3
- package/dist/object/traverse.js.map +1 -1
- package/dist/system/fs/escape-posix-path.d.ts.map +1 -0
- package/dist/system/fs/escape-posix-path.js.map +1 -0
- package/dist/system/fs/escape-win32-path.d.ts.map +1 -0
- package/dist/system/fs/escape-win32-path.js.map +1 -0
- package/dist/system/net/ephemeral-port.d.ts.map +1 -0
- package/dist/system/net/ephemeral-port.js.map +1 -0
- package/dist/system/net/inet-address.d.ts.map +1 -0
- package/dist/system/net/inet-address.js.map +1 -0
- package/dist/system/net/inet-endpoint.d.ts.map +1 -0
- package/dist/system/net/inet-endpoint.js.map +1 -0
- package/package.json +2 -2
- package/dist/guards/is-plain-object.d.ts +0 -8
- package/dist/guards/is-plain-object.d.ts.map +0 -1
- package/dist/guards/is-plain-object.js +0 -11
- package/dist/guards/is-plain-object.js.map +0 -1
- package/dist/net/ephemeral-port.d.ts.map +0 -1
- package/dist/net/ephemeral-port.js.map +0 -1
- package/dist/net/inet-address.d.ts.map +0 -1
- package/dist/net/inet-address.js.map +0 -1
- package/dist/net/inet-endpoint.d.ts.map +0 -1
- package/dist/net/inet-endpoint.js.map +0 -1
- package/dist/shell/fs/escape-posix-path.d.ts.map +0 -1
- package/dist/shell/fs/escape-posix-path.js.map +0 -1
- package/dist/shell/fs/escape-win32-path.d.ts.map +0 -1
- package/dist/shell/fs/escape-win32-path.js.map +0 -1
- package/dist/shell/process/parse-env-variable.d.ts +0 -43
- package/dist/shell/process/parse-env-variable.d.ts.map +0 -1
- package/dist/shell/process/parse-env-variable.js +0 -109
- package/dist/shell/process/parse-env-variable.js.map +0 -1
- package/dist/shell/process/stringify-env-variable.d.ts +0 -50
- package/dist/shell/process/stringify-env-variable.d.ts.map +0 -1
- package/dist/shell/process/stringify-env-variable.js +0 -86
- package/dist/shell/process/stringify-env-variable.js.map +0 -1
- package/dist/shell/process/types.d.ts +0 -7
- package/dist/shell/process/types.d.ts.map +0 -1
- package/dist/shell/process/types.js +0 -2
- package/dist/shell/process/types.js.map +0 -1
- package/dist/shell/shell/escape-posix-sh-command-arg.d.ts +0 -20
- package/dist/shell/shell/escape-posix-sh-command-arg.d.ts.map +0 -1
- package/dist/shell/shell/escape-posix-sh-command-arg.js +0 -26
- package/dist/shell/shell/escape-posix-sh-command-arg.js.map +0 -1
- package/dist/shell/shell/escape-posix-sh-command.d.ts +0 -19
- package/dist/shell/shell/escape-posix-sh-command.d.ts.map +0 -1
- package/dist/shell/shell/escape-posix-sh-command.js +0 -55
- package/dist/shell/shell/escape-posix-sh-command.js.map +0 -1
- package/dist/shell/shell/escape-posix-sh-sqe.d.ts +0 -13
- package/dist/shell/shell/escape-posix-sh-sqe.d.ts.map +0 -1
- package/dist/shell/shell/escape-posix-sh-sqe.js +0 -15
- package/dist/shell/shell/escape-posix-sh-sqe.js.map +0 -1
- package/dist/shell/shell/escape-win32-cmd-command-arg.d.ts +0 -20
- package/dist/shell/shell/escape-win32-cmd-command-arg.d.ts.map +0 -1
- package/dist/shell/shell/escape-win32-cmd-command-arg.js +0 -29
- package/dist/shell/shell/escape-win32-cmd-command-arg.js.map +0 -1
- package/dist/shell/shell/escape-win32-cmd-command.d.ts +0 -18
- package/dist/shell/shell/escape-win32-cmd-command.d.ts.map +0 -1
- package/dist/shell/shell/escape-win32-cmd-command.js +0 -20
- package/dist/shell/shell/escape-win32-cmd-command.js.map +0 -1
- /package/dist/{shell → system}/fs/escape-posix-path.d.ts +0 -0
- /package/dist/{shell → system}/fs/escape-posix-path.js +0 -0
- /package/dist/{shell → system}/fs/escape-win32-path.d.ts +0 -0
- /package/dist/{shell → system}/fs/escape-win32-path.js +0 -0
- /package/dist/{net → system/net}/ephemeral-port.d.ts +0 -0
- /package/dist/{net → system/net}/ephemeral-port.js +0 -0
- /package/dist/{net → system/net}/inet-address.d.ts +0 -0
- /package/dist/{net → system/net}/inet-address.js +0 -0
- /package/dist/{net → system/net}/inet-endpoint.d.ts +0 -0
- /package/dist/{net → system/net}/inet-endpoint.js +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Escape a string to be safely used as a shell argument in Windows cmd.exe
|
|
3
|
-
*
|
|
4
|
-
* It adds double quotes around a string and escapes any existing problematic
|
|
5
|
-
* characters (such as %, !, and ") by replacing them with spaces. Backslashes
|
|
6
|
-
* are escaped by doubling them.
|
|
7
|
-
*
|
|
8
|
-
* Example:
|
|
9
|
-
*
|
|
10
|
-
* ```ts
|
|
11
|
-
* const unsafe = 'A "complex" %string% with !special! chars \\';
|
|
12
|
-
* const safe = escapeShellArgWindows(unsafe);
|
|
13
|
-
* console.log(safe); // "A complex string with special chars \\"
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @param expr The string to escape
|
|
17
|
-
* @returns The escaped string
|
|
18
|
-
*/
|
|
19
|
-
export declare function escapeWin32CmdCommandArg(expr: string): string;
|
|
20
|
-
//# sourceMappingURL=escape-win32-cmd-command-arg.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"escape-win32-cmd-command-arg.d.ts","sourceRoot":"","sources":["../../../src/shell/shell/escape-win32-cmd-command-arg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY7D"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Escape a string to be safely used as a shell argument in Windows cmd.exe
|
|
3
|
-
*
|
|
4
|
-
* It adds double quotes around a string and escapes any existing problematic
|
|
5
|
-
* characters (such as %, !, and ") by replacing them with spaces. Backslashes
|
|
6
|
-
* are escaped by doubling them.
|
|
7
|
-
*
|
|
8
|
-
* Example:
|
|
9
|
-
*
|
|
10
|
-
* ```ts
|
|
11
|
-
* const unsafe = 'A "complex" %string% with !special! chars \\';
|
|
12
|
-
* const safe = escapeShellArgWindows(unsafe);
|
|
13
|
-
* console.log(safe); // "A complex string with special chars \\"
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @param expr The string to escape
|
|
17
|
-
* @returns The escaped string
|
|
18
|
-
*/
|
|
19
|
-
export function escapeWin32CmdCommandArg(expr) {
|
|
20
|
-
if (expr === "") {
|
|
21
|
-
return '""';
|
|
22
|
-
}
|
|
23
|
-
// Replace problematic characters with spaces
|
|
24
|
-
expr = expr.replace(/[%!"]/g, " ");
|
|
25
|
-
// Escape backslashes by double them
|
|
26
|
-
expr = expr.replace(/\\/g, "\\\\");
|
|
27
|
-
return `"${expr}"`;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=escape-win32-cmd-command-arg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"escape-win32-cmd-command-arg.js","sourceRoot":"","sources":["../../../src/shell/shell/escape-win32-cmd-command-arg.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACpD,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,6CAA6C;IAC7C,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEnC,oCAAoC;IACpC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEnC,OAAO,IAAI,IAAI,GAAG,CAAC;AACpB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Escape any characters in a string that might be used to trick a Windows
|
|
3
|
-
* cmd.exe command into executing arbitrary commands.
|
|
4
|
-
*
|
|
5
|
-
* It escapes the following characters by adding a caret (^) before them:
|
|
6
|
-
* '"%!&#;`|*?~<>^()[]{}$, \n and \xFF.
|
|
7
|
-
*
|
|
8
|
-
* Based on PHP escapeshellcmd:
|
|
9
|
-
* https://www.php.net/manual/en/function.escapeshellcmd.php
|
|
10
|
-
*
|
|
11
|
-
* Source code:
|
|
12
|
-
* https://github.com/php/php-src/blob/d85662d6cc2c6d5f69403f6fb2001ff78e1bd174/ext/standard/exec.c#L270
|
|
13
|
-
*
|
|
14
|
-
* @param cmd The command to escape
|
|
15
|
-
* @returns The escaped command
|
|
16
|
-
*/
|
|
17
|
-
export declare function escapeWin32CmdCommand(cmd: string): string;
|
|
18
|
-
//# sourceMappingURL=escape-win32-cmd-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"escape-win32-cmd-command.d.ts","sourceRoot":"","sources":["../../../src/shell/shell/escape-win32-cmd-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Escape any characters in a string that might be used to trick a Windows
|
|
3
|
-
* cmd.exe command into executing arbitrary commands.
|
|
4
|
-
*
|
|
5
|
-
* It escapes the following characters by adding a caret (^) before them:
|
|
6
|
-
* '"%!&#;`|*?~<>^()[]{}$, \n and \xFF.
|
|
7
|
-
*
|
|
8
|
-
* Based on PHP escapeshellcmd:
|
|
9
|
-
* https://www.php.net/manual/en/function.escapeshellcmd.php
|
|
10
|
-
*
|
|
11
|
-
* Source code:
|
|
12
|
-
* https://github.com/php/php-src/blob/d85662d6cc2c6d5f69403f6fb2001ff78e1bd174/ext/standard/exec.c#L270
|
|
13
|
-
*
|
|
14
|
-
* @param cmd The command to escape
|
|
15
|
-
* @returns The escaped command
|
|
16
|
-
*/
|
|
17
|
-
export function escapeWin32CmdCommand(cmd) {
|
|
18
|
-
return cmd.replace(/(['"%!&#;`|*?~<>^()[\]{}$\\\n\xFF])/g, "^$1");
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=escape-win32-cmd-command.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"escape-win32-cmd-command.js","sourceRoot":"","sources":["../../../src/shell/shell/escape-win32-cmd-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAChD,OAAO,GAAG,CAAC,OAAO,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|