1import { ConfigPlugin } from '@expo/config-plugins';
2import { boolish } from 'getenv';
3
4import { ConfigFilePaths } from '../Config.types';
5
6export const EXPO_DEBUG = boolish('EXPO_DEBUG', false);
7
8/**
9 * Adds the _internal object.
10 *
11 * @param config
12 * @param projectRoot
13 */
14export const withInternal: ConfigPlugin<
15  { projectRoot: string; packageJsonPath?: string } & Partial<ConfigFilePaths>
16> = (config, internals) => {
17  if (!config._internal) {
18    config._internal = {};
19  }
20
21  config._internal = {
22    isDebug: EXPO_DEBUG,
23    ...config._internal,
24    ...internals,
25  };
26
27  return config;
28};
29