-
Notifications
You must be signed in to change notification settings - Fork 10
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
Example use for documentation #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Thank you very much. It's a change in a right direction. I'd like to suggest few improvements to your improvements... if I may say so 😉
Also, just like in #12, please update the changelog and take credit for your work.
It's alright if you have no time for this. If that's the case just let me know and I'll take care of it.
README.md
Outdated
@@ -15,3 +15,28 @@ It provides a function that takes two string arguments and returns a hash like t | |||
```` | |||
|
|||
Please see [tests](./test/test.js) for more insights. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to move it below the example you provided.
README.md
Outdated
|
||
### Example | ||
|
||
Here is how you can use this package in an _Angular_ project: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that there is nothing specific to Angular in this example. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about:
Install
npm install damerau-levenshtein
Use with ES6 modules
import * as levenshtien from 'damerau-levenshtein';
// ...
const lev = levenshtien('hello world', 'Hello World!');
// { steps: 4, relative: 0.3076923076923077, similarity: 0.6923076923076923 }
Use with TypeScript
interface LevenshteinResponse {
steps: number;
relative: number;
similarity: number;
}
README.md
Outdated
|
||
*Optional* | ||
|
||
If you're using _TypeScript_, create an interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please provide more complete example? How would I use this interface?
Thank you for detailed feedback. What do you think of this? 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go. Thanks!
Hey, since you are using it with TypeScript, would you mind adding type annotations. If you do please make a separate PR and use the Of course only if you have time. You helped a lot already. |
This will be a great learning experience -- I've been meaning to learn how all the I'll look into it 👍 |
I've published your stuff: https://www.npmjs.com/package/damerau-levenshtein/v/1.0.5 Thank you very much. I'm looking forward for the TS PR. |
Thank you for the suggestion, hope this works: #14 |
I'm loving how useful and slim this package is ❤️
I thought minor documentation would be helpful 🙇