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

license? #6

Open
GitNao opened this issue Oct 21, 2018 · 0 comments
Open

license? #6

GitNao opened this issue Oct 21, 2018 · 0 comments

Comments

@GitNao
Copy link

GitNao commented Oct 21, 2018

I want to add a function.
and more.

ex

  public cnv<T>(source: any): T {
    let obj: T = {} as T;
    Object.getOwnPropertyNames(source).forEach(propertyKey => {
      const designType = Reflect.getMetadata('design:type', this, propertyKey);
      const customType = Reflect.getMetadata('custom:type', this, propertyKey);
      const type = customType !== undefined ? customType : designType;
      obj[propertyKey] = this.convert(source[propertyKey], propertyKey, type, 0);
    });

    return obj;
  }
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