@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.
Files changed (126) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/big-int/is-safe-number.d.ts +20 -0
  3. package/dist/big-int/is-safe-number.d.ts.map +1 -0
  4. package/dist/big-int/is-safe-number.js +24 -0
  5. package/dist/big-int/is-safe-number.js.map +1 -0
  6. package/dist/guards/has-object-prototype.d.ts +27 -0
  7. package/dist/guards/has-object-prototype.d.ts.map +1 -0
  8. package/dist/guards/has-object-prototype.js +30 -0
  9. package/dist/guards/has-object-prototype.js.map +1 -0
  10. package/dist/guards/is-object.d.ts +28 -2
  11. package/dist/guards/is-object.d.ts.map +1 -1
  12. package/dist/guards/is-object.js +28 -2
  13. package/dist/guards/is-object.js.map +1 -1
  14. package/dist/guards/is-pojo.d.ts +27 -2
  15. package/dist/guards/is-pojo.d.ts.map +1 -1
  16. package/dist/guards/is-pojo.js +27 -2
  17. package/dist/guards/is-pojo.js.map +1 -1
  18. package/dist/index.d.ts +11 -13
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +11 -13
  21. package/dist/index.js.map +1 -1
  22. package/dist/json/replacers/big-int.d.ts.map +1 -1
  23. package/dist/json/replacers/big-int.js +2 -5
  24. package/dist/json/replacers/big-int.js.map +1 -1
  25. package/dist/number/parse-number-or-big-int.d.ts +30 -0
  26. package/dist/number/parse-number-or-big-int.d.ts.map +1 -0
  27. package/dist/number/parse-number-or-big-int.js +44 -0
  28. package/dist/number/parse-number-or-big-int.js.map +1 -0
  29. package/dist/object/defaults.d.ts.map +1 -1
  30. package/dist/object/defaults.js +11 -4
  31. package/dist/object/defaults.js.map +1 -1
  32. package/dist/object/get-at-path.d.ts +5 -0
  33. package/dist/object/get-at-path.d.ts.map +1 -1
  34. package/dist/object/get-at-path.js +5 -0
  35. package/dist/object/get-at-path.js.map +1 -1
  36. package/dist/object/is-unsafe-record-key.d.ts +26 -0
  37. package/dist/object/is-unsafe-record-key.d.ts.map +1 -0
  38. package/dist/object/is-unsafe-record-key.js +28 -0
  39. package/dist/object/is-unsafe-record-key.js.map +1 -0
  40. package/dist/object/merge-inplace.d.ts.map +1 -1
  41. package/dist/object/merge-inplace.js +4 -2
  42. package/dist/object/merge-inplace.js.map +1 -1
  43. package/dist/object/merge.d.ts.map +1 -1
  44. package/dist/object/merge.js +4 -2
  45. package/dist/object/merge.js.map +1 -1
  46. package/dist/object/null-if-empty.d.ts +12 -0
  47. package/dist/object/null-if-empty.d.ts.map +1 -0
  48. package/dist/object/null-if-empty.js +17 -0
  49. package/dist/object/null-if-empty.js.map +1 -0
  50. package/dist/object/set-at-path.d.ts +5 -0
  51. package/dist/object/set-at-path.d.ts.map +1 -1
  52. package/dist/object/set-at-path.js +10 -3
  53. package/dist/object/set-at-path.js.map +1 -1
  54. package/dist/object/set-record-entry.d.ts +32 -0
  55. package/dist/object/set-record-entry.d.ts.map +1 -0
  56. package/dist/object/set-record-entry.js +43 -0
  57. package/dist/object/set-record-entry.js.map +1 -0
  58. package/dist/object/traverse.js +3 -3
  59. package/dist/object/traverse.js.map +1 -1
  60. package/dist/system/fs/escape-posix-path.d.ts.map +1 -0
  61. package/dist/system/fs/escape-posix-path.js.map +1 -0
  62. package/dist/system/fs/escape-win32-path.d.ts.map +1 -0
  63. package/dist/system/fs/escape-win32-path.js.map +1 -0
  64. package/dist/system/net/ephemeral-port.d.ts.map +1 -0
  65. package/dist/system/net/ephemeral-port.js.map +1 -0
  66. package/dist/system/net/inet-address.d.ts.map +1 -0
  67. package/dist/system/net/inet-address.js.map +1 -0
  68. package/dist/system/net/inet-endpoint.d.ts.map +1 -0
  69. package/dist/system/net/inet-endpoint.js.map +1 -0
  70. package/package.json +2 -2
  71. package/dist/guards/is-plain-object.d.ts +0 -8
  72. package/dist/guards/is-plain-object.d.ts.map +0 -1
  73. package/dist/guards/is-plain-object.js +0 -11
  74. package/dist/guards/is-plain-object.js.map +0 -1
  75. package/dist/net/ephemeral-port.d.ts.map +0 -1
  76. package/dist/net/ephemeral-port.js.map +0 -1
  77. package/dist/net/inet-address.d.ts.map +0 -1
  78. package/dist/net/inet-address.js.map +0 -1
  79. package/dist/net/inet-endpoint.d.ts.map +0 -1
  80. package/dist/net/inet-endpoint.js.map +0 -1
  81. package/dist/shell/fs/escape-posix-path.d.ts.map +0 -1
  82. package/dist/shell/fs/escape-posix-path.js.map +0 -1
  83. package/dist/shell/fs/escape-win32-path.d.ts.map +0 -1
  84. package/dist/shell/fs/escape-win32-path.js.map +0 -1
  85. package/dist/shell/process/parse-env-variable.d.ts +0 -43
  86. package/dist/shell/process/parse-env-variable.d.ts.map +0 -1
  87. package/dist/shell/process/parse-env-variable.js +0 -109
  88. package/dist/shell/process/parse-env-variable.js.map +0 -1
  89. package/dist/shell/process/stringify-env-variable.d.ts +0 -50
  90. package/dist/shell/process/stringify-env-variable.d.ts.map +0 -1
  91. package/dist/shell/process/stringify-env-variable.js +0 -86
  92. package/dist/shell/process/stringify-env-variable.js.map +0 -1
  93. package/dist/shell/process/types.d.ts +0 -7
  94. package/dist/shell/process/types.d.ts.map +0 -1
  95. package/dist/shell/process/types.js +0 -2
  96. package/dist/shell/process/types.js.map +0 -1
  97. package/dist/shell/shell/escape-posix-sh-command-arg.d.ts +0 -20
  98. package/dist/shell/shell/escape-posix-sh-command-arg.d.ts.map +0 -1
  99. package/dist/shell/shell/escape-posix-sh-command-arg.js +0 -26
  100. package/dist/shell/shell/escape-posix-sh-command-arg.js.map +0 -1
  101. package/dist/shell/shell/escape-posix-sh-command.d.ts +0 -19
  102. package/dist/shell/shell/escape-posix-sh-command.d.ts.map +0 -1
  103. package/dist/shell/shell/escape-posix-sh-command.js +0 -55
  104. package/dist/shell/shell/escape-posix-sh-command.js.map +0 -1
  105. package/dist/shell/shell/escape-posix-sh-sqe.d.ts +0 -13
  106. package/dist/shell/shell/escape-posix-sh-sqe.d.ts.map +0 -1
  107. package/dist/shell/shell/escape-posix-sh-sqe.js +0 -15
  108. package/dist/shell/shell/escape-posix-sh-sqe.js.map +0 -1
  109. package/dist/shell/shell/escape-win32-cmd-command-arg.d.ts +0 -20
  110. package/dist/shell/shell/escape-win32-cmd-command-arg.d.ts.map +0 -1
  111. package/dist/shell/shell/escape-win32-cmd-command-arg.js +0 -29
  112. package/dist/shell/shell/escape-win32-cmd-command-arg.js.map +0 -1
  113. package/dist/shell/shell/escape-win32-cmd-command.d.ts +0 -18
  114. package/dist/shell/shell/escape-win32-cmd-command.d.ts.map +0 -1
  115. package/dist/shell/shell/escape-win32-cmd-command.js +0 -20
  116. package/dist/shell/shell/escape-win32-cmd-command.js.map +0 -1
  117. /package/dist/{shell → system}/fs/escape-posix-path.d.ts +0 -0
  118. /package/dist/{shell → system}/fs/escape-posix-path.js +0 -0
  119. /package/dist/{shell → system}/fs/escape-win32-path.d.ts +0 -0
  120. /package/dist/{shell → system}/fs/escape-win32-path.js +0 -0
  121. /package/dist/{net → system/net}/ephemeral-port.d.ts +0 -0
  122. /package/dist/{net → system/net}/ephemeral-port.js +0 -0
  123. /package/dist/{net → system/net}/inet-address.d.ts +0 -0
  124. /package/dist/{net → system/net}/inet-address.js +0 -0
  125. /package/dist/{net → system/net}/inet-endpoint.d.ts +0 -0
  126. /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