Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Implement strict mode #453

Merged
merged 29 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6e30522
add TS strict mode to CI
bartlomieju May 25, 2019
9b96923
strict - clean log/
bartlomieju May 25, 2019
742c19e
strict - clean ws/ and testing/
bartlomieju May 25, 2019
d40b031
strict - clean archive/
bartlomieju May 25, 2019
68452b1
strict - clean fs/
bartlomieju May 25, 2019
c4948a5
strict - clean http/
bartlomieju May 25, 2019
1c2c688
strict - clean log/, mime/, prettier/, textproto/
bartlomieju May 25, 2019
2b2ec3a
strict - clean ws/, io/, fs/
bartlomieju May 25, 2019
fa00df0
fix CSV
zekth May 25, 2019
589cfb4
fixing toml
zekth May 25, 2019
681a87c
Merge pull request #1 from zekth/fix_toml_strict
bartlomieju May 25, 2019
ce6b612
more strict fixes
bartlomieju May 26, 2019
c072d6f
rewrite flags module in strict mode
bartlomieju May 26, 2019
3284359
Merge branch 'chore-refactor_flags_strict_mode' into chore-strict_tsc…
bartlomieju May 26, 2019
a8c8aa8
fs module strict
zekth May 26, 2019
d294937
Merge pull request #2 from zekth/strict_contrib
bartlomieju May 26, 2019
6f733a1
strict fix
zekth May 26, 2019
295e6bd
Merge pull request #3 from zekth/strict_another
bartlomieju May 26, 2019
898718f
last part of cleanup
bartlomieju May 26, 2019
e9364c2
fmt
bartlomieju May 26, 2019
eb7a354
Merge branch 'master' into chore-strict_tsconfig
bartlomieju May 26, 2019
2644bf1
lint
bartlomieju May 26, 2019
0429cb1
more fixes for strict mode
bartlomieju May 26, 2019
79cd16a
fix testing/format.ts
bartlomieju May 26, 2019
eef15e6
fix textproto
bartlomieju May 26, 2019
158ae3b
rename deno.tsconfig.json to tsconfig.test.json
bartlomieju May 26, 2019
77a7a90
Merge branch 'master' into chore-strict_tsconfig
bartlomieju May 30, 2019
f8ebcd6
fmt
bartlomieju May 30, 2019
1e36fdb
strict fixes after master merge
bartlomieju May 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
strict fix
  • Loading branch information
zekth committed May 26, 2019
commit 6f733a12ced67de88a9e11b10e16e82865458735
4 changes: 2 additions & 2 deletions io/bufio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export class BufWriter implements Writer {
return null;
}

let n: number = 0;
let n = 0;
let err: BufState = null;
try {
n = await this.wr.write(this.buf.subarray(0, this.n));
Expand Down Expand Up @@ -448,7 +448,7 @@ export class BufWriter implements Writer {
*/
async write(p: Uint8Array): Promise<number> {
let nn = 0;
let n: number = 0;
let n = 0;
while (p.byteLength > this.available() && !this.err) {
if (this.buffered() == 0) {
// Large write, empty buffer.
Expand Down
2 changes: 1 addition & 1 deletion util/async.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function deferred<T>(): Deferred<T> {
methods = { resolve, reject };
}
);
return Object.assign(promise, methods) as Deferred<T>;
return Object.assign(promise, methods)! as Deferred<T>;
}

interface TaggedYieldedValue<T> {
Expand Down
9 changes: 6 additions & 3 deletions util/deep_assign.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
export function deepAssign(target: object, ...sources: object[]): object {
export function deepAssign(
target: Record<string, unknown>,
...sources: object[]
): object | undefined {
for (let i = 0; i < sources.length; i++) {
const source = sources[i];
if (!source || typeof source !== `object`) {
return;
}
Object.entries(source).forEach(
([key, value]): void => {
([key, value]: [string, unknown]): void => {
if (value instanceof Date) {
target[key] = new Date(value);
return;
Expand All @@ -22,7 +25,7 @@ export function deepAssign(target: object, ...sources: object[]): object {
if (typeof target[key] !== `object` || !target[key]) {
target[key] = {};
}
deepAssign(target[key], value);
deepAssign(target[key] as Record<string, unknown>, value!);
}
);
}
Expand Down