MCPcopy Create free account
hub / github.com/openscopeproject/InteractiveHtmlBom / valueCompare

Function valueCompare

InteractiveHtmlBom/web/util.js:270–285  ·  view source on GitHub ↗
(a, b, stra, strb)

Source from the content-addressed store, hash-verified

268}
269
270function valueCompare(a, b, stra, strb) {
271 if (a === null && b === null) {
272 // Failed to parse both values, compare them as strings.
273 if (stra != strb) return stra > strb ? 1 : -1;
274 else return 0;
275 } else if (a === null) {
276 return 1;
277 } else if (b === null) {
278 return -1;
279 } else {
280 if (a.unit != b.unit) return a.unit > b.unit ? 1 : -1;
281 else if (a.val != b.val) return a.val > b.val ? 1 : -1;
282 else if (a.extra != b.extra) return a.extra > b.extra ? 1 : -1;
283 else return 0;
284 }
285}
286
287function validateSaveImgDimension(element) {
288 var valid = false;

Callers 1

populateBomHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected