932
933
public evaluate(context: IContext): boolean {
934
>
const source = context.getValue(this.valueKey);
contextkey.ts
935
>
936
>
const item = context.getValue(this.key);
937
>
938
>
if (Array.isArray(source)) {
939
>
// eslint-disable-next-line local/code-no-any-casts
940
>
if (source.includes(item as any)) {
941
>
return true;
942
>
}
943
>
// On Windows, file paths are case-insensitive so file URI
944
>
// comparisons must be done in a case-insensitive manner.
945
>
if (isWindows && typeof item === 'string' && item.startsWith('file:///')) {
946
const itemLower = item.toLowerCase();
947
return source.some(s => typeof s === 'string' && s.toLowerCase() === itemLower);
948
}
950
>
}
951
>
952
>
if (typeof item === 'string' && typeof source === 'object' && source !== null) {
953
>
if (hasOwnProperty.call(source, item)) {
954
>
return true;
955
>
}
956
>
// On Windows, file paths are case-insensitive so file URI
957
>
// property lookups must be done in a case-insensitive manner.
958
>
if (isWindows && item.startsWith('file:///')) {
959
const itemLower = item.toLowerCase();
960
return Object.keys(source).some(key => key.toLowerCase() === itemLower);
961
}
963
>
}
964
>
return false;
965
>
}
966
967
public serialize(): string {