arcticpackage
Version:
A library for making Arctic packages in typescript.
23 lines (17 loc) • 539 B
text/typescript
export default class Namespace {
readonly name: string;
properties: Map<string, any>;
constructor(name: string, properties: Map<string, any>=new Map()) {
this.name = name;
this.properties = properties;
}
get(name: string) {
if(this.properties.has(name)) {
return this.properties.get(name)!;
}
throw new String(`Undefined property '${name}'.`);
}
set(name: string, value: any) {
this.properties.set(name, value);
}
}