(type: FixtureType, name: string)
| 43 | } |
| 44 | |
| 45 | function getFixturePath(type: FixtureType, name: string): string { |
| 46 | const dir = FIXTURE_PATHS[type] |
| 47 | let filename: string |
| 48 | |
| 49 | switch (type) { |
| 50 | case 'packument': |
| 51 | case 'downloads': |
| 52 | filename = `${name}.json` |
| 53 | break |
| 54 | case 'search': |
| 55 | filename = `${name.replace(/:/g, '-')}.json` |
| 56 | break |
| 57 | case 'org': |
| 58 | case 'user': |
| 59 | filename = `${name}.json` |
| 60 | break |
| 61 | default: |
| 62 | filename = `${name}.json` |
| 63 | } |
| 64 | |
| 65 | return `${dir}:${filename.replace(/\//g, ':')}` |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Parse a scoped package name with optional version. |
no outgoing calls
no test coverage detected