From 9b95d680b7d4df933093bb3e91eae8f1e713fbdf Mon Sep 17 00:00:00 2001 From: Adithya Krishna Date: Sun, 18 Jun 2023 06:09:54 +0000 Subject: [PATCH] Updated CI Signed-off-by: Adithya Krishna --- .github/workflows/CI.yml | 5 +---- src/utilities.ts | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eef147161..d80d608b0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,10 +30,7 @@ jobs: run: npm install --no-audit - name: Build 3Dmol.js - run: | - npm run build:dev - npm run build:prod - npm run generate:tests + run: npm run build - name: Test run: npm test diff --git a/src/utilities.ts b/src/utilities.ts index 6da7932fb..900b60071 100644 --- a/src/utilities.ts +++ b/src/utilities.ts @@ -169,7 +169,7 @@ export function getPropertyRange(atomlist, prop) { }; -//adapted from https://stackoverflow.com/questions/3969475/javascript-pause-settimeout +// Adapted from https://stackoverflow.com/questions/3969475/javascript-pause-settimeout export class PausableTimer { ident: any; total_time_run = 0; @@ -278,22 +278,25 @@ export function specStringToObject(str) { } - str = str.replace(/%7E/, '~'); //copy/pasting urls sometimes does this - //convert things that look like numbers into numbers + // Copy/pasting URLs sometimes does this + str = str.replace(/%7E/g, '~'); + + // Convert things that look like numbers into numbers var massage = function (val) { if (isNumeric(val)) { - //hexadecimal does not parse as float + // Hexadecimal does not parse as float if (Math.floor(parseFloat(val)) == parseInt(val)) { return parseFloat(val); } else if (val.indexOf('.') >= 0) { - return parseFloat(val); // ".7" for example, does not parseInt + // ".7" for example, does not parseInt + return parseFloat(val); } else { return parseInt(val); } } - //boolean conversions + // Boolean conversions else if (val === 'true') { return true; } @@ -314,7 +317,7 @@ export function specStringToObject(str) { if (vstr) { vstr = vstr.replace(/~/g, "="); if (vstr.indexOf('=') !== -1) { - //has key=value pairs, must be object + // Has key=value pairs, must be object var kvs = vstr.split(','); for (var j = 0; j < kvs.length; j++) { var kv = kvs[j].split('=', 2); @@ -322,11 +325,12 @@ export function specStringToObject(str) { } } else if (vstr.indexOf(',') !== -1) { - //has multiple values, must list + // Has multiple values, must list val = vstr.split(','); } else { - val = massage(vstr); //value itself + // Value itself + val = massage(vstr); } } ret[f] = val;