Updates the customData type to match as is in shared.ts
In paddle-js-v2 we actually allow any valid object including nested objects so this updates the type to reflect that
if (hasValue(input.customData)) {
try {
// When we pass this value using `data-custom-data` html attribute it will be a string. So we are parsing it to check its validity
const customData = typeof input.customData === 'string' ? JSON.parse(input.customData) : input.customData
if (isObjectValid(customData)) {
checkoutProps.customData = JSON.stringify(customData)
} else {
throw new Error('Invalid custom data')
}
} catch (e) {
logger.log(INVALID_CUSTOM_DATA, LOG_LEVEL.WARNING, true)
}
}
Changes:
Updates the
customData
type to match as is in shared.tsIn
paddle-js-v2
we actually allow any valid object including nested objects so this updates the type to reflect thatTesting
Tested locally with
pnpm link
is now a valid option, but things like:
remain invalid