Skip to content

Transform breaks if field name isn't Capitalized #4

Closed
@zanami

Description

@zanami

also it fails if field name is something like 'large_video'

in transform.js

const pattern = new RegExp(`(${typeNames.map((w) => `${name}_${w}`).join("|")}) {`);

here's my regexp
/(Post_Slice_Hero|Post_Slice_editor|Post_Slice_large_video) {/

and here's what pattern.test runs against (for example)

'interface Page_Slice_LargeVideo { title: string; description?: string; media: any; poster?: string; }',

so 'rest' and 'interfaces' arrays get messed up and types eventually are broken

UPD: some more info

I believe it happens only to "typed lists" when label is used to set widgetName here

I'll have to disable labels anyways as they are less permanent and robust.

Thanks for a great module BTW. I wonder why it's not more popular. It would be great to have a way to parse a js object instead of config.yml to use with manual init .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions