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

@types/js-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/js-levenshtein

TypeScript definitions for js-levenshtein

  • 1.1.3
  • 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
937K
decreased by-42.89%
Maintainers
1
Weekly downloads
 
Created

What is @types/js-levenshtein?

The @types/js-levenshtein package provides TypeScript type definitions for the js-levenshtein package, which is an efficient JavaScript implementation of the Levenshtein algorithm. This algorithm calculates the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one word into another. The type definitions enable TypeScript developers to use js-levenshtein in their projects with type checking, ensuring that they pass the correct types of arguments to the functions and use the returned values as expected.

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

Calculating Levenshtein Distance

This feature allows you to calculate the Levenshtein distance between two strings, which is the minimum number of single-character edits required to change one string into the other. The code sample demonstrates how to import the levenshtein function and use it to calculate the distance between 'kitten' and 'sitting', which is 3.

import levenshtein from 'js-levenshtein';
const distance = levenshtein('kitten', 'sitting');
console.log(distance); // Output: 3

Other packages similar to @types/js-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