mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
chore: new constant for plugins
This commit is contained in:
parent
55c146cb5d
commit
78d3364691
2 changed files with 3 additions and 2 deletions
|
@ -93,7 +93,7 @@ export const APP_ERROR = {
|
|||
};
|
||||
|
||||
export const DEFAULT_NO_README = 'ERROR: No README data found!';
|
||||
|
||||
export const MODULE_NOT_FOUND = 'MODULE_NOT_FOUND';
|
||||
|
||||
export const WEB_TITLE = 'Verdaccio';
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import Path from 'path';
|
|||
import _ from 'lodash';
|
||||
import logger from './logger';
|
||||
import type {Config} from '@verdaccio/types';
|
||||
import {MODULE_NOT_FOUND} from './constants';
|
||||
|
||||
/**
|
||||
* Requires a module.
|
||||
|
@ -14,7 +15,7 @@ function tryLoad(path: string) {
|
|||
try {
|
||||
return require(path);
|
||||
} catch (err) {
|
||||
if (err.code === 'MODULE_NOT_FOUND') {
|
||||
if (err.code === MODULE_NOT_FOUND) {
|
||||
return null;
|
||||
}
|
||||
throw err;
|
||||
|
|
Loading…
Reference in a new issue