Compare commits

...

1 Commits

Author SHA1 Message Date
53f100cb4e add SettingMapper.not() and fix is() invalid 2025-07-23 00:31:32 +08:00

View File

@ -46,7 +46,11 @@ export default class SettingMapper {
public static is(key: SettingKey | string, args?: { [key: string]: any }): boolean { public static is(key: SettingKey | string, args?: { [key: string]: any }): boolean {
const value = this.getValueRef(key, args).value; const value = this.getValueRef(key, args).value;
return !value && value === 'true'; return !!value && value === 'true';
}
public static not(key: SettingKey | string, args?: { [key: string]: any }): boolean {
return !this.is(key, args);
} }
public static getValue(key: SettingKey | string, args?: { [key: string]: any }): string | undefined { public static getValue(key: SettingKey | string, args?: { [key: string]: any }): string | undefined {