aynen
v1.0.0
Published
Compare camelized/dasherized/underscored strings each other
Downloads
5
Maintainers
Readme
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 }