mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
refactor: make loader.shouldLoadRelative public
This commit is contained in:
+1
-2
@@ -1,7 +1,6 @@
|
||||
import * as _ from '../util/underscore'
|
||||
import { resolve as nodeResolve, extname, dirname as nodeDirname } from 'path'
|
||||
import { stat, statSync, readFile as nodeReadFile, readFileSync as nodeReadFileSync } from 'fs'
|
||||
import { LiquidOptions } from '../liquid-options'
|
||||
|
||||
const statAsync = _.promisify(stat)
|
||||
const readFileAsync = _.promisify<string, string, string>(nodeReadFile)
|
||||
@@ -28,7 +27,7 @@ export function existsSync (filepath: string) {
|
||||
export function readFileSync (filepath: string) {
|
||||
return nodeReadFileSync(filepath, 'utf8')
|
||||
}
|
||||
export function resolve (root: string, file: string, ext: string, opts: LiquidOptions) {
|
||||
export function resolve (root: string, file: string, ext: string) {
|
||||
if (!extname(file)) file += ext
|
||||
return nodeResolve(root, file)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user