0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-27 22:59:51 -05:00

refactor: rename function to camel case (#1053)

- changing function folder_exists to folderExists
This commit is contained in:
Ashish Surana 2018-10-06 13:54:25 +05:30 committed by Juan Picado @jotadeveloper
parent ad29b7d701
commit 4a6b9cb016
2 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@ import Path from 'path';
import logger from './logger';
import mkdirp from 'mkdirp';
import {folder_exists, fileExists} from './utils';
import {folderExists, fileExists} from './utils';
const CONFIG_FILE = 'config.yaml';
const XDG = 'xdg';
@ -65,7 +65,7 @@ function updateStorageLinks(configLocation, defaultConfig) {
// If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
// $FlowFixMe
let dataDir = process.env.XDG_DATA_HOME || Path.join(process.env.HOME, '.local', 'share');
if (folder_exists(dataDir)) {
if (folderExists(dataDir)) {
dataDir = Path.resolve(Path.join(dataDir, pkgJSON.name, 'storage'));
return defaultConfig.replace(/^storage: .\/storage$/m, `storage: ${dataDir}`);
} else {
@ -81,7 +81,7 @@ const getXDGDirectory = () => {
const XDGConfig = getXDGHome() ||
process.env.HOME && Path.join(process.env.HOME, '.config');
if (XDGConfig && folder_exists(XDGConfig)) {
if (XDGConfig && folderExists(XDGConfig)) {
return {
path: Path.join(XDGConfig, pkgJSON.name, CONFIG_FILE),
type: XDG,
@ -92,7 +92,7 @@ const getXDGDirectory = () => {
const getXDGHome = () => process.env.XDG_CONFIG_HOME;
const getWindowsDirectory = () => {
if (process.platform === WIN32 && process.env.APPDATA && folder_exists(process.env.APPDATA)) {
if (process.platform === WIN32 && process.env.APPDATA && folderExists(process.env.APPDATA)) {
return {
path: Path.resolve(Path.join(process.env.APPDATA, pkgJSON.name, CONFIG_FILE)),
type: WIN,

View file

@ -431,7 +431,7 @@ const parseConfigFile = (configPath: string) =>
* @param {String} path
* @return {Boolean}
*/
function folder_exists(path: string) {
function folderExists(path: string) {
try {
const stat = fs.statSync(path);
return stat.isDirectory();
@ -550,7 +550,7 @@ export {
deleteProperties,
addScope,
sortByName,
folder_exists,
folderExists,
fileExists,
parseInterval,
semverSort,