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

@types/string-similarity

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/string-similarity

TypeScript definitions for string-similarity

  • 4.0.2
  • 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
55K
decreased by-55.1%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/string-similarity

Summary

This package contains type definitions for string-similarity (https://github.com/aceakash/string-similarity#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-similarity.

index.d.ts

export as namespace stringSimilarity;

/**
 * Returns a fraction between 0 and 1, which indicates the degree of similarity between the two strings.
 * `0` indicates completely different strings, `1` indicates identical strings. The comparison is case-insensitive.
 *
 * @param string1 The first string
 * @param string2 The second string
 * @returns A fraction from 0 to 1, both inclusive. Higher number indicates more similarity.
 */
export function compareTwoStrings(string1: string, string2: string): number;

/**
 * Compares `mainString` against each string in `targetStrings`.
 *
 * @argument mainString: The string to match each target string against.
 * @argument targetStrings: Each string in this array will be matched against the main string.
 * @returns An object with a `ratings` property, which gives a similarity rating for each target string,
 *          a `bestMatch` property, which specifies which target string was most similar to the main string,
 *          and a `bestMatchIndex` property, which specifies the index of the `bestMatch` in the `targetStrings` array.
 */
export function findBestMatch(mainString: string, targetStrings: string[]): BestMatch;

export interface Rating {
    target: string;
    rating: number;
}
export interface BestMatch {
    ratings: Rating[];
    bestMatch: Rating;
    bestMatchIndex: number;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 20:08:00 GMT
  • Dependencies: none

Credits

These definitions were written by ragtime, BendingBender, and Piotr Błażejewicz.

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