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

Better documentation on how to use it #1

Open
olliechick opened this issue Feb 15, 2021 · 3 comments
Open

Better documentation on how to use it #1

olliechick opened this issue Feb 15, 2021 · 3 comments

Comments

@olliechick
Copy link

I can't get the package to work. See: https://runkit.com/embed/w5uy7gdx8ba2

@olliechick
Copy link
Author

Oh, I got it to work by extending the String prototype. See: https://runkit.com/embed/7rfag5apt41k

String.prototype.toURI = require('to-uri')
console.log('test кс x'.toURI('_'))

I think this should be made more obvious in the readme, or is there something I'm missing?

@olliechick
Copy link
Author

It would also be good to have an example where it is imported, e.g.

import { toURI } from 'to-uri';

function get_url_string(id, name) {
  return `${toURI(name)}-${id}`
}

@olliechick olliechick changed the title TypeError: this.toString is not a function Better documentation on how to use it Feb 15, 2021
@dmythro
Copy link
Member

dmythro commented Feb 15, 2021

Well, it's jus exported as a module and should do/work as specified in README. Need to check this one and add typings or rework with TypeScript :)

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