Adding private flag to private properties

This commit is contained in:
Fabian Stamm 2018-05-13 22:36:06 +02:00
parent 8d3b541d3d
commit 666ad69c3c
5 changed files with 6 additions and 10 deletions

5
lib/request.d.ts vendored
View File

@ -93,14 +93,13 @@ export declare enum QueryTypes {
export declare function SerializeName(name: string): Buffer;
export declare class Request implements Message {
private sendCallback;
_header: MessageHeader;
private _header;
readonly header: MessageHeader;
_questions: MessageQuestion[];
private _questions;
readonly questions: MessageQuestion[];
answers: RecourceRecord[];
authorities: RecourceRecord[];
additionals: RecourceRecord[];
_packet: Buffer;
constructor(packet: Buffer, sendCallback: (packet: Buffer) => any);
error(error: ErrorCodes): void;
noRecursion(): void;

View File

@ -168,7 +168,6 @@ class Request {
this.answers = [];
this.authorities = [];
this.additionals = [];
this._packet = packet;
let headerData = Buffer.alloc(12);
packet.copy(headerData, 0, 0, 12);
let bodyData = Buffer.alloc(packet.length - 12);

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "nodename-core",
"version": "0.1.8",
"version": "0.1.9",
"main": "lib/listener.js",
"types": "lib/listener.d.ts",
"author": "Fabian Stamm <dev@fabianstamm.de>",

View File

@ -188,12 +188,12 @@ export function SerializeName(name: string) {
}
export class Request implements Message {
_header: MessageHeader;
private _header: MessageHeader;
get header() {
return Object.assign({}, this._header);
}
_questions: MessageQuestion[];
private _questions: MessageQuestion[];
get questions() {
return this._questions.map(e => e);
}
@ -202,9 +202,7 @@ export class Request implements Message {
authorities: RecourceRecord[] = [];
additionals: RecourceRecord[] = [];
_packet: Buffer;
constructor(packet: Buffer, private sendCallback: (packet: Buffer) => any) {
this._packet = packet;
let headerData = Buffer.alloc(12);
packet.copy(headerData, 0, 0, 12);
let bodyData = Buffer.alloc(packet.length - 12);