index.flow.js 345 B

123456789101112131415
  1. declare module "levenary" {
  2. /**
  3. Return the string within `array`, whose Levenshtein distance from `str` is minimal.
  4. @example
  5. ```
  6. import levenary from 'levenary';
  7. levenary('cat', ['cow', 'dog', 'pig']);
  8. //=> 'cow'
  9. ```
  10. */
  11. declare function levenary (str: string, array: string[]): string;
  12. declare export default typeof levenary;
  13. }