node/benchmark/fixtures/strip-types-benchmark.ts
Marco Ippolito 00d4f8073c
benchmark: create benchmark for typescript
PR-URL: https://github.com/nodejs/node/pull/54904
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-25 17:25:18 +00:00

35 lines
553 B
TypeScript

type ComplexType = {
a: string;
b: number;
c: boolean;
d: {
e: string[];
f: {
g: number;
h: [string, number, boolean];
};
};
};
function processData(input: ComplexType): ComplexType {
return {
...input,
b: input.b + 1
};
}
const data: ComplexType = {
a: "test",
b: 42,
c: true,
d: {
e: ["hello", "world"],
f: {
g: 100,
h: ["str", 123, false]
}
}
};
export const result = processData(data);