-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Summary
Enums should be exported as values - not only as types.
// this works, but is bad
import { type PaymentStatus } from '@stripe/terminal-js/pure'
const bad = terminal.getPaymentStatus() === ('waiting_for_input' as PaymentStatus)// this throws error, but should work
import { PaymentStatus } from '@stripe/terminal-js/pure'
const good = terminal.getPaymentStatus() === PaymentStatus.WAITING_FOR_INPUT)
// TypeError: Cannot read properties of undefined (reading 'WAITING_FOR_INPUT')Other information
Small repo that should work, but throws error:
https://codesandbox.io/s/competent-cloud-xku665?file=/src/index.ts
Metadata
Metadata
Assignees
Labels
No labels