Skip to content

Commit e58847e

Browse files
committed
chore: remove unused depth
1 parent 74e12ce commit e58847e

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

scripts/convert-to-typescript/interface-generation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export function createInterfaceDefinition(
1414
interfaceName: string,
1515
interfaceToProcess: InterfaceToProcess,
1616
project: Project,
17-
depth = 0,
1817
): void {
1918
let interfaceDefinition = context.interfaceDefinitions.get(interfaceName);
2019

@@ -34,7 +33,7 @@ export function createInterfaceDefinition(
3433
};
3534

3635
// Get all properties
37-
let properties = getProperties(interfaceToProcess.obj, depth);
36+
let properties = getProperties(interfaceToProcess.obj);
3837

3938
// Check if object is a protobuf message
4039
if (properties.includes('toObject') && properties.includes('serializeBinary') && properties.includes('getClassName')) {

scripts/convert-to-typescript/utils.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,13 @@ export function formatInterfaceName(interfaceName: string): string {
5959
* and returns them as an array, excluding default prototype properties.
6060
* This also includes all functions
6161
*/
62-
export function getProperties(obj: unknown, depth = 0): string[] {
62+
export function getProperties(obj: unknown): string[] {
6363
if (obj === null || typeof obj !== 'object') return [];
6464
if (obj[Symbol.toStringTag] !== undefined) return ['values'];
6565

6666
const properties = new Set<string>();
6767
let currentObj: object | null = obj;
6868

69-
// for (let i = 0; i < depth; i++) {
70-
// currentObj = Object.getPrototypeOf(currentObj) as object | null;
71-
// }
72-
7369
do {
7470
const ownProps = Object.getOwnPropertyNames(currentObj);
7571
ownProps.forEach((propName) => {

0 commit comments

Comments
 (0)