mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
Changes including: - will not call fs.resolve when normalizing `fs` - removed hardcoded `/` - mandatory `fs.dirname` for relative reference - mandatory `fs.sep`, defaults to '/'
This commit is contained in:
+14
-2
@@ -1,8 +1,20 @@
|
||||
import { LoaderOptions } from './loader'
|
||||
|
||||
export interface FS {
|
||||
/** check if a file exists asynchronously */
|
||||
exists: (filepath: string) => Promise<boolean>;
|
||||
readFile: (filepath: string) => Promise<string>;
|
||||
/** check if a file exists synchronously */
|
||||
existsSync: (filepath: string) => boolean;
|
||||
/** read a file asynchronously */
|
||||
readFile: (filepath: string) => Promise<string>;
|
||||
/** read a file synchronously */
|
||||
readFileSync: (filepath: string) => string;
|
||||
resolve: (root: string, file: string, ext: string) => string;
|
||||
/** resolve a file against directory, for given `ext` option */
|
||||
resolve: (dir: string, file: string, ext: string, options?: LoaderOptions) => string;
|
||||
/** defaults to "/", will be used for "within roots" check */
|
||||
sep?: string;
|
||||
/** dirname for a filepath, used when resolving relative path */
|
||||
dirname?: (file: string) => string;
|
||||
/** fallback file for lookup failure */
|
||||
fallback?: (file: string) => string | undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user