update ci

This commit is contained in:
2017-03-11 22:34:28 +01:00
parent 92da6611c7
commit a5a69ef25e
2 changed files with 33 additions and 24 deletions

View File

@@ -4,50 +4,50 @@ let grayMatter = require('gray-matter')
export type TFrontMatter = 'yaml' | 'json'
export interface IParsedFM {
data: any
content: string
orig: string
data: any
content: string
orig: string
}
export interface ISmartfmContructorOptions {
fmType: TFrontMatter
fmType: TFrontMatter
}
/**
* class smartfm handles frontmatter
*/
export class Smartfm {
fmType: TFrontMatter
fmType: TFrontMatter
constructor(optionsArg: ISmartfmContructorOptions) {
this.fmType = optionsArg.fmType
}
constructor(optionsArg: ISmartfmContructorOptions) {
this.fmType = optionsArg.fmType
}
/**
* add frontmatter to a string
*/
stringify(bodyString: string, frontmatterData: any) {
return stringify(bodyString, frontmatterData)
}
/**
* add frontmatter to a string
*/
stringify(bodyString: string, frontmatterData: any) {
return stringify(bodyString, frontmatterData)
}
/**
* parse a string that has frontmatter attached, YAML notation
*/
parse(stringToParse: string): IParsedFM {
return parse(stringToParse)
}
/**
* parse a string that has frontmatter attached, YAML notation
*/
parse(stringToParse: string): IParsedFM {
return parse(stringToParse)
}
}
/**
* parse a string that has frontmatter attached, YAML notation
*/
export let parse = (stringToParse: string): IParsedFM => {
return grayMatter(stringToParse)
return grayMatter(stringToParse)
}
/**
* add frontmatter to a string
*/
export let stringify = (bodyString: string, frontmatterData: any) => {
return grayMatter.stringify(bodyString, frontmatterData)
return grayMatter.stringify(bodyString, frontmatterData)
}