Skip to content

Commit

Permalink
Updated CI
Browse files Browse the repository at this point in the history
Signed-off-by: Adithya Krishna <[email protected]>
  • Loading branch information
Adithya Krishna committed Jun 18, 2023
1 parent 10e7b41 commit 9b95d68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 13 additions & 9 deletions src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -314,19 +317,20 @@ 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);
val[kv[0]] = massage(kv[1]);
}
}
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;
Expand Down

0 comments on commit 9b95d68

Please sign in to comment.