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

dataValues not defined #76

Closed
JD-Robbs opened this issue Nov 4, 2016 · 2 comments
Closed

dataValues not defined #76

JD-Robbs opened this issue Nov 4, 2016 · 2 comments

Comments

@JD-Robbs
Copy link
Contributor

JD-Robbs commented Nov 4, 2016

this.dataValues causes squiggly lines in instance methods since there's no definition for it ("TS2339: Property 'dataValues' does not exist on type 'User'.") - perhaps it's missing?

For example:

import * as _ from 'lodash';

class User extends Model {
    public id: string;
    [...]

    public toJSON() {
        return _.omit(this.dataValues, ['passwordHash']);
    }
}
@felixfbecker
Copy link
Collaborator

felixfbecker commented Nov 4, 2016

dataValues is internal API and might even go away in v4. Use this.get()

@JD-Robbs
Copy link
Contributor Author

JD-Robbs commented Nov 4, 2016

Thanks - much appreciated! Didn't realise it's internal.

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

2 participants