@@ -12,7 +12,7 @@ import { TagMap } from './template/tag/tag-map'
12
12
import { FilterMap } from './template/filter/filter-map'
13
13
import { LiquidOptions , normalizeDirectoryList , NormalizedFullOptions , normalize , RenderOptions } from './liquid-options'
14
14
import { FilterImplOptions } from './template/filter/filter-impl-options'
15
- import { toPromise , toValue } from './util/async'
15
+ import { toPromise , toValueSync } from './util/async'
16
16
17
17
export * from './util/error'
18
18
export * from './types'
@@ -47,7 +47,7 @@ export class Liquid {
47
47
return toPromise ( this . _render ( tpl , scope , { ...renderOptions , sync : false } ) )
48
48
}
49
49
public renderSync ( tpl : Template [ ] , scope ?: object , renderOptions ?: RenderOptions ) : any {
50
- return toValue ( this . _render ( tpl , scope , { ...renderOptions , sync : true } ) )
50
+ return toValueSync ( this . _render ( tpl , scope , { ...renderOptions , sync : true } ) )
51
51
}
52
52
public renderToNodeStream ( tpl : Template [ ] , scope ?: object , renderOptions : RenderOptions = { } ) : NodeJS . ReadableStream {
53
53
const ctx = new Context ( scope , this . options , renderOptions )
@@ -62,7 +62,7 @@ export class Liquid {
62
62
return toPromise ( this . _parseAndRender ( html , scope , { ...renderOptions , sync : false } ) )
63
63
}
64
64
public parseAndRenderSync ( html : string , scope ?: object , renderOptions ?: RenderOptions ) : any {
65
- return toValue ( this . _parseAndRender ( html , scope , { ...renderOptions , sync : true } ) )
65
+ return toValueSync ( this . _parseAndRender ( html , scope , { ...renderOptions , sync : true } ) )
66
66
}
67
67
68
68
public _parsePartialFile ( file : string , sync ?: boolean , currentFile ?: string ) {
@@ -75,7 +75,7 @@ export class Liquid {
75
75
return toPromise < Template [ ] > ( this . parser . parseFile ( file , false ) )
76
76
}
77
77
public parseFileSync ( file : string ) : Template [ ] {
78
- return toValue < Template [ ] > ( this . parser . parseFile ( file , true ) )
78
+ return toValueSync < Template [ ] > ( this . parser . parseFile ( file , true ) )
79
79
}
80
80
public async renderFile ( file : string , ctx ?: object , renderOptions ?: RenderOptions ) {
81
81
const templates = await this . parseFile ( file )
@@ -98,7 +98,7 @@ export class Liquid {
98
98
return toPromise ( this . _evalValue ( str , ctx ) )
99
99
}
100
100
public evalValueSync ( str : string , ctx : Context ) : any {
101
- return toValue ( this . _evalValue ( str , ctx ) )
101
+ return toValueSync ( this . _evalValue ( str , ctx ) )
102
102
}
103
103
104
104
public registerFilter ( name : string , filter : FilterImplOptions ) {
0 commit comments