equals 优化

This commit is contained in:
2betop 2020-03-06 17:43:52 +08:00
parent bf75028e61
commit 1bc48f1743

View File

@ -244,11 +244,10 @@ export const filters: {
? RegExp.$2 ? RegExp.$2
: resolveVariable(arg1, this as any) : resolveVariable(arg1, this as any)
: ''; : '';
// 比对的值是空时直接返回。 if (arg1 !== undefined && arg1 !== null) {
if (!arg1) {
return input; return input;
} }
fn = value => arg1 == value; fn = value => arg1 === value;
} else { } else {
if (directive !== 'match') { if (directive !== 'match') {
directive = 'match'; directive = 'match';