feat(yaml): use !match tag to process content
This commit is contained in:
@@ -2,7 +2,7 @@ import path from 'path'
|
||||
import { parse } from 'yaml'
|
||||
import fs from 'fs'
|
||||
|
||||
export function read(file_dir) {
|
||||
export function read(file_dir, customTags = []) {
|
||||
const include = {
|
||||
identify: value => value.startsWith('!include'),
|
||||
tag: '!include',
|
||||
@@ -14,6 +14,6 @@ export function read(file_dir) {
|
||||
}
|
||||
const file = fs.readFileSync(file_dir, 'utf8')
|
||||
return parse(file, {
|
||||
customTags: [include],
|
||||
customTags: [include, ...customTags],
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user