Skip to content
Snippets Groups Projects
Select Git revision
  • dc9c2054bc95a9e84365e18bc8f193b870dbf4a1
  • main default protected
  • renovate/main-renovatebot-detect-tools-1.x
  • renovate/main-ghcr.io-renovatebot-base-image-11.x
  • refactor/pin-new-value
  • fix/user-agent
  • feat/37517-base64-private-key
  • next
  • feat/gnupg
  • fix/36615b-branch-reuse-no-cache
  • chore/punycode
  • feat/36219--git-x509-signing
  • feat/structured-logger
  • hotfix/39.264.1
  • feat/skip-dangling
  • gh-readonly-queue/next/pr-36034-7a061c4ca1024a19e2c295d773d9642625d1c2be
  • hotfix/39.238.3
  • refactor/gitlab-auto-approve
  • feat/template-strings
  • gh-readonly-queue/next/pr-35654-137d934242c784e0c45d4b957362214f0eade1d7
  • fix/32307-global-extends-merging
  • 41.118.0
  • 41.117.1
  • 41.117.0
  • 41.116.10
  • 41.116.9
  • 41.116.8
  • 41.116.7
  • 41.116.6
  • 41.116.5
  • 41.116.4
  • 41.116.3
  • 41.116.2
  • 41.116.1
  • 41.116.0
  • 41.115.6
  • 41.115.5
  • 41.115.4
  • 41.115.3
  • 41.115.2
  • 41.115.1
41 results

defaults.ts

Blame
  • defaults.ts 613 B
    import { getOptions } from './options';
    import type { AllConfig, RenovateOptions } from './types';
    
    const defaultValues = {
      boolean: true,
      array: [],
      string: null,
      object: null,
      integer: null,
    } as const;
    
    export function getDefault(option: RenovateOptions): any {
      return option.default === undefined
        ? defaultValues[option.type]
        : option.default;
    }
    
    export function getConfig(): AllConfig {
      const options = getOptions();
      const config: AllConfig = {};
      options.forEach((option) => {
        if (!option.parent) {
          config[option.name] = getDefault(option);
        }
      });
      return config;
    }