mirror of
https://github.com/actions/setup-node.git
synced 2025-07-23 15:08:24 +02:00
Add unique
This commit is contained in:
parent
885f6b5c36
commit
b8b9502971
4 changed files with 148 additions and 16 deletions
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue