import { ParserResult } from './parser/parser.result' ; import { ParserError , success } from './error' ; export class Packer { public static makeData < T > ( data , code = success ) { return { code , data } ; } public static makeError ( error ) { return { ... this . makeData ( error . text , error . code ) , stack : error . parserStack || { ... ParserError . defaultParserStack } } ; } }