Skip to content

Conversation

iamdanthedev
Copy link
Contributor

Hi

In view of the fact that the module was written in TS I tweaked tsconfig to export declaration files and added a couple of interfaces for type safety

Thanks

@iamdanthedev iamdanthedev mentioned this pull request Oct 24, 2017
src/index.ts Outdated
time_thrown: string;
data: any,
options: any,
data: string;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data isn't necessarily a string

@iamdanthedev
Copy link
Contributor Author

Hi!
It's a bit difficult for me to understand what's going on in the constructor without refactoring the code, I suppose it should be like this..

export interface ErrorConfig {
  message: string;
  time_thrown?: string;
  data?: any;
  options?: {
    showPath?: boolean;
    showLocations?: boolean;
  };
}

export interface ErrorInfo {
  message: string;
  name: string;
  time_thrown: string;
  data?: {};
  path?: string;
  locations?: any;
}

@thebigredgeek
Copy link
Owner

Sorta. Data should just be ?: any

@rohmanhm
Copy link

@rasdaniil Hi, any update?

@thebigredgeek thebigredgeek merged commit 6f4ffdc into thebigredgeek:master Feb 23, 2018
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

Successfully merging this pull request may close these issues.

3 participants