All files / src templateClass.ts

90% Statements 9/10
62.5% Branches 5/8
80% Functions 4/5
90% Lines 9/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 347x   7x             49x       7x 29x       7x 8x       7x 29x                  
import {nrSegment} from "./decorators";
 
export class TemplateClass {
    onCreate: Function | undefined;
    onRequest: Function | undefined;
    onChunk: Function | undefined;
    onResponseEnd: Function | undefined;
 
    _onCreate(...args: any[]) {
        this.onCreate && this.onCreate(...args);
    }
 
    @nrSegment("templateClass._onRequest", true)
    _onRequest(...args: any[]) {
        this.onRequest && this.onRequest(...args);
    }
 
    @nrSegment("templateClass._onChunk", true)
    _onChunk(...args: any[]) {
        this.onChunk && this.onChunk(...args);
    }
 
    @nrSegment("templateClass._onResponseEnd", true)
    _onResponseEnd(...args: any[]) {
        this.onResponseEnd && this.onResponseEnd(...args);
    }
 
    toDataAttribute(str: string) {
        return new Buffer(str).toString('base64');
    }
 
    [name: string]: any;
}