aynen
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

aynen

Compare camelized/dasherized/underscored strings each other

Install

npm install aynen
yarn add aynen

Usage

import aynen from 'aynen';

aynen('fooBar', 'foo-bar');
//=> true

aynen('foo_bar', 'FOO-BAR');
//=> true

aynen('foo_bar', 'foo bar');
//=> true

aynen('foo', 'bar');
//=> false

Options

Name: rating Type: boolean Default: false

Return a object with degree of similarity and comparation between two strings

import aynen from 'aynen';

aynen('fooBar', 'foo-bar', 
    { 
        rating: true
    }
);
//=> { isSame: true, similarityRating: 1 }

aynen('foo-bar', 'bar_FOO',
    { 
        rating: true
    }
);
//=> { isSame: false, similarityRating: 0.8 }

Related

Package Sidebar

Install

npm i aynen

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.3 kB

Total Files

5

Last publish

Collaborators

  • ahmetozantekin