0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/test/e2e-cli/utils/global.js

15 lines
337 B
JavaScript
Raw Normal View History

const namespace = Object.create(null);
2020-08-13 16:36:23 -05:00
exports.addItem = function (name, value) {
namespace[name] = value;
2020-08-13 16:36:23 -05:00
};
2020-08-13 16:36:23 -05:00
exports.getItem = function (name) {
console.log('get-item', name, namespace);
if (!(name in namespace)) {
2020-08-13 16:36:23 -05:00
throw new Error('The item '.concat(name, ' does exist in the namespace'));
}
return namespace[name];
2020-08-13 16:36:23 -05:00
};