greatly simplify type registry
This commit is contained in:
parent
303fa869a8
commit
4ca60784aa
3 changed files with 36 additions and 85 deletions
2
util.js
2
util.js
|
|
@ -30,7 +30,7 @@ export class DefaultMap {
|
|||
}
|
||||
getdefault(key, addToMapping=false) {
|
||||
return this.m.get(key) || (() => {
|
||||
const val = this.defaultValue();
|
||||
const val = this.defaultValue(key);
|
||||
if (addToMapping)
|
||||
this.m.set(key, val);
|
||||
return val;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue