MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / compareVersion

Function compareVersion

gqftbz.js:707–721  ·  view source on GitHub ↗

* 判断版本号是否小于 V2.15.0 小于返回true * @param {*} version * @returns

(version)

Source from the content-addressed store, hash-verified

705 * @returns
706 */
707function compareVersion(version) {
708 const currentVersion = 'v2.12.2';
709 const current = currentVersion.substring(1).split('.');
710 const target = version.substring(1).split('.');
711 for (let i = 0; i < current.length; i++) {
712 const c = parseInt(current[i]);
713 const t = parseInt(target[i] || 0);
714 if (c > t) {
715 return true;
716 } else if (c < t) {
717 return false;
718 }
719 }
720 return false;
721}
722/**
723 * 16位随机数
724 * @returns

Callers 1

getTokenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected