How to use the @verdaccio/commons-api/lib.getCode function in @verdaccio/commons-api

To help you get started, we’ve selected a few @verdaccio/commons-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github verdaccio / local-storage / src / local-fs.ts View on Github external
export const fSError = function(message: string, code: number = 409): VerdaccioError {
  const err: VerdaccioError = getCode(code, message);
  // FIXME: we should return http-status codes here instead, future improvement
  // @ts-ignore
  err.code = message;

  return err;
};