Skip to content

Request for code review in gen_functional_types.ts #1721

@dmytro-kravchyna

Description

@dmytro-kravchyna

Could you please review this code, it may have a potential bug?

File: src/schema-generator/gen_functional_types.ts
Code snippet:

tsSchema.push('function TypeInitialiser(schema:number,tapeItem:any) {');
tsSchema.push('if (Array.isArray(tapeItem)) tapeItem.map((p:any)=>TypeInitialiser(schema,p));');
tsSchema.push('if (tapeItem.typecode) return TypeInitialisers[schema][tapeItem.typecode](tapeItem.value); return tapeItem.value;');
tsSchema.push('}');

Shouldn't it be if (Array.isArray(tapeItem)) return tapeItem.map((p:any)=>TypeInitialiser(schema,p)) ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions