UNPKG

995 BSource Map (JSON)View Raw
1{"version":3,"file":"get-untyped-name.esm.js","sources":["../../src/utils/get-untyped-name.ts"],"sourcesContent":["/**\n * `getUntypedName` returns the name of the normal package\n * corresponding to a DefinitelyTyped package.\n */\nexport function getUntypedName({ name }: { name: string }): string | undefined {\n if (!name.startsWith('@types/')) {\n return undefined;\n }\n\n // ['foo', undefined] or ['@bar', 'baz']\n const [scopeOrName, scopedName] = name.replace('@types/', '').split('__');\n\n return scopedName ? `@${scopeOrName}/${scopedName}` : scopeOrName;\n}\n"],"names":["getUntypedName","name","startsWith","undefined","scopeOrName","scopedName","replace","split"],"mappings":"AAAA;;;;SAIgBA,eAAe;AAAEC,EAAAA;AAAF;AAC3B,MAAI,CAACA,IAAI,CAACC,UAAL,CAAgB,SAAhB,CAAL,EAAiC;AAC7B,WAAOC,SAAP;AACH;;;AAGD,QAAM,CAACC,WAAD,EAAcC,UAAd,IAA4BJ,IAAI,CAACK,OAAL,CAAa,SAAb,EAAwB,EAAxB,EAA4BC,KAA5B,CAAkC,IAAlC,CAAlC;AAEA,SAAOF,UAAU,OAAOD,eAAeC,YAAtB,GAAqCD,WAAtD;AACH;;;;"}
\No newline at end of file