1.1.0 • Published 6 years ago

@edgarberlinck/string-utils v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

JavaScript Style Guide

String Utils

Collection of alot of string ultilities which I use all the time.

noSlug (string)

Return a new string without special characters and with lower case

Example

console.log(noSlug('Capitão'))
>> Should return 'capitao'

includeAll (target, term)

Return true if target contains all words in term

console.log(includeAll('Edgar Muniz Berlinck', 'Berlinck'))
>> Should return *true*
console.log(includeAll('Edgar Muniz Berlinck', 'Muniz Berlinck'))
>> Should return *true*
console.log(includeAll('Edgar Muniz Berlinck', 'Edgar Berlinck'))
>> Should return *true*
console.log(includeAll('Edgar Muniz Berlinck', 'Gostosão Berlinck'))
>> Should return *false*