mirror of
https://github.com/actions/setup-node.git
synced 2025-12-17 10:51:38 +08:00
Add unique
This commit is contained in:
@@ -61,3 +61,12 @@ async function getToolVersion(tool: string, options: string[]) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
export const unique = () => {
|
||||
const encountered = new Set();
|
||||
return (value: unknown): boolean => {
|
||||
if (encountered.has(value)) return false;
|
||||
encountered.add(value);
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user