Skip to content

Commit

Permalink
mk: upgrade to TypeScript 5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed Jun 24, 2024
1 parent 38be17c commit 556999f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mk/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [[ $ACT == lint ]]; then
if [[ $1 == all ]]; then
shift
fi
exec env NODE_OPTIONS='--max-old-space-size=6144' xo-yoursunny $XOFLAG "$@"
exec env NODE_OPTIONS='--max-old-space-size=8192' xo-yoursunny $XOFLAG "$@"
fi

ROOTDIR=$(pwd)
Expand Down
2 changes: 1 addition & 1 deletion mk/typedoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if [[ $# -gt 0 ]]; then
ENTRYPOINTS=''
fi

exec env NODE_OPTIONS='--max-old-space-size=6144' typedoc --options mk/typedoc.config.cjs --tsconfig mk/tsconfig-typedoc.json --entryPoints $ENTRYPOINTS "$@"
exec env NODE_OPTIONS='--max-old-space-size=8192' typedoc --options mk/typedoc.config.cjs --tsconfig mk/tsconfig-typedoc.json --entryPoints $ENTRYPOINTS "$@"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@yoursunny/xo-config": "0.58.0",
"codedown": "^3.1.0",
"tslib": "^2.6.3",
"typedoc": "^0.26.1",
"typescript": "~5.4.5",
"typedoc": "^0.26.2",
"typescript": "~5.5.2",
"vitest": "^1.6.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/lp/tests/service.t.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ test("fragmentation", async () => {
const output = await pipeline(
input,
new LpService({ mtu: 1200 }, { mtu: Infinity }).tx,
filter((item): item is Uint8Array => item instanceof Uint8Array),
filter((item) => item instanceof Uint8Array),
tap((fragment) => fragments.push(fragment)),
map((buf: Uint8Array) => new Decoder(buf).read()),
new LpService({ reassemblerCapacity: 2 }, { mtu: Infinity }).rx,
Expand Down
2 changes: 1 addition & 1 deletion pkg/node-transport/src/udp-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export namespace UdpTransport {
export async function multicasts(opts: Except<udp.MulticastOptions, "intf"> = {}): Promise<UdpTransport[]> {
const intfs = udp.listMulticastIntfs();
return (await Promise.allSettled(intfs.map((intf) => UdpTransport.multicast({ ...opts, intf }))))
.filter((res): res is PromiseFulfilledResult<UdpTransport> => res.status === "fulfilled")
.filter((res) => res.status === "fulfilled")
.map(({ value }) => value);
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/repo-api/src/data-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export namespace Insert {
})();
},
get singles() {
return args.filter((a): a is Data => a instanceof Data);
return args.filter((a) => a instanceof Data);
},
get batches() {
return args.filter(isDataIterable);
Expand Down
2 changes: 1 addition & 1 deletion pkg/repo-api/src/data-tape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class DataTape implements DataTape.Reader, DataTape.Writer {
return undefined;
}
}),
filter((data): data is Data => data instanceof Data),
filter((data) => data instanceof Data),
cb,
);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/trust-schema/src/schema/versec/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as N from "./nest";
import * as T from "./token";

/** AST node. */
export abstract class Node { // eslint-disable-line @typescript-eslint/no-extraneous-class
export abstract class Node {
public abstract toTokens(): Iterable<T.Token>;
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/trust-schema/src/schema/versec/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,7 @@ class Compiler {
let filters: VariablePattern.Filter[];
let op: typeof F.Or | typeof F.And = F.And;
if (cc instanceof A.ComponentConstraint) {
filters = cc.terms.map((term) => this.makeConstraintTermFilter(term, ctx))
.filter((f): f is VariablePattern.Filter => !!f);
filters = cc.terms.map((term) => this.makeConstraintTermFilter(term, ctx)).filter((f) => !!f);
} else if (cc instanceof A.ComponentConstraintRel) {
filters = [
this.makeConstraintFilter(cc.left, ctx),
Expand Down
2 changes: 1 addition & 1 deletion pkg/trust-schema/src/schema/versec/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function declareOperator(className: string, opPretty: string, autoCommaAfter: bo
},
};
OPERATORS[op] = klass[className]!;
return OPERATORS[op]!;
return OPERATORS[op];
}

const OPERATORS: Record<string, new() => Operator> = {};
Expand Down

0 comments on commit 556999f

Please sign in to comment.