Skip to content

Custom types dont seem to map properly for sfcc server execution #16

@z1haze

Description

@z1haze

customtypes.js takes things like enum-of-int, and maps it over to an enum type, but those types don't translate over into SFCC script, where the code actually runs. I am trying to understand how to get actually get the types for the native system objects in typescript that aren't mapped incorrectly. for example, a custom attribute of type enum-of-int is actually not an enum of number, but rather objects with value and displayValue fields. Trying to use this type the way it has to be used in serverside code (on sfcc), results typescript errors. Running the code to satisfy the compiler results in runtime errors. Please advise.

My current "fix" for this is to always call valueOf() on the enum. This exists both in sfcc and ecma

Metadata

Metadata

Assignees

No one assigned

    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