Circle V2 API Docs
    Preparing search index...
    • Narrow a value from outside the type system — JSON, an env var, an API payload — to one of an allowed set, returning undefined for anything else.

      Prefer this over a cast: a value the source invented is dropped rather than passed on as a member it is not, so an invalid value fails where it enters instead of somewhere downstream.

      Type Parameters

      • T extends string

      Parameters

      • value: unknown
      • allowed: readonly T[]

      Returns T | undefined