var glob = new Namespace();
function namespace(path) {
return function (target, propertyKey, descriptor) {
const ns = glob.namespace(path); // <-- make inner namespace
const name = propertyKey || target.prototype.constructor.name;
ns[name] = propertyKey ? target[propertyKey] : target;
};
}
// decorators are not supported with runkit, but we can use it like a function
namespace("white.animals") (
class Actions {
makeAlbino(animal) {
return `${animal} is white now`;
}
}
)
console.log(new glob.white.animals.Actions().makeAlbino("rose panther"));