Skip to content

Commit

Permalink
Feature/sof 6134 (#25)
Browse files Browse the repository at this point in the history
* chore: use instance instead of simple object

* chore: avoid crash when no pseudo provided

* chore: use object from pseudo property
  • Loading branch information
azech-hqs authored May 24, 2023
1 parent ea9c83c commit 14e2a02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/context/providers/espresso/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Made } from "@exabyte-io/made.js";
import { PERIODIC_TABLE } from "@exabyte-io/periodic-table.js";
import lodash from "lodash";
import { mix } from "mixwith";
import path from "path";
import s from "underscore.string";

import { ExecutableContextProvider } from "../../providers";
Expand Down Expand Up @@ -123,9 +124,7 @@ export class QEPWXContextProvider extends mix(ExecutableContextProvider).with(

static symbolToAtomicSpecie(symbol, pseudo) {
const el = PERIODIC_TABLE[symbol];
const filename = pseudo
? lodash.get(pseudo, "filename", s.strRightBack(pseudo.path, "/"))
: "";
const filename = pseudo?.filename || path.basename(pseudo?.path || "");
return el ? s.sprintf("%s %f %s", symbol, el.atomic_mass, filename) : undefined;
}
}
Expand Down

0 comments on commit 14e2a02

Please sign in to comment.