File tree Expand file tree Collapse file tree 3 files changed +24028
-1091
lines changed Expand file tree Collapse file tree 3 files changed +24028
-1091
lines changed Original file line number Diff line number Diff line change 11import { InputConfig } from "./types" ;
22
3+ type Whitespace = " " | "\t" | "\n" | "\r" ;
4+
35type With$fn < T > = {
46 [ K in keyof T ] :
57 | ( T [ K ] extends ( infer U ) [ ]
68 ? With$fn < U > [ ] // handle arrays recursively
79 : T [ K ] extends object
8- ? With$fn < T [ K ] > // handle objects recursively
9- : T [ K ] ) // retain original type
10- | ( string & `$ex ${string } `)
11- | ( string & `$fn ${ string } `) ; // allow string starting with $ex or $fn
10+ ? With$fn < T [ K ] > // handle objects recursively
11+ : T [ K ] ) // retain original type
12+ | ( string & `${ Whitespace | "" } $ex${ Whitespace } ${string } `)
13+ | ( string & `${ Whitespace | "" } $fn${ Whitespace } ${ string } `) ; // allow string starting with $ex or $fn with optional whitespace
1214} ;
1315
14- export type JsonSchemaRoot = With$fn < InputConfig >
16+ export type JsonSchemaRoot = With$fn < InputConfig > ;
Original file line number Diff line number Diff line change 66 "scripts" : {
77 "start" : " npm run schema && webpack serve --open --mode development" ,
88 "build" : " npm run schema &&rm -rf dist && webpack --mode production" ,
9- "schema" : " cd .. && typescript-json-schema --noExtraProps tsconfig.json InputConfig > yaml-editor/src/schema.json" ,
9+ "schema" : " cd .. && typescript-json-schema --required tsconfig.json JsonSchemaRoot > yaml-editor/src/schema.json" ,
1010 "deploy" : " pnpm run build && gh-pages -d dist"
1111 },
1212 "dependencies" : {
You can’t perform that action at this time.
0 commit comments