INNER CODE UNIT · JavaScript

get

dotenvx/dotenvx · src/lib/custodians/index.js:25

  function get (id) {
    const custodian = entries.get(id)
    if (!custodian) throw new Error(`unknown custodian: ${id}`)
    return custodian
  }

  return {
    get,
    async choices (options = {}, custody = 'local') {
      const choices = []
      for (const custodian of entries.values()) {
        if ((custodian.custody || 'local') !== custody) continue
        choices.push({ name: custodian.name, value: custodian.id, disabled: !custodian.enabled(options) || !await custodian.available() })
      }
      return choices
    },
    providers (options = {}, sync = false) {
      const providers = []

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…