Skip to content

Commit

Permalink
chore: upgrade Deno to 1.0.0 (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored May 14, 2020
1 parent 1b8fd60 commit b4dbe9e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install deno
uses: denolib/setup-deno@master
with:
deno-version: 0.42.0
deno-version: 1.0.0

- name: Check formatting
run: deno fmt --check
Expand Down
6 changes: 3 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export {
BufReader,
BufWriter,
} from "https://deno.land/std@v0.42.0/io/bufio.ts";
} from "https://deno.land/std@0.51.0/io/bufio.ts";

export { copyBytes } from "https://deno.land/std@v0.42.0/io/util.ts";
export { copyBytes } from "https://deno.land/std@0.51.0/io/util.ts";

export {
Deferred,
deferred,
} from "https://deno.land/std@v0.42.0/util/async.ts";
} from "https://deno.land/std@0.51.0/async/deferred.ts";

export { Hash } from "https://deno.land/x/checksum@1.2.0/mod.ts";
10 changes: 5 additions & 5 deletions packet_writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class PacketWriter {
// https://stackoverflow.com/questions/2269063/buffer-growth-strategy
const newSize = oldBuffer.length + (oldBuffer.length >> 1) + size;
this.buffer = new Uint8Array(newSize);
copyBytes(this.buffer, oldBuffer);
copyBytes(oldBuffer, this.buffer);
}
}

Expand All @@ -76,7 +76,7 @@ export class PacketWriter {
} else {
const encodedStr = this.encoder.encode(string);
this._ensure(encodedStr.byteLength + 1); // +1 for null terminator
copyBytes(this.buffer, encodedStr, this.offset);
copyBytes(encodedStr, this.buffer, this.offset);
this.offset += encodedStr.byteLength;
}

Expand All @@ -90,7 +90,7 @@ export class PacketWriter {
}

this._ensure(1);
copyBytes(this.buffer, this.encoder.encode(c), this.offset);
copyBytes(this.encoder.encode(c), this.buffer, this.offset);
this.offset++;
return this;
}
Expand All @@ -99,14 +99,14 @@ export class PacketWriter {
string = string || "";
const encodedStr = this.encoder.encode(string);
this._ensure(encodedStr.byteLength);
copyBytes(this.buffer, encodedStr, this.offset);
copyBytes(encodedStr, this.buffer, this.offset);
this.offset += encodedStr.byteLength;
return this;
}

add(otherBuffer: Uint8Array) {
this._ensure(otherBuffer.length);
copyBytes(this.buffer, otherBuffer, this.offset);
copyBytes(otherBuffer, this.buffer, this.offset);
this.offset += otherBuffer.length;
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion test_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export {
assertStrContains,
assertThrows,
assertThrowsAsync,
} from "https://deno.land/std@v0.42.0/testing/asserts.ts";
} from "https://deno.land/std@0.51.0/testing/asserts.ts";
6 changes: 3 additions & 3 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function readInt32BE(buffer: Uint8Array, offset: number): number {

return (
(buffer[offset] << 24) |
(buffer[offset + 1] << 16) |
(buffer[offset + 2] << 8) |
buffer[offset + 3]
(buffer[offset + 1] << 16) |
(buffer[offset + 2] << 8) |
buffer[offset + 3]
);
}

Expand Down

0 comments on commit b4dbe9e

Please sign in to comment.