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

Ability to override Uint8Array with a inherited type e.g. Buffer #4

Merged
merged 1 commit into from
Jul 12, 2021

Conversation

Borewit
Copy link
Owner

@Borewit Borewit commented Jul 12, 2021

This offers better backwards compatibility then v0.2.0 allowing by specifying Buffer for Array,, e.g.: IGetToken<T, Buffer>

Related to: Borewit/token-types#246, Borewit/strtok3#522

@jimmywarting
Copy link

jimmywarting commented Jul 12, 2021

Ability to override Uint8Array

Smart!
Another method if they don't want to do that could be to just extend (monky patch) something

class Backward extend A {
  getSomethign(...args) {
    return Buffer.from(super.getSomethign(...args).buffer)
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants