All files Parser.ts

50% Statements 2/4
0% Branches 0/2
50% Functions 1/2
50% Lines 2/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24                    2x                       2x  
import Core from './Core';
 
export default interface Parser {
  // 前置处理方法
  pre?(current: any, parent: any): any;
 
  // 后置处理方法
  post?(current: any, parent: any): any;
}
 
export default abstract class Parser {
  // @ts-ignore
  protected config: Object;
  // @ts-ignore
  protected context: Core;
 
  constructor(config: Object = {}, context: Core) {
    Object.assign(this, {
      config,
      context,
    });
  }
}