1
0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-11-13 03:35:52 +01:00
verdaccio/test/e2e-cli/utils/global.js

18 lines
420 B
JavaScript
Raw Normal View History

const namespace = Object.create(null);
import buildDebug from 'debug';
const debug = buildDebug('verdaccio:e2e:global');
2020-08-13 23:36:23 +02:00
exports.addItem = function (name, value) {
namespace[name] = value;
2020-08-13 23:36:23 +02:00
};
2020-08-13 23:36:23 +02:00
exports.getItem = function (name) {
debug('get-item %o:%o', name, namespace);
if (!(name in namespace)) {
2020-08-13 23:36:23 +02:00
throw new Error('The item '.concat(name, ' does exist in the namespace'));
}
return namespace[name];
2020-08-13 23:36:23 +02:00
};