Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript export: characters in event names not escaped #212

Open
josephfh opened this issue Dec 13, 2023 · 0 comments
Open

Typescript export: characters in event names not escaped #212

josephfh opened this issue Dec 13, 2023 · 0 comments

Comments

@josephfh
Copy link

The issue: Apostrophes (and perhaps other characters) are not escaped in the types of both v4 and v5 Typescript export code

Example machine:
https://stately.ai/registry/editor/551d08e5-b2cc-4a56-9b3b-eaee238d42ee?machineId=5b385365-fc3c-41ff-b5f7-0b9ad1fc782c

Example output (see the types:)

import { createMachine } from 'xstate';

export const machine = createMachine({
  "id": "Untitled",
  "initial": "Rock?",
  "states": {
    "Rock?": {
      "on": {
        "let's rock": {
          "target": "Roll"
        }
      }
    },
    "Roll": {
      "on": {
        "let's roll": {
          "target": "Rock?"
        }
      }
    }
  },
  "types": {events: {} as {type: 'let's rock', } | {type: 'let's roll', }}
}, {
  actions:   {},
  actors:   {},
  guards:   {},
  delays:   {},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant