forked from MapComplete/MapComplete
		
	Add json schema files for the layout-config.json
This commit is contained in:
		
							parent
							
								
									bb283b59a4
								
							
						
					
					
						commit
						e15ec387a2
					
				
					 25 changed files with 7340 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								scripts/fixSchemas.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								scripts/fixSchemas.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| import ScriptUtils from "./ScriptUtils"; | ||||
| import {readFileSync, writeFileSync} from "fs"; | ||||
| 
 | ||||
| const allSchemas = ScriptUtils.readDirRecSync("./Docs/Schemas").filter(pth => pth.endsWith("JSC.ts")) | ||||
| 
 | ||||
| for (const path of allSchemas) { | ||||
|     const dir = path.substring(0, path.lastIndexOf("/")) | ||||
|     const name = path.substring(path.lastIndexOf("/"), path.length  - "JSC.ts".length) | ||||
|     let content = readFileSync(path, "UTF-8") | ||||
|     content = content.substring("export default ".length) | ||||
|     let parsed = JSON.parse(content) | ||||
|     parsed["additionalProperties"] = false | ||||
|     writeFileSync(dir+"/"+name+".schema.json", JSON.stringify(parsed, null, "  "), "UTF8") | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue