1- import { Document , parseDocument } from "yaml" ;
1+ import { Document , type YAMLMap , parseDocument } from "yaml" ;
22import { RepositoryConnection } from "src/repositoryConnection/RepositoryConnection" ;
33import type { QuartzV5Config , QuartzLockFile } from "./QuartzConfigTypes" ;
44
@@ -13,7 +13,7 @@ type ConfigFormat = "yaml" | "json";
1313
1414export class QuartzConfigService {
1515 private repo : RepositoryConnection ;
16- private yamlDocument : Document | null = null ;
16+ private yamlDocument : Document < YAMLMap > | null = null ;
1717 private configFormat : ConfigFormat | null = null ;
1818
1919 constructor ( repo : RepositoryConnection ) {
@@ -28,11 +28,13 @@ export class QuartzConfigService {
2828 return JSON . parse ( content ) as QuartzV5Config ;
2929 }
3030
31- this . yamlDocument = parseDocument ( content , {
31+ const parsed = parseDocument ( content , {
3232 keepSourceTokens : true ,
3333 } ) ;
3434
35- return this . yamlDocument . toJSON ( ) as QuartzV5Config ;
35+ this . yamlDocument = parsed as Document < YAMLMap > ;
36+
37+ return parsed . toJSON ( ) as QuartzV5Config ;
3638 }
3739
3840 /**
@@ -119,7 +121,7 @@ export class QuartzConfigService {
119121 return this . configFormat ;
120122 }
121123
122- getRawYamlDocument ( ) : Document | null {
124+ getRawYamlDocument ( ) : Document < YAMLMap > | null {
123125 return this . yamlDocument ;
124126 }
125127
0 commit comments