see http import { SPID_LEVELS } from "@pagopa/io-spid-commons/dist/config" ; import * as t from "io-ts" ; import { SpidLevelEnum } from "../../generated/backend/SpidLevel" ; type SpidLevel1 = typeof SpidLevelEnum [ "https://www.spid.gov.it/SpidL1" ] ; type SpidLevel2 = typeof SpidLevelEnum [ "https://www.spid.gov.it/SpidL2" ] ; type SpidLevel3 = typeof SpidLevelEnum [ "https://www.spid.gov.it/SpidL3" ] ; type SpidLevel = SpidLevel1 | SpidLevel2 | SpidLevel3 ; function isSpidL1 ( uri ) { return uri === SpidLevelEnum [ "https://www.spid.gov.it/SpidL1" ] ; } function isSpidL2 ( uri ) { return uri === SpidLevelEnum [ "https://www.spid.gov.it/SpidL2" ] ; } function isSpidL3 ( uri ) { return uri === SpidLevelEnum [ "https://www.spid.gov.it/SpidL3" ] ; } export function isSpidL ( uri ) { return isSpidL1 ( uri ) || isSpidL2 ( uri ) || isSpidL3 ( uri ) ; } export const SpidLevelArray = t . readonlyArray ( t . keyof ( SPID_LEVELS ) ) ; export type SpidLevelArray = t . TypeOf < typeof SpidLevelArray > ;