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

ITransformEntriesToTypeConfig.identityKey does not return Promise in type definitions #1094

Open
gigaSproule opened this issue Jun 17, 2022 · 0 comments

Comments

@gigaSproule
Copy link

Expected Behavior

ITransformEntriesToTypeConfig should have the type definition for identityKey return a Promise as per https://github.com/contentful/contentful-migration/blob/master/src/lib/action/entry-transform-to-type.ts#L13.

Actual Behavior

Get the typescript error "Type '(fields: ContentFields) => Promise<string | undefined>' is not assignable to type '(fromFields: ContentFields) => string'.
Type 'Promise<string | undefined>' is not assignable to type 'string'.ts(2322)".

Possible Solution

Add Promise to type information for function.

Steps to Reproduce

  1. Create a migration script which calls transformEntriesToType
  2. Pass in a function for identityKey which returns a Promise
  3. Try to compile with tsc

Context

Environment

  • Node Version: v14.19.3
  • Package Manager Version: yarn 1.18.0
  • Operating System: Arch Linux
  • Package Version: 4.8.1
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