UNPKG

2.81 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../telemetry/anonymous-meta.ts"],"names":["traits","getAnonymousMeta","cpus","os","NOW_REGION","process","env","systemPlatform","platform","systemRelease","release","systemArchitecture","arch","cpuCount","length","cpuModel","model","cpuSpeed","speed","memoryInMb","Math","trunc","totalmem","pow","isDocker","isNowDev","isWsl","isWslBoolean","isCI","ciEnvironment","ciName","name","nextVersion","__NEXT_VERSION"],"mappings":"+EAAA,8EACA,wEACA,8CAEA,gE,w4BAkBA,GAAIA,CAAAA,MAAJ,CAEO,QAASC,CAAAA,gBAAT,EAA2C,CAChD,GAAID,MAAJ,CAAY,CACV,MAAOA,CAAAA,MAAP,CACD,CAED,KAAME,CAAAA,IAAI,CAAGC,YAAGD,IAAH,IAAa,EAA1B,CACA,KAAM,CAAEE,UAAF,EAAiBC,OAAO,CAACC,GAA/B,CACAN,MAAM,CAAG,CACP;AACAO,cAAc,CAAEJ,YAAGK,QAAH,EAFT,CAGPC,aAAa,CAAEN,YAAGO,OAAH,EAHR,CAIPC,kBAAkB,CAAER,YAAGS,IAAH,EAJb,CAKP;AACAC,QAAQ,CAAEX,IAAI,CAACY,MANR,CAOPC,QAAQ,CAAEb,IAAI,CAACY,MAAL,CAAcZ,IAAI,CAAC,CAAD,CAAJ,CAAQc,KAAtB,CAA8B,IAPjC,CAQPC,QAAQ,CAAEf,IAAI,CAACY,MAAL,CAAcZ,IAAI,CAAC,CAAD,CAAJ,CAAQgB,KAAtB,CAA8B,IARjC,CASPC,UAAU,CAAEC,IAAI,CAACC,KAAL,CAAWlB,YAAGmB,QAAH,GAAgBF,IAAI,CAACG,GAAL,CAAS,IAAT,CAAe,CAAf,CAA3B,CATL,CAUP;AACAC,QAAQ,CAAE,uBAXH,CAYPC,QAAQ,CAAErB,UAAU,GAAK,MAZlB,CAaPsB,KAAK,CAAEC,cAbA,CAcPC,IAAI,CAAEC,aAAa,CAACD,IAdb,CAePE,MAAM,CAAGD,aAAa,CAACD,IAAd,EAAsBC,aAAa,CAACE,IAArC,EAA8C,IAf/C,CAgBPC,WAAW,CAAE3B,OAAO,CAACC,GAAR,CAAY2B,cAhBlB,CAAT,CAmBA,MAAOjC,CAAAA,MAAP,CACD","sourcesContent":["import isDockerFunction from 'next/dist/compiled/is-docker'\nimport isWslBoolean from 'next/dist/compiled/is-wsl'\nimport os from 'os'\n\nimport * as ciEnvironment from './ci-info'\n\ntype AnonymousMeta = {\n systemPlatform: NodeJS.Platform\n systemRelease: string\n systemArchitecture: string\n cpuCount: number\n cpuModel: string | null\n cpuSpeed: number | null\n memoryInMb: number\n isDocker: boolean\n isNowDev: boolean\n isWsl: boolean\n isCI: boolean\n ciName: string | null\n nextVersion: string\n}\n\nlet traits: AnonymousMeta | undefined\n\nexport function getAnonymousMeta(): AnonymousMeta {\n if (traits) {\n return traits\n }\n\n const cpus = os.cpus() || []\n const { NOW_REGION } = process.env\n traits = {\n // Software information\n systemPlatform: os.platform(),\n systemRelease: os.release(),\n systemArchitecture: os.arch(),\n // Machine information\n cpuCount: cpus.length,\n cpuModel: cpus.length ? cpus[0].model : null,\n cpuSpeed: cpus.length ? cpus[0].speed : null,\n memoryInMb: Math.trunc(os.totalmem() / Math.pow(1024, 2)),\n // Environment information\n isDocker: isDockerFunction(),\n isNowDev: NOW_REGION === 'dev1',\n isWsl: isWslBoolean,\n isCI: ciEnvironment.isCI,\n ciName: (ciEnvironment.isCI && ciEnvironment.name) || null,\n nextVersion: process.env.__NEXT_VERSION as string,\n }\n\n return traits\n}\n"]}
\No newline at end of file