GT2/Ejectable/node_modules/@expo/config/build/getFullName.js.map

1 line
1.8 KiB
Plaintext

{"version":3,"sources":["../src/getFullName.ts"],"names":["ANONYMOUS_USERNAME","getFullName","manifest","username","getAccountUsername","slug","owner","process","env","EXPO_CLI_USERNAME","EAS_BUILD_USERNAME","read","auth"],"mappings":";;;;;;;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,MAAMA,kBAAkB,GAAG,WAA3B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,WAAT,CAAqBC,QAArB,EAA2E;AAChF,QAAMC,QAAQ,GAAGC,kBAAkB,CAACF,QAAD,CAAnC;AACA,SAAQ,IAAGC,QAAS,IAAGD,QAAQ,CAACG,IAAK,EAArC;AACD;;AAEM,SAASD,kBAAT,CAA4BF,QAAmC,GAAG,EAAlE,EAA8E;AAAA;;AACnF;AACA,QAAMC,QAAQ,GACZD,QAAQ,CAACI,KAAT,IAAkBC,OAAO,CAACC,GAAR,CAAYC,iBAA9B,IAAmDF,OAAO,CAACC,GAAR,CAAYE,kBADjE;;AAEA,MAAIP,QAAJ,EAAc;AACZ,WAAOA,QAAP;AACD,GANkF,CAOnF;;;AACA,SAAO,8DAAeQ,IAAf,GAAsBC,IAAtB,gFAA4BT,QAA5B,KAAwCH,kBAA/C;AACD","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { getUserState } from './getUserState';\n\nconst ANONYMOUS_USERNAME = 'anonymous';\n\n/**\n * Used in expo-constants to generate the `id` property statically for an app in custom managed workflow.\n * This `id` is used for legacy Expo services AuthSession proxy and Expo notifications device ID.\n *\n * @param manifest\n * @returns\n */\nexport function getFullName(manifest: Pick<ExpoConfig, 'owner' | 'slug'>): string {\n const username = getAccountUsername(manifest);\n return `@${username}/${manifest.slug}`;\n}\n\nexport function getAccountUsername(manifest: Pick<ExpoConfig, 'owner'> = {}): string {\n // TODO: Must match what's generated in Expo Go.\n const username =\n manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;\n if (username) {\n return username;\n }\n // Statically get the username from the global user state.\n return getUserState().read().auth?.username || ANONYMOUS_USERNAME;\n}\n"],"file":"getFullName.js"}