Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 27, 2024
1 parent c9f5679 commit 41d949a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pyscript.core/src/plugins/py-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ async function execute({ currentTarget }) {
const { config } = this;
if (config) {
details.configURL = config;
const { parse } = config.endsWith('.toml')
const { parse } = config.endsWith(".toml")
? await import(/* webpackIgnore: true */ "../3rd-party/toml.js")
: JSON
details.config = parse(await fetch(config).then(r => r.text()));
: JSON;
details.config = parse(await fetch(config).then((r) => r.text()));
}

const xworker = XWorker.call(new Hook(null, hooks), srcLink, details);
Expand Down Expand Up @@ -158,7 +158,9 @@ const init = async (script, type, interpreter) => {
const context = {
interpreter,
env,
config: hasConfig && new URL(script.getAttribute("config"), location.href).href,
config:
hasConfig &&
new URL(script.getAttribute("config"), location.href).href,
get pySrc() {
return isSetup ? source : editor.state.doc.toString();
},
Expand Down

0 comments on commit 41d949a

Please sign in to comment.