Add tslint.json and fix coding style accordingly for the most part.

This commit is contained in:
László Monda
2016-03-25 18:33:51 +01:00
parent 82f181d184
commit 0c7ff11f33
3 changed files with 115 additions and 19 deletions
+6 -6
View File
@@ -1,11 +1,11 @@
class UhkBuffer {
buffer: Buffer;
offset: number;
private static maxStringByteLength = 0xFFFF;
private static longStringPrefix = 0xFF;
private static stringEncoding = "utf8";
private static stringEncoding = 'utf8';
buffer: Buffer;
offset: number;
constructor(buffer: Buffer) {
this.offset = 0;
@@ -94,8 +94,8 @@ class UhkBuffer {
let stringByteLength = Buffer.byteLength(str, UhkBuffer.stringEncoding);
if (stringByteLength > UhkBuffer.maxStringByteLength) {
throw "Cannot serialize string: ${stringByteLength} bytes is larger " +
"than the maximum allowed length of ${UhkBuffer.maxStringByteLength} bytes";
throw 'Cannot serialize string: ${stringByteLength} bytes is larger ' +
'than the maximum allowed length of ${UhkBuffer.maxStringByteLength} bytes';
}
if (stringByteLength >= UhkBuffer.longStringPrefix) {