fix(build): modernize project configuration and test setup for current toolchain compatibility
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartfm',
|
||||
version: '2.2.2',
|
||||
version: '2.2.3',
|
||||
description: 'A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.'
|
||||
}
|
||||
|
||||
+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