Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jan 9, 2024
1 parent 79dc527 commit cad4fcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
17 changes: 4 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ import { WebWorkerKernel } from './web_worker_kernel';

// helper function to fetch json
async function getJson(url: string) {
const json_url = URLExt.join(
PageConfig.getBaseUrl(),
url,
);
const json_url = URLExt.join(PageConfig.getBaseUrl(), url);

const response = await fetch(json_url);
return JSON.parse(await response.text());
}

export const xeusKernelsPlugin: JupyterLiteServerPlugin<void> = {
id: `@jupyterlite/xeus:register-kernels`,
id: '@jupyterlite/xeus:register-kernels',
autoStart: true,
requires: [IKernelSpecs],
optional: [IServiceWorkerManager, IBroadcastChannelWrapper],
Expand All @@ -51,14 +48,8 @@ export const xeusKernelsPlugin: JupyterLiteServerPlugin<void> = {
kernelspec.name = kernel_dir;
kernelspec.dir = kernel_dir;
kernelspec.resources = {
'logo-32x32':
'xeus/kernels/' +
kernel_dir +
'/logo-32x32.png',
'logo-64x64':
'xeus/kernels/' +
kernel_dir +
'/logo-64x64.png'
'logo-32x32': 'xeus/kernels/' + kernel_dir + '/logo-32x32.png',
'logo-64x64': 'xeus/kernels/' + kernel_dir + '/logo-64x64.png'
};

kernelspecs.register({
Expand Down
9 changes: 3 additions & 6 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ class XeusKernel {
const binary_js = this._kernelspec.argv[0];
const binary_wasm = binary_js.replace('.js', '.wasm');

importScripts(URLExt.join(
PageConfig.getBaseUrl(),
binary_js,
));
importScripts(URLExt.join(PageConfig.getBaseUrl(), binary_js));
globalThis.Module = await createXeusModule({
locateFile: (file: string) => {
if (file.endsWith('.wasm')) {
Expand All @@ -190,11 +187,11 @@ class XeusKernel {
if (globalThis.Module['async_init'] !== undefined) {
const kernel_root_url = URLExt.join(
PageConfig.getBaseUrl(),
`xeus/kernels/${dir}`,
`xeus/kernels/${dir}`
);
const pkg_root_url = URLExt.join(
PageConfig.getBaseUrl(),
'xeus/kernel_packages',
'xeus/kernel_packages'
);
const verbose = true;
await globalThis.Module['async_init'](
Expand Down

0 comments on commit cad4fcd

Please sign in to comment.