Skip to content

Commit

Permalink
Change logic for getting top level URL for Wasm (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
verhovsky committed May 26, 2024
1 parent 9f879f9 commit ed0baa7
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 114 deletions.
175 changes: 68 additions & 107 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "curlconverter",
"version": "4.10.0",
"version": "4.10.1",
"description": "convert curl commands to Python, JavaScript, Go, PHP and more",
"homepage": "https://curlconverter.com",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ import {
import fs from "fs";

// This line is updated by extract_curl_args.py
const VERSION = "4.10.0 (curl 8.2.1)";
const VERSION = "4.10.1 (curl 8.2.1)";

// sets a default in case --language isn't passed
const defaultLanguage = "python";
Expand Down
7 changes: 2 additions & 5 deletions src/shell/webParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import Parser from "web-tree-sitter";
// NOTE: top-level await requires Safari 15+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#browser_compatibility
await Parser.init({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
locateFile(scriptName: string, scriptDirectory: string) {
const url = new URL(scriptDirectory);
url.pathname = "/";
url.search = "";
url.hash = "";
return url.href + scriptName;
return "/" + scriptName;
},
});
const Bash = await Parser.Language.load("/tree-sitter-bash.wasm");
Expand Down

0 comments on commit ed0baa7

Please sign in to comment.