Skip to content

Commit

Permalink
Moving arrays.ts to commons
Browse files Browse the repository at this point in the history
  • Loading branch information
ecamellini committed Aug 12, 2024
1 parent b940dad commit 53f0b5c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/api-gateway/src/api/attributesApiConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
tenantApi,
apiGatewayApi,
} from "pagopa-interop-api-clients";
import { isDefined, toSetToArray } from "../utilities/arrays.js";
import { isDefined, toSetToArray } from "pagopa-interop-commons";
import {
verifiedAttributeToAttributeValidityState,
certifiedAttributeToAttributeValidityState,
Expand Down
7 changes: 0 additions & 7 deletions packages/api-gateway/src/utilities/arrays.ts

This file was deleted.

4 changes: 4 additions & 0 deletions packages/commons/src/utils/arrays.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export function isDefined<V>(value: V | null | undefined): value is V {
return value !== null && value !== undefined;
}

export function toSetToArray<V>(a: V[]): V[] {
return Array.from(new Set(a));
}

0 comments on commit 53f0b5c

Please sign in to comment.