mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
00d4f8073c
PR-URL: https://github.com/nodejs/node/pull/54904 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
35 lines
553 B
TypeScript
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);
|