Refactor code and update readme

This commit is contained in:
shenjack 2024-03-04 01:48:51 +08:00
parent 9b726e6706
commit c56b952d79
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 16 additions and 15 deletions

30
md5.js
View File

@ -14,30 +14,30 @@
if (!b.hasOwnProperty(q)) b[q] = a[q]
}
}
var z = function () {
// checkEnvironment
if (typeof navigator !== "undefined" && navigator.userAgent.includes("Chrome/")) {
return true;
}
// var z = function () {
// // checkEnvironment
// if (typeof navigator !== "undefined" && navigator.userAgent.includes("Chrome/")) {
// return true;
// }
if (typeof version === "function" && version.length === 0 && /^\d+\.\d+\.\d+\.\d+$/.test(version())) {
return true;
}
// if (typeof version === "function" && version.length === 0 && /^\d+\.\d+\.\d+\.\d+$/.test(version())) {
// return true;
// }
return false;
}()
// return false;
// }()
function inherit(a, b) {
a.prototype.constructor = a
a.prototype["$i" + a.name] = a
if (b != null) {
if (z) {
// if (z) {
a.prototype.__proto__ = b.prototype
return
}
var s = Object.create(b.prototype)
copyProperties(a.prototype, s)
a.prototype = s
// }
// var s = Object.create(b.prototype)
// copyProperties(a.prototype, s)
// a.prototype = s
}
}

View File

@ -13,6 +13,7 @@
- 清理一些函数
- [] `P.p` (svg 函数)
- [x] `z` (检查环境函数)
- [ ] And more