mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2026-02-26 17:05:55 +08:00
弃用lodash
This commit is contained in:
@@ -33,10 +33,10 @@ const isPathMatched = (currentPath, targetPaths) => {
|
||||
* @returns {Object} 处理后的对象
|
||||
*/
|
||||
const removeEmptyValues = (obj) => {
|
||||
return _.omitBy(obj, (value) => {
|
||||
if (_.isNil(value) || value === "") return true;
|
||||
return window.lodashM.omitBy(obj, (value) => {
|
||||
if (window.lodashM.isNil(value) || value === "") return true;
|
||||
if (typeof value === "object")
|
||||
return _.isEmpty(removeEmptyValues(value));
|
||||
return window.lodashM.isEmpty(removeEmptyValues(value));
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@ const commandTypes = {
|
||||
disabledSpecialVars:
|
||||
/{{input}}|{{SelectFile}}|{{pwd}}|{{WindowInfo.*?}}|{{MatchedFiles.*?}}/g,
|
||||
matchToCmds: (rules, desc) => rules,
|
||||
verify: (rules) => !_.isEmpty(rules) || "关键词不能为空",
|
||||
verify: (rules) => !window.lodashM.isEmpty(rules) || "关键词不能为空",
|
||||
},
|
||||
regex: {
|
||||
name: "regex",
|
||||
@@ -120,7 +120,7 @@ const commandTypes = {
|
||||
},
|
||||
},
|
||||
],
|
||||
verify: (rules) => !_.isEmpty(rules) || "进程名不能为空",
|
||||
verify: (rules) => !window.lodashM.isEmpty(rules) || "进程名不能为空",
|
||||
},
|
||||
img: {
|
||||
name: "img",
|
||||
|
||||
Reference in New Issue
Block a user