forked from MapComplete/MapComplete
Add check: layer and theme ids must be lowercase and match [a-z_-]*
This commit is contained in:
parent
9916371122
commit
444f0bc47c
7 changed files with 27 additions and 15 deletions
|
@ -58,6 +58,12 @@ export default class LayoutConfig {
|
|||
constructor(json: LayoutConfigJson, official = true, context?: string) {
|
||||
this.official = official;
|
||||
this.id = json.id;
|
||||
if(json.id.toLowerCase() !== json.id){
|
||||
throw "The id of a theme should be lowercase: "+json.id
|
||||
}
|
||||
if(json.id.match(/[a-z0-9-_]/) == null){
|
||||
throw "The id of a theme should match [a-z0-9-_]*: "+json.id
|
||||
}
|
||||
context = (context ?? "") + "." + this.id;
|
||||
this.maintainer = json.maintainer;
|
||||
this.credits = json.credits;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue