fix(build): modernize project configuration and test setup for current toolchain compatibility
This commit is contained in:
+4
-4
@@ -19,22 +19,22 @@ export class Smartfm {
|
||||
/**
|
||||
* add frontmatter to a string
|
||||
*/
|
||||
stringify(bodyString: string, frontmatterData: any) {
|
||||
stringify(bodyString: string, frontmatterData: Record<string, unknown>): string {
|
||||
return grayMatter.stringify(bodyString, frontmatterData);
|
||||
}
|
||||
|
||||
/**
|
||||
* parse a string that has frontmatter attached, YAML notation
|
||||
*/
|
||||
parse(stringToParse: string) {
|
||||
parse(stringToParse: string): grayMatter.GrayMatterFile<string> {
|
||||
return grayMatter(stringToParse);
|
||||
}
|
||||
|
||||
/**
|
||||
* parse from comments
|
||||
*/
|
||||
parseFromComments(commentStart: string, stringToParse: string) {
|
||||
const diffFunc = (diffMe, diffBy) => diffMe.split(diffBy).join('');
|
||||
parseFromComments(commentStart: string, stringToParse: string): grayMatter.GrayMatterFile<string> {
|
||||
const diffFunc = (diffMe: string, diffBy: string): string => diffMe.split(diffBy).join('');
|
||||
let lines = stringToParse.split('\n');
|
||||
lines = lines.map((line) => {
|
||||
return diffFunc(line, commentStart);
|
||||
|
||||
Reference in New Issue
Block a user