1.0.1 • Published 3 years ago

asearch v1.0.1

Weekly downloads
134
License
BSD-2-Clause
Repository
github
Last release
3 years ago

Node Asearch

Approximate pattern matching on JavaScript

Install

$ npm install asearch

Usage

const Asearch = require('asearch')

const match = Asearch('abcde')

console.log(match('abcde'))    // => true
console.log(match('AbCdE'))    // => true
console.log(match('abcd'))     // => false
console.log(match('abcd', 1))  // => true
console.log(match('ab de', 1)) // => true
console.log(match('abe', 1))   // => false
console.log(a.match('abe', 2))   // => true

Typo

const match = Asearch('cheese burger')

console.log(match('cheese burger'))   // => true
console.log(match('chess burger'))    // => false
console.log(match('chess burger', 2)) // => true
console.log(match('chess', 2))        // => false

2 byte chars

const match = Asearch('漢字文字列')

console.log(match('漢字文字列'))    // => true
console.log(match('漢字の文字列'))  // => false
console.log(match('漢字の文字列', 1)) // => true

Test

$ git clone https://github.com/shokai/node-asearch.git
$ cd node-asearch
$ npm i
$ npm test
1.0.1

3 years ago

1.0.0

3 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago