Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/fast-levenshtein

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/fast-levenshtein

TypeScript definitions for fast-levenshtein

  • 0.0.4
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
114K
decreased by-23.69%
Maintainers
1
Weekly downloads
 
Created

What is @types/fast-levenshtein?

@types/fast-levenshtein provides TypeScript type definitions for the fast-levenshtein package, which is a fast implementation of the Levenshtein distance algorithm. This algorithm calculates the edit distance between two strings, which is useful for applications like spell checking, DNA sequencing, and natural language processing.

What are @types/fast-levenshtein's main functionalities?

Calculate Levenshtein Distance

This feature allows you to calculate the Levenshtein distance between two strings. In this example, the distance between 'kitten' and 'sitting' is calculated to be 3.

const levenshtein = require('fast-levenshtein');
const distance = levenshtein.get('kitten', 'sitting');
console.log(distance); // Outputs: 3

Find Closest Match

This feature helps in finding the closest match to a given string from an array of strings. In this example, 'flitting' is the closest match to 'fitting' from the array ['kitten', 'sitting', 'flitting'].

const levenshtein = require('fast-levenshtein');
const words = ['kitten', 'sitting', 'flitting'];
const closest = words.reduce((a, b) => levenshtein.get('fitting', a) < levenshtein.get('fitting', b) ? a : b);
console.log(closest); // Outputs: 'flitting'

Other packages similar to @types/fast-levenshtein

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc