@staff0rd/assist 0.794.0 → 0.795.1

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/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@staff0rd/assist",
9
- version: "0.794.0",
9
+ version: "0.795.1",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -18862,13 +18862,33 @@ function unquote(value) {
18862
18862
  return value.replace(/['"]/g, "");
18863
18863
  }
18864
18864
 
18865
+ // src/commands/cliHook/splitSubstitutionTokens.ts
18866
+ var OPENER = /^(?:\w+=)?(?:\$\(|`|\()+/;
18867
+ var CLOSER = /[)`]+$/;
18868
+ var SUBSTITUTION_CLOSE = ")";
18869
+ function splitSubstitutionTokens(tokens) {
18870
+ return tokens.flatMap((token) => {
18871
+ const body = token.replace(OPENER, "");
18872
+ if (/['"]$/.test(body) || !CLOSER.test(body)) return body ? [body] : [];
18873
+ const inner = body.replace(CLOSER, "");
18874
+ return inner ? [inner, SUBSTITUTION_CLOSE] : [SUBSTITUTION_CLOSE];
18875
+ });
18876
+ }
18877
+
18865
18878
  // src/commands/cliHook/isGhIssueApiWrite.ts
18866
18879
  var WRITE_METHODS = /* @__PURE__ */ new Set(["POST", "PATCH", "PUT", "DELETE"]);
18867
18880
  var BODY_FLAGS = ["-f", "-F", "--field", "--raw-field", "--input"];
18868
- var COMMAND_OPERATORS = /* @__PURE__ */ new Set(["&&", "||", ";", "|", "&"]);
18881
+ var COMMAND_OPERATORS = /* @__PURE__ */ new Set([
18882
+ "&&",
18883
+ "||",
18884
+ ";",
18885
+ "|",
18886
+ "&",
18887
+ SUBSTITUTION_CLOSE
18888
+ ]);
18869
18889
  var ISSUE_ENDPOINT = /(?:^|[/"'`])repos\/[^/\s"'`]+\/[^/\s"'`]+\/issues(?:$|[/?"'`])/;
18870
18890
  function isGhIssueApiWrite(command) {
18871
- const tokens = tokenize(command);
18891
+ const tokens = splitSubstitutionTokens(tokenize(command));
18872
18892
  for (let i = 0; i + 1 < tokens.length; i++) {
18873
18893
  if (tokens[i] !== "gh" || tokens[i + 1] !== "api") continue;
18874
18894
  const args = argsUntilNextCommand(tokens.slice(i + 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.794.0",
3
+ "version": "0.795.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {