Expose fs as an option to override the default implementations

This commit is contained in:
Patrick Malouin
2019-06-27 09:25:17 +08:00
committed by Jun Yang
parent 2ae8c37a4f
commit edb2cc1f37
4 changed files with 33 additions and 4 deletions
+4 -1
View File
@@ -1,4 +1,5 @@
import * as _ from './util/underscore'
import IFS from './fs/ifs';
export interface LiquidOptions {
/** `root` is a directory or an array of directories to resolve layouts and includes, as well as the filename passed in when calling `.renderFile()`. If an array, the files are looked up in the order they occur in the array. Defaults to `["."]` */
@@ -28,7 +29,9 @@ export interface LiquidOptions {
outputDelimiterLeft?: string,
outputDelimiterRight?: string,
/** `greedy` is used to specify whether `trim*Left`/`trim*Right` is greedy. When set to `true`, all consecutive blank characters including `\n` will be trimed regardless of line breaks. Defaults to `true`. */
greedy?: boolean
greedy?: boolean,
/** `fs` is used to override the default file-system module with a custom implementation */
fs?: IFS
}
interface NormalizedOptions extends LiquidOptions {