mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00

chore: clean up comments remove commitlint update deps add new tests test separate ci test test test test test test chore: add preprelase test test test test test chore: update deps Update release-snapshot.yml Update .npmignore test chore: remove @verdaccio/commons-api dep chore: cleanup remove normalizeContributors remove validateMetadata fix test clean up getLocalRegistryTarballUri Update store.spec.ts clean up convertDistRemoteToLocalTarballUrls chore: update libraries reuse getPublic url clean up Update jest.config.js Update jest.config.js update nvmrc add tests
23 lines
549 B
TypeScript
23 lines
549 B
TypeScript
import fs from 'fs-extra';
|
|
import os from 'os';
|
|
import path from 'path';
|
|
|
|
/**
|
|
* Create a temporary folder.
|
|
* @param prefix The prefix of the folder name.
|
|
* @returns string
|
|
* @deprecated use @verdaccio/core:createTempFolder async function instead
|
|
*/
|
|
export function createTempFolder(prefix: string): string {
|
|
return fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), prefix));
|
|
}
|
|
|
|
export const getTarball = (name: string): string => {
|
|
const r = name.split('/');
|
|
if (r.length === 1) {
|
|
return r[0];
|
|
} else {
|
|
return r[1];
|
|
}
|
|
};
|