1.0.0 • Published 2 years ago

aynen v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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