mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
14 lines
337 B
JavaScript
14 lines
337 B
JavaScript
const namespace = Object.create(null);
|
|
|
|
exports.addItem = function (name, value) {
|
|
namespace[name] = value;
|
|
};
|
|
|
|
exports.getItem = function (name) {
|
|
console.log('get-item', name, namespace);
|
|
if (!(name in namespace)) {
|
|
throw new Error('The item '.concat(name, ' does exist in the namespace'));
|
|
}
|
|
|
|
return namespace[name];
|
|
};
|