@@ -33,7 +33,11 @@ function split(str: string) {
33
33
return { content : str } ;
34
34
}
35
35
36
- function parse ( str : string , options ) {
36
+ interface ParseOptions {
37
+ defaultTimeZone ?: string ;
38
+ }
39
+
40
+ function parse ( str : string , options : ParseOptions = { } ) {
37
41
if ( typeof str !== 'string' ) throw new TypeError ( 'str is required!' ) ;
38
42
39
43
const splitData = split ( str ) ;
@@ -55,11 +59,7 @@ function parse(str: string, options) {
55
59
return data ;
56
60
}
57
61
58
- interface ParseOptions {
59
- defaultTimeZone ?: string ;
60
- }
61
-
62
- function parseYAML ( str , options : ParseOptions = { } ) {
62
+ function parseYAML ( str , options : ParseOptions ) {
63
63
const result = ymlParse ( escapeYAML ( str ) , {
64
64
customTags : [ timestampFactory ( options . defaultTimeZone ) ]
65
65
} ) ;
@@ -113,7 +113,10 @@ function stringify(obj, options: StringifyOptions = {}) {
113
113
if ( mode === 'json' ) {
114
114
result += stringifyJSON ( obj ) ;
115
115
} else {
116
- result += stringifyYAML ( obj , options ) ;
116
+ result += stringifyYAML ( obj , {
117
+ defaultStringType : 'PLAIN' ,
118
+ singleQuote : true
119
+ } ) ;
117
120
}
118
121
119
122
result += `${ separator } \n${ content } ` ;
0 commit comments