misc: used set

This commit is contained in:
Sheen Capadngan
2024-06-11 17:14:24 +08:00
parent 38b0edf510
commit 05ed00834a
@@ -962,7 +962,7 @@ export const secretServiceFactory = ({
// secret-override to handle duplicate keys from different import levels // secret-override to handle duplicate keys from different import levels
// this prioritizes secret values from direct imports // this prioritizes secret values from direct imports
const importedKeys: Record<string, boolean> = {}; const importedKeys = new Set<string>();
const importedEntries = decryptedImportSecrets.reduce( const importedEntries = decryptedImportSecrets.reduce(
( (
accum: { accum: {
@@ -981,8 +981,8 @@ export const secretServiceFactory = ({
}[], }[],
sec sec
) => { ) => {
if (!importedKeys[sec.secretKey]) { if (!importedKeys.has(sec.secretKey)) {
importedKeys[sec.secretKey] = true; importedKeys.add(sec.secretKey);
return [...accum, sec]; return [...accum, sec];
} }
return accum; return accum;