From c56b952d7953f89da44ec2cedf325ca0e36c8f86 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 4 Mar 2024 01:48:51 +0800 Subject: [PATCH] Refactor code and update readme --- md5.js | 30 +++++++++++++++--------------- readme.md | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/md5.js b/md5.js index 6773abc..752310a 100644 --- a/md5.js +++ b/md5.js @@ -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 } } diff --git a/readme.md b/readme.md index 169c82a..d1c28ab 100644 --- a/readme.md +++ b/readme.md @@ -13,6 +13,7 @@ - 清理一些函数 - [] `P.p` (svg 函数) + - [x] `z` (检查环境函数) - [ ] And more