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

Return undefined instead of null #56

Open
toonpang opened this issue Jul 7, 2022 · 0 comments
Open

Return undefined instead of null #56

toonpang opened this issue Jul 7, 2022 · 0 comments

Comments

@toonpang
Copy link

toonpang commented Jul 7, 2022

The current implementation of the transformer returns undefined instead of null when the column is null.
Will it be better if it stick to the same return type as Typeorm.

public from(value?: string | null): string | undefined {
    if (!value) {
      return;     // Should it return value instead?
    }
    return decryptData(
      Buffer.from(value as string, 'base64'),
      this.options
    ).toString('utf8');
  }
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