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

Type for fromPEM argument could be Buffer | string #5

Open
brianmhunt opened this issue Jun 3, 2019 · 0 comments
Open

Type for fromPEM argument could be Buffer | string #5

brianmhunt opened this issue Jun 3, 2019 · 0 comments

Comments

@brianmhunt
Copy link

Just a cosmetic typing note:

at https://github.com/fidm/x509/blob/master/src/x509.ts#L296 the data argument is converted via toString in https://github.com/fidm/asn1/blob/master/src/pem.ts#L44, so it seems like it could safely receive a string, and a more general parameter type could be Buffer | string i.e.

  static fromPEM (data: Buffer | string): Certificate {
    return Certificate.fromPEMs(data)[0]
  }
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